Harness Notes

Commands

Updated 2026-10-21

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.

TaskCodex CLIchecked at 0.162.1Claude Codechecked at 2.1.296Cursor Agentchecked at 2026.10.12-d47ca18OpenCode 2.xchecked at 2.0.28pichecked at 1.2.0
Set up
Create——

agent create-chat

Create a new empty chat and print its id.

——
Import———

opencode session import <file> [--directory <dir>]

Import session data from a JSON file or URL.

1 note

Moved from the top-level import command.

—
Use
Open the manager

codex agents

Open the agent command center for sessions on the shared local or a remote app-server.

2 notes

No --json. Takes --remote, --remote-auth-token-env, -C/--cd and --no-alt-screen; rejects --no-daemon.

Keys: Open, New, New worktree, Resume, Fork, Rename, Stop (interrupts an active thread), Archive, Hide, Delete, Pin.

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.

agent persist list

List persistent sessions.

opencode session list [-n N] [--format table|json]

List top-level sessions in the current project, newest first.

1 note

Default limit 100.

—
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.

agent persist [options] [prompt...]

Start a session that keeps running after a terminal or SSH disconnect.

——
Send a message

codex queue --thread <THREAD> --message <TEXT>

Queue a text message for an existing session by UUID or exact name.

1 note

Image attachments are not supported. --worktree is rejected.

————
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.

agent persist attach <session>

Reattach this terminal to a running persistent session.

opencode --server <url>

Connect the client to a specific server instead of the background service.

1 note

Replaces 1.x opencode attach.

—
Resume

codex resume [SESSION_ID] [PROMPT]

Resume a saved interactive session by UUID or name, with a picker by default.

2 notes

--last, --all, --include-non-interactive, --remote, --remote-auth-token-env.

--worktree parses but is rejected at run time.

—

agent ls

Open a picker of previous chats and resume one.

1 note

Shows chats from all workspaces.

agent resume

also agent --continue

Resume the most recent chat.

agent --resume [chatId]

Resume a chat by id, or open the picker.

opencode [directory] (--continue | --session <id>)

also opencode -c, opencode -s <id>

Continue the last session or a given one.

1 note

The root command has no --fork in 2.x.

pi --continue

also pi -c

Continue the most recent session for this project.

pi --resume

also pi -r

Open the session picker to choose a saved session.

1 note

The picker can search, rename, delete and sort sessions.

pi --session <path|id>

Open a session by file path, exact id or partial id.

1 note

Offers to fork a match from another project.

Fork

codex fork [SESSION_ID] [PROMPT]

Fork a saved session into a new chat, with a picker by default.

2 notes

SESSION_ID is documented as a UUID only.

--worktree works only with an explicit SESSION_ID.

——

opencode run (--continue | --session <id>) --fork

Fork the session before continuing.

1 note

Only on run and mini.

pi --fork <path|id>

Fork a saved session into a new session for this project.

Export———

opencode session export [<session>] [--sanitize]

Export session data as JSON.

1 note

Moved from the top-level export command.

pi --export <file> [output]

Export a session file to HTML.

Change
Restart—

claude respawn <id>|--all

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

———
Archive

codex archive <SESSION>

Archive a saved session by id or name.

1 note

A UUID takes precedence over a name. --worktree is rejected.

————
Unarchive

codex unarchive <SESSION>

Restore an archived session by id or name.

1 note

--worktree is rejected.

————
Remove
Stop—

claude stop <id>

also claude kill <id>

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

agent persist stop <session>

Stop a persistent session.

——
Delete

codex delete <SESSION>

Permanently delete a saved session by id or name.

1 note

Destructive. --force skips the prompt but requires a UUID; names always need confirmation.

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.

—

opencode session delete <sessionID>

Delete a session and its child sessions.

—

Inside a session

Slash commands you type into an open session.

TaskCodex CLIchecked at 0.162.1Claude Codechecked at 2.1.296Cursor Agentchecked at 2026.10.12-d47ca18OpenCode 2.xchecked at 2.0.28pichecked at 1.2.0
Set up
Import————

/import <path>

Import a JSONL session file and resume it.

Use
Open the manager

/agents

Open the agent command center from inside a session.

1 note

Requires a shared local or remote server.

————
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.

& <message>

Hand the conversation to a Cloud Agent that keeps running remotely.

1 note

A message prefix, not a slash command.

——
Detach——

/detach

Leave the persistent session running and return to the shell.

——
Resume

/resume [session]

Open the saved-session picker, or resume a session by id or name.

—

/resume

Open recent chats and resume one.

/sessions

also /resume, /continue

List sessions and switch to one.

1 note

The dialog can also delete, rename and pin sessions.

/resume

Switch to another saved session through the picker.

Fork

/fork [name]

Fork the current chat, optionally into a new managed worktree.

/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.

/fork

also /branch, /duplicate

Fork the current chat into a new session.

/fork

Fork the current session from a chosen message.

/fork

Create a new session from an earlier user message.

/clone

Duplicate the current session at its current position.

Export———

/export

Export the current session transcript.

/export [path]

Export the current session as HTML or JSONL.

Share————

/share

Upload the session as a shareable link.

1 note

Uses a Radius artifact when configured, otherwise a private GitHub gist.

Change
Archive

/archive

Archive the current session after confirmation.

1 note

Stops a running turn (0.162.0).

————
Remove
Stop—

/stop

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

1 note

Use /exit to detach without stopping.

———
Delete

/delete

Permanently delete the current session and its subagent threads after confirmation.

1 note

Destructive. Unavailable while a task runs or in a side chat.

———

/resume, then Ctrl+D

Delete a saved session from the picker.

1 note

Moves it to the trash when a trash command exists. No shell command.

Notes and sources

Codex CLI
  • The shell CLI installs and removes plugins but has no enable, disable, update or validate command; the /plugins browser can switch plugins on or off.
  • --worktree starts new sessions in a managed Git worktree and works with codex fork given an explicit session; resume, queue, archive, unarchive and delete reject it at run time.
  • MCP protocol capabilities are recorded in mcp.json; these records cover the operator commands.
  • codex-cli-0.162.1 help observation, live observation, checked 2026-10-14
  • Codex developer commands, Documentation, checked 2026-10-15
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.
Cursor Agent
  • Nested --help at this version prints the top-level help, so subcommand syntax for plugin marketplaces and in-session commands comes from the docs and changelog.
  • agent env, agent cloud and agent automations exist behind feature flags and are not recorded.
OpenCode 2.x
  • @opencode/cli 2.x runs one shared background service per user, managed with opencode service. Session sharing is not supported yet.
  • 2.1 restores archiving through client.session.update({ sessionID, archived: true|false }) and archive filtering in client.session.list. These are SDK/HTTP operations, not newly claimed shell subcommands.
  • 2.1 adds editable saved-grant action/resource patterns through client.permission.saved.update / PATCH /api/permission/saved/:id. Action is a tool/action name, not an allow/deny effect.
  • 2.1.1 fixes provider reasoning variant generation after package normalization; other command observations retain their earlier help/source versions.
pi
  • Shell MCP commands always use the built-in MCP and do not load extensions. In-session behaviour is documented, not live-probed.
  • pi-1.2.0 help observation, live observation, checked 2026-10-14
  • pi 1.2.0 documentation, Documentation, checked 2026-10-15