02 First Agent View Dispatch - alexherrero/agentm GitHub Wiki
Note
Goal: Run a background Agent View session and verify your machine's auth setup. Time: ~5 minutes. Prereqs: Claude Code installed and harness installed into a project (Your first install). No vault required.
By the end of this tutorial you'll have run one real background session through Agent View, and you'll know the one setup step every new machine needs before dispatch works at all.
Agent View provides background sessions for unattended task execution. It uses claude --bg and claude agents to run processes independently. The session survives machine sleep and restart. As of Claude Code 2.1.198, it auto-commits, pushes, and opens a draft pull request when it finishes. Read the autonomy design for design details.
Agent View is a Claude Code feature — see Compatibility for which hosts the harness supports.
Run the status command:
claude auth statusCheck the command output:
-
loggedIn: true: Skip to Step 3. -
loggedIn: false: Proceed to Step 2.
Fresh machines print loggedIn: false. Interactive hosts like IDE extensions and desktop apps inject temporary auth per session.
Run the login command:
claude auth loginFollow the prompts to authenticate the base CLI. A background session spawned with claude --bg runs as an isolated process. It does not inherit auth from an interactive host. Persistent login gives the background process its own authentication.
Verify the authentication status:
claude auth statusConfirm the command output shows loggedIn: true.
Start a background session:
claude --bg "echo hello from agent view"Check the active sessions:
claude agentsThe output lists active background sessions with these fields:
-
sessionId: The unique session identifier. -
pid: The background process ID. -
startedAt: The start timestamp.
Run claude agents --json --all to view the final status after completion — --all includes finished sessions; without it, --json only lists active ones.
-
A background session doesn't inherit your interactive host's auth.
claude --bgspawns its own process, so it needsclaude auth loginrun once on that machine. -
claude auth statustells you where you stand. Run it before assuming a dispatch will work. -
This is a one-time step per machine. Once the login succeeds, every later
claude --bgdispatch works without repeating it.
- Understand the design behind Agent View: Autonomy.
- Install AgentM on your machine: Install AgentM machine-wide.