agent6 --help lists every command, and agent6 <command> --help its flags.
This page is the reference for the command-line surface; the patterns behind the commands are on Usage.
agent6 run streams in your terminal; --tui opens the full-screen view (terminal UI) and -i pauses for input after each automatic commit.
--tui without a terminal continues in CLI mode; -i requires a foreground terminal and cannot be combined with --tui.
-
--disable-sandbox: run commands on the host without filesystem, syscall or namespace confinement; use only on a disposable or already-isolated machine. Commands that can run commands share this opt-out:run,resume,fork,plan,ask,exec(including--new) andmachine run. Place it before the session or command inexec; it overrides recorded isolation for that command only.AGENT6_DISABLE_SANDBOX=1applies the same opt-out across verbs. -
--preset <name>: a strategy preset (no_review,review,deep_review, or your own;noneselects no preset), fixed for the execution;resume --presetswitches (presets) -
--model provider/model: the model for the mode's role, over every config layer; a resume keeps the recorded route unless it sets its own The web and TUI resume composers default to that route and offer the config's routes as choices. A resume that changes the route prints both the chosen and recorded routes. -
--parallel 3starts a parent run with three isolated attempts at the task (parallel). A list such asreviewer,provider/model-aselects a role or model per attempt. A role supplies its own effort and temperature. A model uses the worker's settings.harness.parallel.judgesranks the attempts. Under agent6-owned git the table shows which attempt, if any, the parent will try to merge into its chain. A conflict leaves the parent chain unchanged. Under model-owned git each attempt keeps its ref.sessions list --childrenexpands the attempts under the parent. -
--worktree: from the repository's top level, the run works in its own git worktree at HEAD's commit, under[git.worktree].base_dir- your checkout and its uncommitted changes stay as they are and are not carried, and neither is anything git does not track (worktrees), so you can keep working there or start more runs
sessions mergemerges the run's work into its target branch andsessions prunethen removes the worktree, as it does for a run that committed nothing and left no edits
-
--metric SPEC: measure a run, for example--metric 'minimize -- python3 elapsed.py' -
--standing "<goal>": a fallback goal the run returns to whenever its queue drains; only the operator retires it, and ceilings still end the run (harness.standing_patience) -
--pin "<text>": an instruction re-shown after every compaction -
--from <id>: seed from another session's task, outcome, diff and plan; a plan id alone runs that plan, andsessions showprintsseeded from- a plan whose open questions have blank
**A:**lines still runs, after one warning that names them;agent6 plan edit <id>answers them first
- a plan whose open questions have blank
-
--decompose: a task graph up front;--skill NAME: a skill in the prompt (a skill whose text waits on a person stalls an unattended run inask_user;agent6 skills disable NAMEkeeps it out) -
--session-id ID: name the session yourself -
agent6 prompt show [--mode run|plan|ask|read_only] [--json]: preview the system prompt, built-in tools and first message with a task placeholder; MCP tools are discovered at run start and are not included
Set sandbox.isolation = "container" to run setup, verification and the model's commands in your dev container.
agent6 finds the running Docker or Podman dev container of this workspace by its labels, without Node or the devcontainers CLI; start it in VS Code, with your own CLI, or with container.start.
container.exec names another container, container.workspace another path inside it, and container.runtime the runtime CLI (["sudo", "-n", "docker"] where docker needs sudo).
File tools, credentials and session records stay on the host; the start block shows the container, both roots, the user, HOME, who owns the container and every control the container does not enforce.
The receipt names the environment each check ran in and whether the container was left running; container.stop runs only for a container the run started, after every attached run ended.
Children, reviewers, forks and --worktree runs get their worktrees under container.worktree_base_dir (.agent6/worktrees in the project), which the container mounts; agent6 keeps that directory out of git through .git/info/exclude.
With git.worktree.kind = "linked", a fork or a --worktree run refuses when the container mounts the workspace at another path than the host's, because a linked worktree names its repository by the host path; a clone, the default, runs at any path.
agent6 exec refuses under container isolation (use the runtime's own exec).
[sandbox]
isolation = "container"
[container]
runtime = ["sudo", "-n", "docker"]Go's build cache lives under the jail's HOME, not your own.
Under full sandbox.isolation, the default sandbox.home = "auto" discards that HOME with the run, so a new run starts with a cold cache.
To reuse compiled packages across runs in this repository:
agent6 config set --repo sandbox.home cache
agent6 exec --new -- go test ./...The first build fills the private cache; later runs reuse it.
Dependencies must already be available offline, or the operator must populate the cache with a network policy that permits fetching them.
go test -count=1 ./... reruns tests while still reusing compiled packages.
Under partial or none sandbox.isolation, auto already uses the persistent HOME.
Persistence also lets a poisoned cache or tool configuration reach later runs in this repository; see the sandbox boundaries.
agent6 run executes in the foreground; Ctrl-C opens its pause menu to steer it.
For @ path completion, use the TUI or web composer.
- Tab completes the pause menu's slash commands. Up recalls past messages and Ctrl-R searches them. A steer from another surface answers the open prompt.
/detachhands the run to the background after its current turn (agent6 attachreattaches); Ctrl-Z prints the run's state and never suspends it/exitleaves the run resumable;/stop, or Ctrl-C at the pause prompt, stops it now, asagent6 stop IDdoesrun -iprompts after every commit. Enter continues the run. A/parallelline previews first. Repeat it to send.- hub-started runs run detached;
agent6 attachfollows them (conversation by default;--tui,--raw)
agent6 attach [<id>] follows a run's conversation, or a machine's state, live.
It rings the bell and sends a desktop notification (notify-send, when present) as the run starts waiting on an answer and as it ends; run does the same in the foreground.
Ids are exact or an unambiguous prefix and default to the most recent run.
With review.merge_repeats = true, the findings list shows one row per group with the number of reviewers who reported it.
The session transcript keeps the other reports under "Also reported" for that panel.
Grouping changes neither a finding's status nor the blocking decision.
A prefix selects the single matching session whose full id prefixes every other match, provided the others have its mode or are its reviewers (for example, a parallel parent and its children). Children remain reachable by their own ids.
agent6 attach # follow live; --raw tails events, --tui full screen, --json one snapshot
agent6 steer ID "focus on X" # queue an instruction; --now interrupts the call in flight
agent6 answer ID "yes" # answer a pending question or approval (bare: list them; --question QID picks a question set)
agent6 stop ID # stop during the current turn (the worker killed if it does not answer); --all
agent6 stop ID --after-turn # finish the current turn, then stop
agent6 ps # live sessions of every repository on the machine; --children, --jsonagent6 sessions show # status, turn, elapsed, usage, the gate's word, where the changes are; --json
agent6 sessions diff # the git diff the run produced; --stat, --path P
agent6 sessions commits # the run's per-turn commits
agent6 sessions merge # merge into the run's starting branch (warns first when the gate did not certify it); --method, --into BRANCH
agent6 resume ID --merge main # merge main into the run's work first; a conflict's markers are the run's first task
agent6 sessions transcript # the conversation as text; --no-thinking, --seq N, --tools calls|none
agent6 sessions graph # the task graph, each line led by the id /retire takes
agent6 sessions compare <ids> # >=2 runs ranked by harness.parallel.judges (the reviewer model by default; the mechanical order when no judge returns a ranking), or a group's saved verdict; --rejudge
agent6 sessions dir [<id>] # the repo's run history, or that session's directory
agent6 history search <text> # grep this repository's sessions' persisted data; --regexhistory search searches the conversations, not the system prompt, the skill index or the tool declarations.
It keeps the matches it read if a file disappears or another search error occurs, prints search incomplete: some files were not read. and the error, and exits with code 2.
It does not report no matches when the search is incomplete.
sessions show --json, sessions list --json and attach --json return the operator's full words in task, the latest resume steer in continued_task and their headlines in task_line; Formats lists every field and the clipping rules.
An unsteered resume clears continued_task.
In attach --json, last_model_call.actor identifies the caller of the latest model call.
agent6 sessions prune # delete merged agent6/* branches and worktrees, report the rest
agent6 sessions prune --history --older-than 30 # delete stored transcripts, checkpoints and objects of sessions ended more than 30 days ago
agent6 sessions remove [<id>] # delete one run's history; asks [y/N] on a controlling terminal, otherwise requires an id or --yes; --yes skips the question, --asks clears saved askssessions prune removes merged worktrees, including squash and task merges (tasks is the default), but keeps worktrees holding work no commit has.
A run you merged by hand (a squash, a cherry-pick, a rebase) has no merge record: prune records it as merged when its base branch already holds its content, and says so (<ref>: main already has its content; recorded as merged into main).
When that base branch is gone, prune checks the checked-out branch.
A later change to the same lines on the base can hide that match: such a run stays unmerged until you delete its ref.
Only deletion of their unreachable branches and chain refs needs --delete-squashed.
sessions prune --history --older-than DAYS removes transcripts/, checkpoints/ and objects/ together from finished sessions whose last execution ended more than DAYS ago, prints each session's id and file counts, and leaves a pruned.json receipt; the manifest, logs, receipt, recovery state and graph store stay.
Nothing is deleted automatically, and there is no retention setting.
The Formats reference describes the object store and the receipt.
At launch, a note names the state directory when its filesystem has less than 10% free; low space never refuses a session.
agent6 exec ID -- <command> # a command inside the run's jail and network, on your terminal or pipe
agent6 exec --new [<command>] # a command, or your shell, in a fresh sandbox built from the config; no run needed
agent6 forward ID 8000 # reach a port inside the run's network; --local-port Nagent6 exec runs your own command on your own stdio.
- with stdin and stdout on a terminal the command gets a terminal of its own, with job control; otherwise stdin, stdout and stderr pass through, so pipes and redirects work
- Ctrl-Z stops a job of the shell you opened; a command you run directly keeps running
- a command a signal ended reports 128 plus the signal, at every
sandbox.isolationlevel agent6 exec ID -- COMMAND...works in the run's workspace: a file your command writes there is in the run's tree, and the run's next commit holds it
agent6 has no scheduler: cron or a systemd user timer starts it, with no terminal and no login shell. Three things differ from your shell:
- PATH is not your shell's: name agent6 by the full path
command -v agent6prints. A run's own commands get the sandbox's PATH either way. - The working directory is your home directory, and agent6 works on the repository it starts in:
WorkingDirectory=in the unit,cdin the crontab line. - Credentials: a key your shell profile exports is missing.
Save it with
agent6 connect(~/.config/agent6/secrets.tomlis read as from a shell), or name a file ofNAME=valuelines withEnvironmentFile=in the unit.
agent6 machine run <file> --exit-on-wait runs the machine to its next wait, prints the wake time and exits 0.
A later start before that time exits 0 at once, and a start after it resumes the machine.
~/.config/systemd/user/agent6-triage.service:
[Service]
Type=oneshot
WorkingDirectory=/home/you/project
ExecStart=/home/you/.local/bin/agent6 machine run triage.asm.toml --exit-on-wait~/.config/systemd/user/agent6-triage.timer:
[Timer]
OnCalendar=hourly
[Install]
WantedBy=timers.targetsystemctl --user enable --now agent6-triage.timer # start the timer and keep it enabled
systemctl --user list-timers # the next and the last start
journalctl --user -u agent6-triage.service # each start's output, and a failed start's exit codeA user timer fires while you are logged out only when loginctl show-user "$USER" --property=Linger reads Linger=yes.
The same start as a crontab line, which keeps the output in a file:
0 * * * * cd /home/you/project && /home/you/.local/bin/agent6 machine run triage.asm.toml --exit-on-wait >> /home/you/agent6-triage.log 2>&1
- A start while another still runs the machine exits 1 (
machine <id> is already running) and names the command that stops it. - A machine that reached a terminal state refuses a later start with exit 2.
--restartarchives any stopped instance and starts from the initial state. Leave it out of a timer that should continue a waiting machine.- A
mode = "run"agent state runs commands only with--auto-approveon the line orsandbox.run_commands = "allow"(agent states). agent6 machine status triage, from the repository, shows the state, the spend and the next wake.
A scheduled run has nobody to answer it, so its line decides three things:
AGENT6_DETACHED_AWAY=denyanswers for the absent operator: an approval is refused and a waiting question returns unanswered, so the run never waits (approvals). With no away mode, a run undersandbox.run_commands = "ask"refuses to start (exit 2).--auto-approve, oragent6 config set --repo sandbox.run_commands allow, lets the run start commands in the sandbox. Without either, a run under thedenyaway mode has no command tools and no verify gate.--worktreegives each start its own worktree and leaves the checkout as it is. Without it, a start refuses (exit 2) while the last run's unmerged edits to tracked files are in the checkout.
The unit and its timer differ from the machine's in three lines, here for a start every day at 03:00:
[Service]
Environment=AGENT6_DETACHED_AWAY=deny
ExecStart=/home/you/.local/bin/agent6 run --worktree --auto-approve "your task here"
[Timer]
OnCalendar=*-*-* 03:00:00The crontab line:
0 3 * * * cd /home/you/project && AGENT6_DETACHED_AWAY=deny /home/you/.local/bin/agent6 run --worktree --auto-approve "your task here" >> /home/you/agent6-run.log 2>&1
The output names the session (session id: <id>) and, when the run committed changes, the command that merges them.
The journal shows a failed start's exit code as status=2/INVALIDARGUMENT: the number is agent6's (exit codes), the name systemd's.
From the repository, agent6 sessions list shows each start's session and how it ended, newest first, and agent6 sessions show the latest.
Development briefs follow the unattended-chain rule.
AGENT6_DETACHED_AWAY=approve grants every standing scope; a fetch outside sandbox.fetch_approved_hosts still waits for an answer.
A headless run still waits on ask_user(wait=true) unless away mode is deny.
An external chain driver polls agent6 attach ID --json, as well as watching child exit.
Its parked-question stop condition is live == true and a member of questions with answered == false and blocking == true.
The driver reports the session ID and question id, stops scheduling subsequent work, and retains the session for an operator to answer with agent6 answer ID --question QID TEXT or stop with agent6 stop ID.
It must not fabricate an answer or automatically resume the chain.
Queued questions (wait=false), answered questions and questions from earlier executions do not meet this condition.
operator_blocked alone is insufficient: approvals can also block a run.
This is a contract for external chain drivers, not a change to interactive group waits; no such external development-chain driver is included in this repository.
Exit codes for agent6 run, ask and resume, for scripts to branch on:
| Code | Meaning |
|---|---|
0 |
finished with a green gate, no gate, or an unverified final tree with harness.verify.when = "never" |
1 |
ended unfinished: out of turns, stuck, a provider error, a crash |
2 |
operator error (bad flag or config, a refusal before anything ran) |
3 |
budget exhausted, including a run --parallel run whose budget ended every child |
4 |
finished over a red or timed-out verify gate, or a never-run gate under harness.verify.when = "finish" or "turn" |
5 |
finished, but the run made no commit and left uncommitted edits (a run that changed nothing, or one with [git].commit_per_turn = false, stays 0) |
130 |
interrupted, or stopped by the operator: Ctrl-C, SIGTERM to a run, ask or plan (timeout, CI, the kill agent6 stop falls back to), agent6 stop, abort or exit at the pause menu, stop after a commit |
141 |
the output pipe closed (agent6 ... | head) |
passed means the model called finish_session and the gate was green; it does not certify the task.
Exit 0 also covers harness-declared and gateless ends, including a run that changed nothing.
git.auto_merge can merge a completed finish_session or children_ranked run into the checkout when the run passed its own gate or had no gate.
A child's gate pass is evidence about the tree, not permission to merge it into the checkout.
The status label prints a stop code such as max_turns as "max turns" and keeps names, paths and other detail as written.
Every end has one reason (stop_reason in agent6 sessions show --json and sessions list --json), and each reason one row:
| End reason | Headline | Exit code |
|---|---|---|
finish_session |
passed, finished, finished · gate red, finished · gate timed out, finished · unverified |
0 (gate green, no gate, unverified with the harness gate off), 4 (gate red, gate timed out, unverified under a harness gate) |
finish_planning |
planned |
0 |
answered |
answered |
0 |
silent_finish |
finished · no finish call, finished · gate red, finished · gate timed out, finished · unverified |
0 (gate green, no gate, unverified with the harness gate off), 4 (gate red, gate timed out, unverified under a harness gate) |
went_quiet |
failed · went quiet |
1 |
budget_exhausted |
failed · budget exhausted |
3 |
provider_error |
failed · provider error |
1 |
metric_plateau |
finished · metric plateau, finished · gate red, finished · gate timed out, finished · unverified |
0 (gate green, no gate, unverified with the harness gate off), 4 (gate red, gate timed out, unverified under a harness gate) |
verify_settled |
finished · settled |
0 |
settled |
finished · gate red, finished · gate timed out, finished · unverified |
4 (gate red, gate timed out, unverified under a harness gate), 0 (unverified with the harness gate off, no gate) |
no_progress |
failed · no progress |
1 |
tool_error_stuck |
failed · tool error stuck |
1 |
verify_command_unexecutable |
failed · verify command unexecutable |
1 |
setup_command_failed |
failed · setup command failed |
1 |
sandbox_unavailable |
failed · sandbox unavailable |
2 |
loop_guard_killed |
failed · loop guard killed |
1 |
interactive_stop |
stopped |
130 |
interrupted |
stopped |
130, 141 (closed output pipe) |
crashed |
failed · crashed |
1 |
steer_abort |
stopped |
130 |
steer_exit |
stopped |
130 |
undone |
undone |
0 |
detached |
none: no end is recorded | 0 |
plan_unreadable |
failed · plan unreadable |
1 |
max_turns |
failed · max turns |
1 |
ask_repl_empty |
none: no end is recorded | 0 |
gate_stale |
finished · gate stale |
4 (gate red, gate timed out, unverified under a harness gate), 0 (unverified with the harness gate off) |
gate_red_at_base |
finished · gate red at base |
4 |
children_ranked |
finished · children ranked, finished · gate red, finished · gate timed out, finished · unverified |
0 (gate green, no gate, unverified with the harness gate off), 4 (gate red, gate timed out, unverified under a harness gate) |
no_child_result |
failed · no child result |
1 |
no_child_passed |
failed · no child passed |
4 |
finish_sessionreadspassedover a green gate and a barefinishedwith no gatesilent_finishmeans the model stopped calling tools without callingfinish_session, and the harness took its last answer as the endmetric_plateaumeans the configured metric stopped improving and the harness ended the run- a completed run that made no commit and left uncommitted edits exits
5in place of0(automatic commits undergit.control = "agent6")finish_sessionreadspassed · not committedover a green gate andfinished · not committedwith no gatesilent_finish,metric_plateau,verify_settledandsettledalso add· not committedto their status
verify_settledandsettledare the harness's own stop for a run whose turns stopped changing the tree: the worker called nofinish_session, andagent6 resume IDcontinues itharness.settled_stop_aftersets the idle-turn limit (default 12);-1disables the stop but keeps the nudge
agent6 telemetry export reads this repository's session and machine journals and delivers what [telemetry] selects: spans for each execution, turn, model call, tool call, verification, review panel, operator wait and completed machine state; cumulative metrics (tokens, cost, plan points, tool calls, verification outcomes and durations, findings, approvals, waits); and log records for the significant events.
Each execution records the settings that differ from their defaults.
sessions show and sessions receipt name their sources and files.
The telemetry log signal carries only the settings allowed for export.
A resume reads its config files again. It never applies settings from this record.
Machine worker executions are children of their state spans, and machine waits produce log records.
Model-call and tool spans follow OpenTelemetry's GenAI conventions (semantic conventions 1.45.0, status Development): they are named chat {model} and execute_tool {tool} and carry gen_ai.* attributes.
gen_ai.usage.input_tokens includes the cached tokens, as the convention defines it.
Nothing is exported until a signal is selected; a run never exports its own events.
[telemetry]
traces = "otlp" # spans to the endpoint
metrics = "prometheus" # or "otlp"; the textfile below for node_exporter
logs = "otlp" # the significant events as log records
endpoint = "https://collector.example:4318"
headers = ["Authorization"] # values in secrets.toml under [telemetry.headers]
prometheus_file = "/var/lib/node_exporter/textfile/agent6.prom"agent6 config set --secret telemetry.headers.Authorization 'Bearer <token>'
agent6 telemetry export # every session with a journal, once
agent6 telemetry export <id> --follow # one session, as its journal grows
agent6 config show telemetry # every key with its origin- With
web.metrics_route = true(default:false),agent6 webserves fresh hub-session metrics at/metricsonly withAuthorization: Bearer <web-secret>(Prometheusauthorization.credentials), never a cookie or browser sign-in token. - A session's meter keeps 64 distinct values per free label (model, provider, tool) and reads
otherpast them; an export that merges sessions carries each session's values, so the merged set can exceed 64. - A cursor per endpoint and session keeps a re-run from re-sending delivered spans and log records; the metrics reading is always the whole cumulative snapshot, and the Prometheus file is rewritten whole.
- A model-call span identifies the caller with the
agent6.actorattribute. Metadata capture identifies a reviewer by role and, for a panel call, by index. Content capture exports up to 1,024 characters of the reviewer's actor, including the focus. - The default
capture = "metadata"exports outcomes, counts, timings and the journal's ids, never the task, arguments, outputs or diffs;capture = "content"adds the capped excerptstelemetry.capturelists (config). --followposts what it holds every five seconds while events arrive and once more on Ctrl-C; a live run's unfinished work is sent when the run finishes it, not at the export's end. A crashed run's unfinished work is sent once, marked incomplete.- A request the collector answers with 429, 502, 503 or 504 is tried three times with backoff; any other refusal turns the endpoint off for that export, and the command exits 1 naming it.
agent6_cost_usd_totalsums the reported or estimated cost of each session's own calls. A child contributes its calls through its own journal. Account credit declines affect the USD cap but do not count as call costs. A record with only a mixed USD total contributes no cost to this metric.agent6_plan_observed_points_totalcounts the plan-window movement a run observed, which is the account's whole window; it is not this run's billing. Sessions that ran at the same time, a parent and its children among them, each count the movement they saw.agent6_plan_used_ratiocarries aproviderlabel: each provider's latest reading is its own series.
agent6 check [section] # sandbox (isolation, boundaries, probes), config (provider keys), MCP, verify
agent6 init [--yes] [--ecosystem E] # the setup wizard: per-repo config, verify command, .gitignore, AGENTS.md
agent6 memory add|list|show|remove # the index renders each fact's first non-empty line
agent6 memory list --json # prints a JSON array with name, first_line, written_by, written_at, edited_by, edited_at, reads and last_read_by (unknown provenance is null).
agent6 memory show NAME --json # prints that fact's object from memory list --json.
agent6 memory decisions # the operator rulings the harness recorded
agent6 skills install|update|list # skills from a repo, a directory or a SKILL.md URL
agent6 skills enable NAME [--always] # a skill the model may use, or one it always gets; disable, remove
agent6 mcp add NAME [--url URL | -- COMMAND...] # an MCP server; --pass-env VAR passes an environment variable to a local server; list, remove, serve
agent6 machine ... # state machines over runs (see state-machines.md)
agent6 pack [--repo-config] # copy this checkout's agent6 state into .agent6/ (see usage.md)
agent6 unpack [--yes] # list what a pack would install, ask, then import it
agent6 system apparmor install # the AppArmor profile that full sandbox.isolation needs on some hosts; status, remove
agent6 completions [bash|zsh|fish|xonsh] [--print]
agent6 config fill [--force] # write the defaults + global layers as one explicit global configagent6 init detects Go (go.mod), Node, Python and Rust manifests for its AGENTS.md advice and build-artifact ignores.
--ecosystem go|node|py|rust overrides that choice, not verify inference.
See repo memory for the distinction between facts and rules.