Harness Notes

Commands

Updated 2026-11-22,

On this page

The command for each task, in each harness. Pick what you are working with, then read across: commands you type in your shell or a script and commands you type inside an open session are listed separately. Commands for renaming sessions are on Thread naming and importing from another harness on Migration.

From your shell

Commands you run in a terminal or script, outside a session.

TaskClaude Codechecked at 2.1.296
Use
Open the manager

claude agents [options]

Open agent view to monitor and start supervised sessions.

1 note

Requires an interactive terminal.

List

claude agents --json [--all] [--cwd <path>]

Print active interactive and background sessions as JSON.

1 note

State is working, blocked, done, failed or stopped, on background entries only.

Show logs

claude logs <id|name>

Print a supervised session's recent output.

Start in the background

claude --bg [--name <name>] [prompt]

also claude --background [prompt]

Start a supervised session that keeps running without a terminal, and print its short id.

2 notes

Rejected with -p. With --resume <session-id> it continues that session in the background.

Checks workspace trust; an untrusted directory errors in a script.

claude --bg --exec <command>

Run a shell job under the supervisor instead of a model session.

1 note

Output stays in memory; the row is cleaned up about 5 minutes after exit. Not shown in claude --help.

claude --bg --agent <agent> [prompt]

Start a supervised session whose main agent is a named subagent definition.

1 note

An unknown name still reports as backgrounded, then exits immediately.

Attach

claude attach <id|name>

Open a supervised session in this terminal, restarting it if it exited.

1 note

Part of the session name works while it runs (2.1.290+); use the id to restart a stopped one. Ctrl+Z returns to the shell.

Change
Restart

claude respawn <id>|--all

Restart one supervised session, or every running one, on the installed binary.

Remove
Stop

claude stop <id>

also claude kill <id>

Stop a supervised session's process while keeping its conversation.

Delete

claude rm <id> [--discard-unpushed <commit>@<worktree-id>] [--force-remove-worktree <worktree-id>]

Remove a supervised session from the list, and its worktree when safe.

1 note

The conversation transcript stays on disk.

Inside a session

Slash commands you type into an open session.

TaskClaude Codechecked at 2.1.296
Use
Start in the background

/background [prompt]

also /bg [prompt]

Move the current conversation into a supervised session and free the terminal.

1 note

An in-flight response continues.

Fork

/fork [prompt]

Copy the current conversation into a new supervised session.

1 note

Requires 2.1.212+; with agent view off it starts a forked subagent instead.

Remove
Stop

/stop

Stop the background session you are attached to, keeping its transcript and worktree.

1 note

Use /exit to detach without stopping.

Notes and sources

Claude Code
  • Some plugin authoring and evaluation commands are newer than the public reference, so each command keeps its live help evidence.
  • Plugin installs that run a marketplace-declared command need --accept-command <sha256> without a TTY.
  • Interactive commands are recorded separately from their shell equivalents.
  • 2.1.304 adds /auto-mode-setup across Bedrock, Vertex, Foundry, Claude apps gateway and telemetry-disabled sessions; help output was corrected for several flags, and plugin validate no longer predicts where mod hooks run. Existing command help observations retain their versions.
  • claude plugin can also be written claude plugins.