[FEATURE] Auto-pin new background agent sessions in agent view (FleetView)

Resolved 💬 1 comment Opened Jun 24, 2026 by dinohuang102 Closed Jun 24, 2026

Summary

Add a way to make newly created background agent sessions pinned by default in the agent view (FleetView / claude agents), instead of requiring a manual Ctrl+T on every new session.

Problem / Motivation

In the agent view, pinning a session (Ctrl+T) does two useful things:

  • keeps it at the top of the list, and
  • keeps its process alive (a pinned session is not stopped by the supervisor after the ~1h idle timeout).

For users who rely on long-lived background sessions, every new session starts unpinned, so it can be auto-stopped after idling and has to be manually re-pinned each time. There is currently no way to change this default.

What I investigated (current state, v2.1.187)

I checked whether any existing mechanism can auto-pin, and none can:

| Surface | Result |
|---|---|
| settings.json | No relevant key (only agent, disableAgentView) |
| Environment variables | None (CLAUDE_CODE_DISABLE_AGENT_VIEW etc. don't control pin) |
| Hooks (SessionStart / SubagentStart) | Hook output can't affect the agent-view pin UI state |
| Local state files | No pinned field in ~/.claude/daemon/roster.json or ~/.claude/jobs/*/state.json |
| CLI flags | claude agents --help has no --pin / --default-pin |

Pin appears to be an in-memory UI state with no configuration, env var, hook, file, or CLI surface to control it.

Proposed solutions (any one would work)

  1. A settings.json option, e.g. "agentView": { "pinNewSessionsByDefault": true }.
  2. A CLI flag to start a background session already pinned, e.g. claude --bg --pin.
  3. Persist pin state to the roster/state file so it can be pre-seeded.

Related issues

These touch session pinning but in the desktop sidebar context, not the agent view / background-session lifecycle:

  • #63842 (selective session retention via pinning)
  • #62104 (prevent archiving/deleting pinned sessions)
  • #61321 (docs: agent view pinning lifecycle) — confirms the area:agent-view surface

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗