CLI
Global flags
Accepted before the subcommand on every command below.
| Flag | Required | Help | Default | Values |
|---|---|---|---|---|
--verbose, -v | no | Enable verbose debug logging | false | - |
--db-path | no | Custom path for the local SQLite index database | - | - |
--no-json | no | Force text output even if persisted config defaults to JSON (see `archie config`) | false | - |
--no-color | no | Disable colour. NO_COLOR in the environment does the same thing | false | - |
--plain | no | No colour and ASCII-only glyphs, at identical column positions | false | - |
archie scan
Scan and index agent histories from the local system
| Flag | Required | Help | Default | Values |
|---|---|---|---|---|
PATHS | no | Optional session paths or directories to scan; omit to also refresh global human-turn history | - | - |
--force, -f | no | Force rescanning and re-indexing of unchanged source files | false | - |
--include-stubs | no | Keep storing/pruning near-empty stub sessions instead of filtering them out | false | - |
--json | no | Output scan results as formatted JSON | false | - |
archie stats
Machine-wide summary statistics. `stats usage` rolls spend up by period; `stats outcomes` reports the verified-outcome rate
| Flag | Required | Help | Default | Values |
|---|---|---|---|---|
--json | no | Output summary statistics as formatted JSON | false | - |
archie stats usage
Deep usage, pacing, and token expenditure rollups
| Flag | Required | Help | Default | Values |
|---|---|---|---|---|
--period, -p | no | Rollup period: day, week, month, year, or all -- `all` is one row per group across all time, with no period column. Single-letter aliases d/w/m/y also work. Default day, or persisted `config period` | - | - |
--pacing | no | Show the rolling pacing window instead of the rollup. `archie window show` is the spelling that survives; this flag is kept for scripts written against `usage` | false | - |
--hours | no | Pacing window duration in hours | 5 | - |
--alert-above | no | Alert and highlight if window spend exceeds this threshold in USD | - | - |
--limit, -l | no | Maximum number of periods to keep (default 30 for day, 26 for week, 24 for month, unbounded for year) -- or, under `--period all`, the number of top groups by spend to keep (default 20, or persisted `config limit`). Counts periods, not rows: a day with two adapters is one period, not two | - | - |
--by | no | Group the rollup by adapter (default; most informative when nearly every session shares one adapter, e.g. Claude Code), model (usually the useful one), or repo | adapter | adapter, model, repo |
--since | no | Only include sessions started at or after this time: an absolute date (`2026-08-01` or RFC 3339), or a relative shorthand (`1d`, `7d`, `2w`, `3m`) | - | - |
--json | no | Output usage data as JSON | false | - |
archie stats outcomes
Verified-outcome rate by model, adapter, or repo: of the sessions that claimed done, what share left evidence a test, build, commit or CI run can be pointed at
| Flag | Required | Help | Default | Values |
|---|---|---|---|---|
--by | no | Group the rate by model (default), adapter, or repo | model | model, adapter, repo |
--min-n | no | Suppress groups with fewer than this many sessions (default 20) | - | - |
--since | no | Only sessions started at or after this time: an absolute date (`2026-08-01` or RFC 3339), or a relative shorthand (`1d`, `7d`, `2w`, `3m`) | - | - |
--until | no | Only sessions started before this time, same formats as `--since` | - | - |
--include-stubs | no | Include 1-event session stubs in the population | false | - |
--json | no | Output as formatted JSON | false | - |
archie stats ladder
The evidence ladder, what a verified outcome costs, and the newest sessions that left evidence -- one screen, ending on the share of spend that sits below the evidence line
| Flag | Required | Help | Default | Values |
|---|---|---|---|---|
--period, -p | no | How far back the window reaches: day, week, month, year, or all. Single-letter aliases d/w/m/y also work. Default month (30 days), or persisted `config period`. Note this is a lookback, where `stats usage --period` is a rollup granularity | - | - |
--by | no | Group the cost-per-verified-outcome table by model (default), repo, adapter, or effort. Only Codex records an effort today, so `--by effort` counts what it can and names what it cannot | model | model, repo, adapter, effort |
--repo | no | Filter by repository or workspace substring (e.g. unfoundbox/agentworth) | - | - |
--adapter, -a | no | Filter by adapter name (e.g. claude_code, codex, gemini, opencode) | - | - |
--model, -m | no | Filter by model substring (e.g. sonnet, gpt-4o, gemini-2.5) | - | - |
--min-n | no | Blank a group's rate and cost below this many claimed sessions (default 20, the same floor `stats outcomes` applies) | - | - |
--include-stubs | no | Include 1-event session stubs in the population | false | - |
--json | no | Output all three blocks as formatted JSON | false | - |
archie session
Everything that acts on sessions: list them, read one, hand one over
archie session list
List indexed sessions with optional filtering
| Flag | Required | Help | Default | Values |
|---|---|---|---|---|
--limit, -l | no | Maximum number of sessions to display (default 20, or persisted `config limit`) | - | - |
--adapter, -a | no | Filter by adapter name (e.g. claude_code, codex, gemini, opencode) | - | - |
--model, -m | no | Filter by model substring (e.g. sonnet, gpt-4o, gemini-2.5) | - | - |
--all-stubs | no | Include 1-event session stubs in the listing | false | - |
--kind | no | Which kind of row to list: `conversation` (the default) or `fleet_snapshot` (a multi-agent workspace as of one moment, e.g. Herdr). `--adapter` on a snapshot adapter implies it | - | conversation, fleet_snapshot |
--unproven | no | Only sessions whose completion claims were never independently corroborated by tests or CI -- the blind spots | false | - |
--json | no | Output as formatted JSON | false | - |
archie session show
Read one session in detail, with its timeline
| Flag | Required | Help | Default | Values |
|---|---|---|---|---|
SESSION_ID | no | The session to read, by full ID or a unique prefix. With nothing given on a TTY, a picker lists the newest sessions; elsewhere, pass an ID or `--last` | - | - |
--last | no | The newest session for this directory's repository. The default when no ID is given and stdout is not a TTY | false | - |
--current | no | Alias of `--last` | false | - |
--json | no | Output raw trace structure as formatted JSON | false | - |
archie session export
Export one session safely, in JSON or ATIF format
| Flag | Required | Help | Default | Values |
|---|---|---|---|---|
SESSION_ID | no | The session to export, by full ID or a unique prefix. With nothing given on a TTY, a picker lists the newest sessions; elsewhere, pass an ID or `--last` | - | - |
--last | no | Export the newest session for this directory's repository. The default when no ID is given and stdout is not a TTY | false | - |
--current | no | Alias of `--last` | false | - |
--redact, -r | no | Apply redaction to mask secrets, API keys, tokens, emails, and home paths | false | - |
--format, -f | no | Export format: json (default), atif, receipt, or svg | json | json, atif, receipt, terminal, ansi, svg |
--output, -o | no | Optional file path to write export output to (defaults to stdout) | - | - |
archie session receipt
Render one session's Flight Receipt, as ANSI or SVG
| Flag | Required | Help | Default | Values |
|---|---|---|---|---|
SESSION_ID | no | The session to render a flight receipt for, by full ID or a unique prefix. With nothing given on a TTY, a picker lists the newest sessions; elsewhere, pass an ID or `--last` | - | - |
--last | no | Render the newest session for this directory's repository. The default when no ID is given and stdout is not a TTY | false | - |
--current | no | Alias of `--last` | false | - |
--format, -f | no | Output format: terminal (default), ansi, svg, receipt, or json | terminal | terminal, ansi, svg, receipt, json |
--output, -o | no | Optional file path to write receipt or SVG output to (defaults to stdout) | - | - |
archie session handoff
Hand a session over: what it promised and dropped, decided, changed, ran, and proved
| Flag | Required | Help | Default | Values |
|---|---|---|---|---|
SESSION_ID | no | Session to hand over, by full ID or a unique prefix. With nothing given on a TTY, a picker lists the newest sessions; elsewhere, pass an ID or `--last` | - | - |
--last | no | Hand over the newest session for this repository. The default when no ID is given and stdout is not a TTY | false | - |
--current | no | Alias of `--last` | false | - |
--redact, -r | no | Mask secrets, paths, and this session's own repository name before printing | false | - |
--markdown | no | Emit the same markdown the `session_handoff` MCP tool returns | false | - |
--max-lines | no | Line budget for `--markdown` (default 60, ceiling 120) | - | - |
--json | no | Output the structured handoff as JSON | false | - |
archie session wake
What you were doing: the checkout, the newest session's task, proof, loose ends, and the next step, in 30 lines
| Flag | Required | Help | Default | Values |
|---|---|---|---|---|
--workspace | no | Directory to read the checkout from and to derive the repo from. Defaults to the current directory | - | - |
--repo | no | Repository/workspace key, as `session handoff`'s receipt reports it. Defaults to the key derived from `--workspace` | - | - |
--redact, -r | no | Mask secrets, paths, and this session's own repository name before printing | false | - |
--json | no | Output the wake report as JSON | false | - |
--inject | no | Read an Antigravity CLI `PreInvocation` hook payload on stdin and print the `injectSteps` wake envelope on stdout (docs/specs/wake.md, "Automation"). Only `antigravity` today: Claude Code and Codex inject through their own hook commands | - | antigravity |
archie session forgotten
What compaction dropped: decisions this session made and its own summaries did not keep
| Flag | Required | Help | Default | Values |
|---|---|---|---|---|
SESSION_ID | no | Session to diff, by full ID or a unique prefix. With nothing given on a TTY, a picker lists the newest sessions; elsewhere, defaults to the newest session indexed for this directory's repository (same as `--last`) | - | - |
--last | no | Diff the newest session for this directory's repository. The default when no ID is given and stdout is not a TTY | false | - |
--current | no | Alias of `--last` | false | - |
--round | no | One 1-based compaction round. Defaults to every round | - | - |
--class | no | Any of decision, rejected, reason. Repeatable. Defaults to all three | - | - |
--limit | no | How many statements to return, newest first (default 20, ceiling 200) | - | - |
--redact, -r | no | Mask secrets, paths, and this session's own repository name before printing | false | - |
--json | no | Output the structured diff as JSON | false | - |
archie session loose-ends
The handoff's loose-ends section alone: what a session said it would do and did not
| Flag | Required | Help | Default | Values |
|---|---|---|---|---|
SESSION_ID | no | Session to check, by full ID or a unique prefix. With nothing given on a TTY, a picker lists the newest sessions; elsewhere, pass an ID or `--last` | - | - |
--last | no | Check the newest session for this repository. The default when no ID is given and stdout is not a TTY | false | - |
--current | no | Alias of `--last` | false | - |
--redact, -r | no | Mask secrets, paths, and this session's own repository name before printing | false | - |
--prompt | no | Print the copyable prompt to hand to an agent that has the repository open | false | - |
--json | no | Output the loose ends as JSON | false | - |
archie session asks
The questions you asked and where their answers are -- built so you never have to re-scroll or re-ask because the answer landed several messages later
| Flag | Required | Help | Default | Values |
|---|---|---|---|---|
SESSION_ID | no | Session to index, by full ID, a unique prefix, or a raw JSONL file path (parsed directly if it isn't an indexed session). With nothing given on a TTY, a picker lists the newest sessions; elsewhere, pass an ID or `--last` | - | - |
--session | no | The same session, named with a flag. Kept because `archie session asks --session <id>` is the spelling that shipped in #97 | - | - |
--last | no | Resolve the newest session for this directory's repository, falling back to the newest session anywhere | false | - |
--current | no | Alias of `--last` | false | - |
--since | no | Only questions asked at or after this time: RFC 3339, `YYYY-MM-DD`, or a relative duration like `2h`, `30m`, `1d`, `3w` | - | - |
--unanswered | no | Only questions that are not `answered` -- still open, or flagged back to you | false | - |
--json | no | Output the structured index as JSON | false | - |
archie session cache
Diagnose turn-by-turn prompt caching dynamics and identify cache drop root causes
| Flag | Required | Help | Default | Values |
|---|---|---|---|---|
SESSION_ID | no | The session to act on, by full ID or a unique prefix. With nothing given on a TTY, a picker lists the newest sessions; elsewhere, pass an ID or `--last` | - | - |
--last | no | The newest session for this directory's repository. The default when no ID is given and stdout is not a TTY | false | - |
--current | no | Alias of `--last` | false | - |
--json | no | Output findings as formatted JSON | false | - |
archie session bisect
Pinpoint the exact turning point where a session's trajectory turned negative
| Flag | Required | Help | Default | Values |
|---|---|---|---|---|
SESSION_ID | no | The session to act on, by full ID or a unique prefix. With nothing given on a TTY, a picker lists the newest sessions; elsewhere, pass an ID or `--last` | - | - |
--last | no | The newest session for this directory's repository. The default when no ID is given and stdout is not a TTY | false | - |
--current | no | Alias of `--last` | false | - |
--json | no | Output findings as formatted JSON | false | - |
archie session search
Semantic vector search across indexed trajectory turns with ASCII thermal receipts
| Flag | Required | Help | Default | Values |
|---|---|---|---|---|
QUERY | yes | Search query (natural language or code snippet) | - | - |
--limit, -l | no | Maximum number of results to return (default 10, or persisted `config limit`) | - | - |
--min-score | no | Minimum similarity score threshold (0.0 to 1.0) | 0 | - |
--kind, -k | no | Filter by chunk kind (summary, error_recovery, tool_invocation, apology_panic, code_lineage, user_turn) | - | - |
--json | no | Output results as JSON | false | - |
archie session recall
Semantically recall past solutions joined with outcome validation and cost
| Flag | Required | Help | Default | Values |
|---|---|---|---|---|
QUERY | yes | Search query to match against previous trajectories | - | - |
--limit, -l | no | Maximum number of results to return (default 5, or persisted `config limit`) | - | - |
--min-score | no | Minimum similarity score threshold (0.0 to 1.0) | 0 | - |
--json | no | Output results as JSON | false | - |
archie session audit
Safety and threat audit detecting forbidden commands, leaked variables, sweeps, and fake claims, machine-wide over every session
| Flag | Required | Help | Default | Values |
|---|---|---|---|---|
--safety | no | Restrict audit to safety and threat vectors only | false | - |
--json | no | Output audit results as formatted JSON | false | - |
archie session blunder
Discover top agent blunders, render thermal receipts, and export to the Hall of Blunders
| Flag | Required | Help | Default | Values |
|---|---|---|---|---|
--top, -t | no | Number of top blunder exhibits to retrieve and display (default: 5) | 5 | - |
--submit, -s | no | Submit redacted blunder receipts to the public Hall of Blunders at stfuopus.lol | false | - |
--dry-run | no | Print the exact redacted payload a submission would POST, and send nothing. Read this before you ever pass --submit | false | - |
--json | no | Output blunder exhibits as formatted JSON | false | - |
archie session autopsy
Surface recurring human correction and steering phrases across all sessions
| Flag | Required | Help | Default | Values |
|---|---|---|---|---|
--min-occurrences, -m | no | Minimum number of occurrences across sessions to report (default: 2) | 2 | - |
--json | no | Output results as JSON | false | - |
archie session watch
Watch active session transcripts and detect doom loops or file edit thrashing
| Flag | Required | Help | Default | Values |
|---|---|---|---|---|
--interval-secs, -i | no | Polling interval in seconds (default: 3) | 3 | - |
--poll-once | no | Run a single poll check and exit immediately | false | - |
--json | no | Output findings as formatted JSON | false | - |
--paths, -p | no | Custom path directories to monitor | - | - |
archie session risk
Rank indexed sessions by real secret/credential exposure risk, by category and severity
| Flag | Required | Help | Default | Values |
|---|---|---|---|---|
--limit, -l | no | Maximum number of sessions to show in the report (default 20, or persisted `config limit`) -- every indexed session is still scanned; this only trims the displayed list | - | - |
--min-severity | no | Only include sessions whose worst finding is at least this severity | low | low, medium, high, critical |
--json | no | Output results as JSON | false | - |
archie session drift
What moved under this session since it read it, and which session moved it
| Flag | Required | Help | Default | Values |
|---|---|---|---|---|
SESSION_ID | no | The session, by full id or a unique prefix. Defaults to the most recently active one | - | - |
--last | no | The most recently active session, which is also the default | false | - |
--json | no | Output as formatted JSON | false | - |
archie session anchors
The join keys this session's tool results carried -- a SpacePilot run_id, a receipt hash -- and the other sessions that carried them
| Flag | Required | Help | Default | Values |
|---|---|---|---|---|
SESSION_ID | no | The session, by full id or a unique prefix. Defaults to the most recently active one | - | - |
--last | no | The most recently active session, which is also the default | false | - |
--json | no | Output as formatted JSON | false | - |
archie session burn
What this session has spent so far, from its own transcript: tokens, dollars at the table price, turns, cache read share, and the rate over the last ten minutes
| Flag | Required | Help | Default | Values |
|---|---|---|---|---|
SESSION_ID | no | The session, by full id or a unique prefix. Defaults to the most recently active one | - | - |
--last | no | The most recently active session, which is also the default | false | - |
--json | no | Output as formatted JSON | false | - |
archie agent
The agent adapters: what each one extracts, and how one is doing on this machine
archie agent list
Extraction capabilities and coverage across every registered adapter
| Flag | Required | Help | Default | Values |
|---|---|---|---|---|
--json | no | Output the coverage matrix as formatted JSON | false | - |
archie agent show
One adapter in detail: what it extracts, whether it is present here, and what it has actually put in the index
| Flag | Required | Help | Default | Values |
|---|---|---|---|---|
ADAPTER | yes | Adapter name (e.g. claude_code, codex, gemini, opencode) | - | - |
--json | no | Output as formatted JSON | false | - |
archie agent status
Where every agent on this machine is right now, one line each, from the loop's own hook events rather than from a scan
| Flag | Required | Help | Default | Values |
|---|---|---|---|---|
--json | no | Output as formatted JSON | false | - |
archie repo
Repositories: what an agent wrote where, and which commits nothing proved
archie repo list
The repositories and workspaces this index holds, by session count
| Flag | Required | Help | Default | Values |
|---|---|---|---|---|
--limit, -l | no | Maximum number of repositories to display (default 20, or persisted `config limit`) | - | - |
--json | no | Output as formatted JSON | false | - |
archie repo blame
Trace file modifications back to the session, model, and prompt that authored them
| Flag | Required | Help | Default | Values |
|---|---|---|---|---|
FILE_PATH | yes | Target file path or pattern to search | - | - |
--json | no | Output results as JSON | false | - |
archie repo pr-blame
Annotate changed PR files with AI agent authoring provenance and outcome validation
| Flag | Required | Help | Default | Values |
|---|---|---|---|---|
FILES | no | List of files to check (if omitted, infers from git diff) | - | - |
--json | no | Output results as JSON | false | - |
archie repo suspect
List commits on this branch whose authoring session never proved anything, so you know where to look twice before pushing. Prints a list and a prompt, never a patch
| Flag | Required | Help | Default | Values |
|---|---|---|---|---|
--repo | no | Path to a git checkout. Defaults to the current directory | - | - |
--since | no | A date (RFC 3339 or YYYY-MM-DD) or a git ref to measure from. Defaults to the branch's upstream, then origin/main | - | - |
--branch | no | Branch to walk. Defaults to HEAD | - | - |
--base | no | Ref to diff against, if you want to name it separately from --since | - | - |
--window-hours | no | How long before a commit a session's file touch still counts as authoring it | - | - |
--hook | no | Print a ready-to-install pre-push hook and exit. The hook never blocks a push | false | - |
--quiet | no | Print only the copyable prompt, and only when something is suspect. What the hook runs | false | - |
--json | no | Output the full report as JSON | false | - |
archie repo blunder-blame
Bridge AI Code Blame with the Hall of Blunders: trace a recorded blunder forward to the exact files it blame-attributes to, or a file's blame history backward to any recorded blunders in the sessions blamed for it
| Flag | Required | Help | Default | Values |
|---|---|---|---|---|
--file | no | Blame -> blunder direction: file path or pattern. Checks every session AI Code Blame attributes this file to for a recorded blunder | - | - |
--session | no | Blunder -> blame direction: one specific session ID, by full ID or a unique prefix. Resolves it to the files AI Code Blame attributes to that session | - | - |
--last | no | Blunder -> blame direction for the newest session in this repository, same as `--session` with that session's ID | false | - |
--current | no | Alias of `--last` | false | - |
--top, -t | no | In default mode (no --file or --session), number of top blunders to bridge | 5 | - |
--json | no | Output results as JSON | false | - |
archie repo receipt
Work Receipts: a signed, privacy-safe account of what this machine's index saw on the commits you push, for the AgentWorth / Evidence check. Nothing leaves the machine until you say yes once per repository
archie repo receipt init
Print the workflow and the pre-push hook. --write writes both (never over an existing file), creates the receipt key, and records consent for this repository
| Flag | Required | Help | Default | Values |
|---|---|---|---|---|
--repo | no | Path to a git checkout. Defaults to the current directory | - | - |
--write | no | Write the workflow and hook, create the key, and record consent | false | - |
--json | no | Output as JSON | false | - |
archie repo receipt create
Build, sign and store a receipt for the commits about to be pushed: a git note on the tip (default) or a file under .agentworth/receipts/. Shows the exact JSON first on a terminal, and asks once per repository
| Flag | Required | Help | Default | Values |
|---|---|---|---|---|
--repo | no | Path to a git checkout. Defaults to the current directory | - | - |
--base | no | Ref to cover commits since. Defaults to the branch's upstream, then origin/main | - | - |
--push | no | Push refs/notes/agentworth after writing the note (what the pre-push hook runs) | false | - |
--remote | no | Remote to push the notes ref to. Defaults to origin | - | - |
--transport | no | Where the receipt goes | notes | notes, file |
--include-spend | no | Include API-equivalent spend (micro-USD). Off by default: receipts carry tokens only | false | - |
--json | no | Output the result, and the receipt itself, as JSON. Never prompts | false | - |
--quiet | no | One line on stderr, never a prompt, never a failure. What the hook runs | false | - |
archie repo receipt show
Decode a receipt by id prefix or commit, check its signature offline, and map its session refs back to sessions on this machine
| Flag | Required | Help | Default | Values |
|---|---|---|---|---|
RECEIPT_ID_OR_SHA | yes | A receipt id (or a prefix of one, 4+ hex characters) or a commit | - | - |
--repo | no | Path to a git checkout. Defaults to the current directory | - | - |
--json | no | Output as JSON | false | - |
archie repo receipt key
Print the receipt public key; --github prints the `gh ssh-key add --type signing` line
| Flag | Required | Help | Default | Values |
|---|---|---|---|---|
--github | no | Print the `gh ssh-key add --type signing` command that links this key to your GitHub account, so the check can say "Signed by @you" | false | - |
--json | no | Output as JSON | false | - |
archie repo receipt verify
Verify every receipt for a PR range offline and render the AgentWorth / Evidence check. CI results and signing keys come from files (--ci, --keys); no network
| Flag | Required | Help | Default | Values |
|---|---|---|---|---|
--base | yes | Base of the PR range (a commit or ref) | - | - |
--head | yes | Head of the PR range (a commit or ref) | - | - |
--ci | no | Check runs and statuses on the head SHA, as collected with `gh api` | - | - |
--keys | no | GitHub signing keys of the PR and commit authors, as collected with `gh api` | - | - |
--receipt | no | An extra receipt file to read, beyond notes and .agentworth/receipts/ (repeatable) | - | - |
--fail-on | no | Opt-in failure: invalid-signature, below-rung:N, unattributed (comma-separated) | - | - |
--format | no | Output format | md | md, check-json |
--repo | no | Path to a git checkout. Defaults to the current directory | - | - |
archie window
The rolling burn-rate window: what is being spent right now
archie window show
The current rolling window: burn rate, active models, quota headroom
| Flag | Required | Help | Default | Values |
|---|---|---|---|---|
--hours | no | Window duration in hours | 5 | - |
--alert-above | no | Alert and highlight if window spend exceeds this threshold in USD | - | - |
--json | no | Output as formatted JSON | false | - |
archie window list
The recent rolling windows, newest first
| Flag | Required | Help | Default | Values |
|---|---|---|---|---|
--hours | no | Window duration in hours | 5 | - |
--limit, -l | no | How many consecutive windows to show, newest first (default 6) | - | - |
--json | no | Output as formatted JSON | false | - |
archie serve
Start the local API server and interactive explorer UI
| Flag | Required | Help | Default | Values |
|---|---|---|---|---|
--port, -p | no | Port to bind the server to | 3000 | - |
--open | no | Automatically open the Web UI in the default browser | false | - |
--dist | no | Optional path to custom web frontend dist directory | - | - |
--no-socket | no | Do not listen on the loop's Unix socket. Hook events then take the spool, and `archie scan` ingests them (docs/specs/loop.md section 1) | false | - |
--home | no | Start the gateway behind `apps/home` (a WebSocket at /ws) alongside the HTTP API. Unix-only: it dials herdr's own Unix socket for live presence. See `apps/cli/src/server/home_gateway.rs` | false | - |
archie mcp
Start the read-only MCP server over stdio, for a coding agent to query this machine's session index mid-session (see docs/specs/mcp-server.md). Register it once with `claude mcp add agentworth --scope user -- archie mcp`
archie hook
Plumbing: read one harness hook event on stdin and hand it to the loop (docs/specs/loop.md). Never prints to stdout, never fails the agent, exits 0 always. `archie hook print claude` prints the settings.json snippet that registers it
| Flag | Required | Help | Default | Values |
|---|---|---|---|---|
--gate | no | Answer the harness synchronously instead of recording and returning: one socket round trip inside 50 ms, and exit 0 with nothing on stdout if it misses | false | - |
archie hook print
Print the hook registration snippet for a harness. Never writes a settings file
| Flag | Required | Help | Default | Values |
|---|---|---|---|---|
HARNESS | yes | The harness to print for. Both are verified against that harness's own hooks reference (docs/specs/loop.md, docs/specs/governor.md) | - | claude, codex, antigravity |
--govern | no | Also register the sync gates, so the governor can stop a turn. Claude Code only: the Codex snippet is gated by construction, since Codex has no batch hook | false | - |
archie policy
The governor's policy file: what it says, whether it parses, and clearing a session it suspended (docs/specs/governor.md). Nothing is governed until a `policy.toml` exists
archie policy init
Write a starter policy.toml, with this machine's own token percentiles as comments
| Flag | Required | Help | Default | Values |
|---|---|---|---|---|
--repo | no | Write `.agentworth/policy.toml` in the current repo instead of `~/.agentworth/policy.toml` | false | - |
--force | no | Overwrite an existing file | false | - |
archie policy show
What is governed right now, and which files were read to decide that
| Flag | Required | Help | Default | Values |
|---|---|---|---|---|
--json | no | Output as formatted JSON | false | - |
archie policy check
Parse both files and say what is wrong with them, naming the file and the line
archie policy lift
Clear a spend-cap suspension so the session can submit prompts again
| Flag | Required | Help | Default | Values |
|---|---|---|---|---|
SESSION | yes | The session to lift, by full id | - | - |
archie policy replay
What the current thresholds would have done to the sessions already indexed
| Flag | Required | Help | Default | Values |
|---|---|---|---|---|
--since | no | How far back to replay, in days | 30d | - |
--json | no | Output as formatted JSON | false | - |
archie insights
Machine agent work in one deterministic report: usable sessions, tool calls, file touches, the evidence ladder, per-model burn, biggest sessions. Read-only; `--json` emits the full payload (same JSON as GET /api/insights)
| Flag | Required | Help | Default | Values |
|---|---|---|---|---|
--json | no | Output the full insights payload as formatted JSON | false | - |
--since | no | Window start (UTC RFC3339); inclusive | - | - |
--until | no | Window end (same format); exclusive. Defaults to the index's newest usable session | - | - |
--adapter | no | Single-select equality filter; valid values list under --json (insights.facets) | - | - |
--model | no | Filter by a recorded per-session model usage row | - | - |
--repo | no | Filter by display repo over session source paths (insights.repo_label) | - | - |
archie turns
(Re)ingest the human-turn lane on its own -- the turn-data side of Insights, without a full scan. A taxonomy-version bump wipes and re-parses every turn source; the dedup signature keeps past encounters out. Also the repair turn for the turn↔session link (tier-2/3 need each turn's source file path, which only ingester v2+ writes)
| Flag | Required | Help | Default | Values |
|---|---|---|---|---|
--force | no | Re-parse every turn source regardless of fingerprints (dedup keeps stored rows stable) | false | - |
--json | no | Output the ingest summary as JSON | false | - |
archie doctor
Check local environment, adapter discoveries, and SQLite database health
| Flag | Required | Help | Default | Values |
|---|---|---|---|---|
--json | no | Output diagnostic report as formatted JSON | false | - |
--self-test | no | Run the real release workflow end to end -- scan, stats, usage, sessions, show, handoff, forgotten, and an MCP round trip -- against the real index on this machine, with no network, and report pass/fail/slow and timing for each step. Exits non-zero if any step fails | false | - |
archie docs
Generate CLI, HTTP API, and MCP tool reference documentation from the code itself (see docs/REFERENCE.md). Nothing here is hand-written prose: the CLI section walks the clap command tree, the API section walks the axum route table, and the MCP section walks the rmcp tool router -- so the reference cannot drift from the code
| Flag | Required | Help | Default | Values |
|---|---|---|---|---|
--format | no | Output format when printing to stdout (ignored with --write, which always writes both forms) | markdown | markdown, json |
--write | no | Write docs/REFERENCE.md and docs/reference.json (relative to the current directory, which must be the repository root) instead of printing to stdout | false | - |
archie config
Get, set, or list persisted CLI defaults (~/.agentworth/config.toml)
archie config list
List every persisted config key and its current value
| Flag | Required | Help | Default | Values |
|---|---|---|---|---|
--json | no | Output as JSON | false | - |
archie config get
Print the persisted value for one config key
| Flag | Required | Help | Default | Values |
|---|---|---|---|---|
KEY | yes | Config key: json, limit, period, archie.accessory, or archie.colourway | - | - |
--json | no | Output as JSON | false | - |
archie config set
Persist a default value for one config key
| Flag | Required | Help | Default | Values |
|---|---|---|---|---|
KEY | yes | Config key: json, limit, period, archie.accessory, or archie.colourway | - | - |
VALUE | yes | Value to store (json: true/false, limit: a number, period: day/week/month, archie.accessory: lamp/goggles/none, archie.colourway: C1/C2/C3/C4) | - | - |
--json | no | Output as JSON | false | - |
archie version
Print version details: binary version, npm install detection, and a live check for a newer release
| Flag | Required | Help | Default | Values |
|---|---|---|---|---|
--offline | no | Skip the live GitHub-releases update check (fully local, no network call) | false | - |
--json | no | Output as formatted JSON | false | - |
archie update
Check for a newer AgentWorth release and show exactly how to get it
| Flag | Required | Help | Default | Values |
|---|---|---|---|---|
--offline | no | Skip the live GitHub-releases check and just show install-method guidance | false | - |
--json | no | Output as formatted JSON | false | - |
archie completions
Write a shell completion script to stdout
| Flag | Required | Help | Default | Values |
|---|---|---|---|---|
SHELL | yes | Shell to generate a completion script for | - | bash, elvish, fish, powershell, zsh |
archie merge
Merge another local SQLite index database into this index
| Flag | Required | Help | Default | Values |
|---|---|---|---|---|
SOURCE_DB | yes | Path to the source SQLite database file to merge from | - | - |
--json | no | Output results as JSON | false | - |
archie tui
Open the cockpit: the same grammar, full screen, with a cursor. A bare `archie` does this too; `archie tui` is the explicit spelling. Off a terminal, under `--plain`, under `TERM=dumb`, or with JSON output, both print the overview and exit 0 instead of taking the terminal over
| Flag | Required | Help | Default | Values |
|---|---|---|---|---|
--json | no | Print the overview as JSON and exit, without opening anything | false | - |
HTTP API
Registered by agentworth serve under http://localhost:<port>.
GET /api/stats
Machine-wide experience stats with outcome distributions and verification telemetry
GET /api/traces
Filtered, paginated list of indexed sessions
| Query Param | Description |
|---|---|
adapter | Filter by adapter name |
model | Filter by model substring |
search | Full-text search across session content |
outcome | Filter by primary outcome kind |
min_tokens | Minimum total token count |
limit | Maximum number of sessions to return (default 50) |
offset | Number of sessions to skip |
order_by | Sort order for the result list |
GET /api/traces/:id
Full trace details: metadata, stats, 5-factor score, outcome evidence, timeline
| Query Param | Description |
|---|---|
offset | Number of events to skip (default 0) |
limit | Maximum number of events to return (default: all) |
GET /api/traces/:id/events
Just the paginated event slice for one trace
| Query Param | Description |
|---|---|
offset | Number of events to skip (default 0) |
limit | Maximum number of events to return (default: all) |
GET /api/usage
Daily, weekly, and monthly token usage rollups
| Query Param | Description |
|---|---|
daily_limit | Maximum number of daily rollup rows |
weekly_limit | Maximum number of weekly rollup rows |
monthly_limit | Maximum number of monthly rollup rows |
GET /api/pacing
Rolling pacing window: burn velocity and cache hit ratio
| Query Param | Description |
|---|---|
hours | Pacing window duration in hours (default 5) |
GET /api/blame
File change lineage matching session histories
| Query Param | Description |
|---|---|
file | Target file path or pattern |
path | Alias for `file` |
GET /api/matrix
Adapter extraction coverage and capabilities matrix
GET /api/insights
The deterministic machine-insights payload: usable sessions, tool calls, evidence ladder, per-model burn, biggest sessions (same JSON as `agentworth insights --json`). Optional since/until window plus single-select adapter/model/repo slice filters (values validated against the payload's facets block)
| Query Param | Description |
|---|---|
since | window start (UTC RFC3339, inclusive) |
until | window end (exclusive; requires since) |
adapter | single-select equality slice; values validated against the payload's facets |
model | single-select model equality over recorded per-session usage |
repo | single-select display-repo equality |
GET /api/insights/drill
Drill-through: the sessions behind one insights cut (same shape the deck's session feeds render). view=ladder|day_hour|friction + key=<rung|dow-hour|trigger>, optional since/until and the same adapter/model/repo filters
| Query Param | Description |
|---|---|
view | ladder | day_hour | friction |
key | rung outcome | <dow>-<hour> | trigger |
since | window start (UTC RFC3339, inclusive) |
until | window end (exclusive; requires since) |
adapter | single-select equality slice |
model | single-select model equality |
repo | single-select display-repo equality |
limit | rows to return (default 50, ceiling 200); count is always the full total |
GET /api/archaeology
Archaeology highlights across the whole index
GET /api/live-tail
Server-Sent Events stream of live filesystem changes under watched adapter session directories
POST /api/scan
Trigger a scanner background sync (body: paths, force)
GET /api/config
Persisted CLI defaults from config.toml, every key present and unset ones null
POST /api/config
Write a partial set of persisted CLI defaults (body: any of json, limit, period, archie.accessory, archie.colourway; null clears a key)
POST /api/export/:id
Export a trace with optional redaction, in JSON or ATIF format (body: redact, format)
MCP Tools
Register once with claude mcp add agentworth --scope user -- agentworth mcp (stdio). Read-only; redaction is on by default for every tool.
agent_list
Machine-wide aggregate stats: total sessions/events, token usage, sessions by adapter, model/tool usage counts, and verified-outcome count -- the same population /api/stats reports. Pass include_matrix=true to also get the per-adapter detection/capability matrix (/api/matrix's equivalent), answering "what does this machine even have" without opening the dashboard.
| Param | Required | Type | Description |
|---|---|---|---|
include_matrix | no | boolean | Also compute and include the per-adapter detection/capability matrix (`/api/matrix`'s equivalent). Defaults to false. |
JSON schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"include_matrix": {
"default": false,
"description": "Also compute and include the per-adapter detection/capability matrix\n(`/api/matrix`'s equivalent). Defaults to false.",
"type": "boolean"
}
},
"type": "object"
}agent_status
Where every agent on this machine is right now: one row per session the loop has seen, with its state (registered / working / idle / ended), when it entered that state, the repository it is working in, its terminal pane when herdr exported one, and its event sequence. Fed by the harness's own hooks (`archie hook`), not by a scan, so it is current rather than as-of-last-scan. An empty list means no hook is registered -- `archie hook print claude` prints the snippet.
JSON schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object"
}insights_get
The deterministic machine-insights payload over this index -- the exact contract `agentworth insights --json` and /api/insights serve, never a hand-rolled variant: population, volume, by_adapter, ladder, verified, calls_per_turn, turn_buckets, file_modifications, top_repos, top_sessions, session_size_buckets, models, models_totals, series, tool_buckets and tool_buckets_detail, plus the human-turn blocks day_hour, friction and vocabulary, deltas, coverage_flags and the deferred list with its reasons. Optional since/until narrow the window (`until` requires `since`); absent both is all-time. Aggregates only -- no transcript text is ever returned, so there is no include_raw. Zero-data blocks come back empty with the reason in `deferred`, never zero-filled.
| Param | Required | Type | Description |
|---|---|---|---|
adapter | no | string or null | Exact adapter match (e.g. `claude_code`); valid values in the payload's facets. |
model | no | string or null | Exact model match over recorded per-session model usage. Optional. |
repo | no | string or null | Exact display-repo match over session source paths. Optional. |
since | no | string or null | RFC 3339 timestamp; only sessions (and stored human turns) starting at or after this instant. Optional; omit for all-time. |
until | no | string or null | RFC 3339 timestamp; requires `since` -- a window needs a start. |
JSON schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"adapter": {
"description": "Exact adapter match (e.g. `claude_code`); valid values in the payload's facets.",
"type": [
"string",
"null"
]
},
"model": {
"description": "Exact model match over recorded per-session model usage. Optional.",
"type": [
"string",
"null"
]
},
"repo": {
"description": "Exact display-repo match over session source paths. Optional.",
"type": [
"string",
"null"
]
},
"since": {
"description": "RFC 3339 timestamp; only sessions (and stored human turns) starting at or after\nthis instant. Optional; omit for all-time.",
"type": [
"string",
"null"
]
},
"until": {
"description": "RFC 3339 timestamp; requires `since` -- a window needs a start.",
"type": [
"string",
"null"
]
}
},
"type": "object"
}insights_summary
The compact insights surface: one headline row per KPI -- population, volume, verified share, calls_per_turn strict, friction rate and top trigger, the day_hour peak cell, and the deferred list -- projected from the same payload `insights_get` returns, so the two can never disagree. The series, top lists, vocabulary rows and full turn blocks stay in `insights_get`. Optional since/until as there. Aggregates only -- no transcript text is ever returned, so there is no include_raw.
| Param | Required | Type | Description |
|---|---|---|---|
adapter | no | string or null | Exact adapter match (e.g. `claude_code`); valid values in the payload's facets. |
model | no | string or null | Exact model match over recorded per-session model usage. Optional. |
repo | no | string or null | Exact display-repo match over session source paths. Optional. |
since | no | string or null | RFC 3339 timestamp; only sessions (and stored human turns) starting at or after this instant. Optional; omit for all-time. |
until | no | string or null | RFC 3339 timestamp; requires `since` -- a window needs a start. |
JSON schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"adapter": {
"description": "Exact adapter match (e.g. `claude_code`); valid values in the payload's facets.",
"type": [
"string",
"null"
]
},
"model": {
"description": "Exact model match over recorded per-session model usage. Optional.",
"type": [
"string",
"null"
]
},
"repo": {
"description": "Exact display-repo match over session source paths. Optional.",
"type": [
"string",
"null"
]
},
"since": {
"description": "RFC 3339 timestamp; only sessions (and stored human turns) starting at or after\nthis instant. Optional; omit for all-time.",
"type": [
"string",
"null"
]
},
"until": {
"description": "RFC 3339 timestamp; requires `since` -- a window needs a start.",
"type": [
"string",
"null"
]
}
},
"type": "object"
}repo_blame
Find sessions whose recorded file modifications match a substring of file_path -- AI Code Blame, the same query /api/blame makes. Returned paths are redacted.
| Param | Required | Type | Description |
|---|---|---|---|
file_path | yes | string | Substring pattern matched against recorded file-modification paths. |
JSON schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"file_path": {
"description": "Substring pattern matched against recorded file-modification paths.",
"type": "string"
}
},
"required": [
"file_path"
],
"type": "object"
}repo_receipt
The Work Receipt the next push would sign, without signing, writing or pushing anything. Same range rules as repo_suspect (upstream, then origin/main, then the last max_commits). Returns the exact receipt Statement (commit SHAs, opaque session refs, adapters, models, token totals, rung kinds with verified_locally, risk counters -- no prompts, no paths outside the commits' own diffs), a `predicted` list per commit (highest rung attested locally, rungs only claimed), a one-line `summary` such as "rung 3 attested, rung 1 claimed only", and `sessions_local` mapping each ref back to a session id for session_show. Use it before pushing: if nothing reaches rung 3 attested, run the tests first. Rungs 2, 4 and 5 are re-derived from CI by the AgentWorth / Evidence check, not here. `key_present: false` means no receipt key exists yet (refs are placeholders); `consent_recorded: false` means the pre-push hook will not export until the user runs `archie repo receipt init --write` or answers yes once.
| Param | Required | Type | Description |
|---|---|---|---|
base | no | string or null | Ref to diff against. Defaults to the branch's own upstream, then `origin/main`, then `origin/master`, then the most recent `max_commits` commits — the range the pre-push hook would sign. |
branch | no | string or null | Branch to walk. Defaults to `HEAD`. |
include_spend | no | boolean or null | Put API-equivalent spend (micro-USD) in the preview, as `create --include-spend` would. Defaults to false: receipts carry tokens only. |
max_commits | no | integer or null | Ceiling on commits walked. Defaults to 200, hard-capped at 1000. |
repo | yes | string | Absolute path to a git checkout on this machine. Anything inside it works — the repository root is resolved with `git rev-parse --show-toplevel`. |
since | no | string or null | RFC 3339 timestamp. Only consulted when `base` is absent. |
window_hours | no | integer or null | How long before a commit a session's file touch still counts as having authored it. Defaults to 24. |
JSON schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"base": {
"description": "Ref to diff against. Defaults to the branch's own upstream, then `origin/main`, then\n`origin/master`, then the most recent `max_commits` commits — the range the pre-push\nhook would sign.",
"type": [
"string",
"null"
]
},
"branch": {
"description": "Branch to walk. Defaults to `HEAD`.",
"type": [
"string",
"null"
]
},
"include_spend": {
"default": null,
"description": "Put API-equivalent spend (micro-USD) in the preview, as `create --include-spend` would.\nDefaults to false: receipts carry tokens only.",
"type": [
"boolean",
"null"
]
},
"max_commits": {
"description": "Ceiling on commits walked. Defaults to 200, hard-capped at 1000.",
"format": "uint",
"minimum": 0,
"type": [
"integer",
"null"
]
},
"repo": {
"description": "Absolute path to a git checkout on this machine. Anything inside it works — the\nrepository root is resolved with `git rev-parse --show-toplevel`.",
"type": "string"
},
"since": {
"description": "RFC 3339 timestamp. Only consulted when `base` is absent.",
"type": [
"string",
"null"
]
},
"window_hours": {
"description": "How long before a commit a session's file touch still counts as having authored it.\nDefaults to 24.",
"format": "int64",
"type": [
"integer",
"null"
]
}
},
"required": [
"repo"
],
"type": "object"
}repo_suspect
Which commits on this branch came out of a session that never proved anything. Walks `git log` over the range, joins each commit's changed paths to indexed sessions that touched them within window_hours before it, and reports each session's risk signals: no_test_run (the session never got past artifact_changed), no_outcome_detected (the adapter extracted no outcome at all -- weaker), demoted_claim (verification contradicted a claim, with the event sequence), and loop (the sentinel caught repetition). Returns a list and a copyable prompt -- never a patch, a diff, or a PR: a trajectory says the session was going badly, not what the code does wrong. Two counts are load-bearing and must be reported to the user, not dropped: `unattributed` commits had no indexed session at all (unknown, not clean), and `unanchored_blame_rows` is evidence that could not be placed in any repository. Paths and session source paths are redacted.
| Param | Required | Type | Description |
|---|---|---|---|
base | no | string or null | Ref to diff against. Defaults to the branch's own upstream, then `origin/main`, then `origin/master`, then the most recent `max_commits` commits. |
branch | no | string or null | Branch to walk. Defaults to `HEAD`. |
max_commits | no | integer or null | Ceiling on commits walked. Defaults to 200, hard-capped at 1000. |
repo | yes | string | Absolute path to a git checkout on this machine. Anything inside it works — the repository root is resolved with `git rev-parse --show-toplevel`. |
since | no | string or null | RFC 3339 timestamp. Only consulted when `base` is absent. |
window_hours | no | integer or null | How long before a commit a session's file touch still counts as having authored it. Defaults to 24. |
JSON schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"base": {
"description": "Ref to diff against. Defaults to the branch's own upstream, then `origin/main`, then\n`origin/master`, then the most recent `max_commits` commits.",
"type": [
"string",
"null"
]
},
"branch": {
"description": "Branch to walk. Defaults to `HEAD`.",
"type": [
"string",
"null"
]
},
"max_commits": {
"description": "Ceiling on commits walked. Defaults to 200, hard-capped at 1000.",
"format": "uint",
"minimum": 0,
"type": [
"integer",
"null"
]
},
"repo": {
"description": "Absolute path to a git checkout on this machine. Anything inside it works — the\nrepository root is resolved with `git rev-parse --show-toplevel`.",
"type": "string"
},
"since": {
"description": "RFC 3339 timestamp. Only consulted when `base` is absent.",
"type": [
"string",
"null"
]
},
"window_hours": {
"description": "How long before a commit a session's file touch still counts as having authored it.\nDefaults to 24.",
"format": "int64",
"type": [
"integer",
"null"
]
}
},
"required": [
"repo"
],
"type": "object"
}session_asks
The questions-to-answers index for one session: every question asked (a `?` sentence in a user turn, or a flag-prefixed `⚑`/`🚩` line in an assistant turn asking the user something) matched to the first substantive assistant text that follows it, before the next user turn. Exists so an agent can be told where an answer already landed instead of the user re-scrolling or re-asking. Each result carries the question (trimmed to 120 chars), a status (answered, flagged_back_to_user -- either a flag line or a reply that was itself a question, or no_reply_yet), an answer excerpt when one was found (trimmed to 200 chars), and a pointer (event sequence and timestamp) to jump to: the answer's location when there is one, otherwise the question's own. Filter with since (RFC 3339) and unanswered_only; limit defaults to 50, ceiling 500, and the totals describe the whole session regardless of it. No model is involved -- three deterministic patterns, same `regex_v1` method `session_forgotten` uses. Defaults to the newest session for the repo this server runs in. Redacted by default; include_raw=true opts out, per call.
| Param | Required | Type | Description |
|---|---|---|---|
include_raw | no | boolean | Return unredacted questions and answer excerpts. Defaults to false -- everything this tool returns is transcript text (docs/specs/mcp-server.md, "What it must not expose"). |
limit | no | integer or null | How many questions to return, newest first. Defaults to 50, hard ceiling 500. The totals in the response describe the whole session regardless of this. |
session_id | no | string or null | Session to index. Defaults to the most recent indexed session for the repository this server process is running in, same default `session_handoff` uses. |
since | no | string or null | RFC 3339 timestamp; only questions asked at or after this instant. |
unanswered_only | no | boolean | Only questions that are not `answered` -- still open, or handed back to the user. Defaults to false. |
JSON schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"include_raw": {
"default": false,
"description": "Return unredacted questions and answer excerpts. Defaults to false -- everything this\ntool returns is transcript text (docs/specs/mcp-server.md, \"What it must not expose\").",
"type": "boolean"
},
"limit": {
"description": "How many questions to return, newest first. Defaults to 50, hard ceiling 500. The\ntotals in the response describe the whole session regardless of this.",
"format": "uint",
"minimum": 0,
"type": [
"integer",
"null"
]
},
"session_id": {
"description": "Session to index. Defaults to the most recent indexed session for the repository this\nserver process is running in, same default `session_handoff` uses.",
"type": [
"string",
"null"
]
},
"since": {
"description": "RFC 3339 timestamp; only questions asked at or after this instant.",
"type": [
"string",
"null"
]
},
"unanswered_only": {
"default": false,
"description": "Only questions that are not `answered` -- still open, or handed back to the user.\nDefaults to false.",
"type": "boolean"
}
},
"type": "object"
}session_burn
What one session has spent so far, metered from its own transcript: tokens, dollars at the pricing table's rates, turns, the cache read share, and the rate over the last ten minutes. This is AgentWorth's own count, not the provider's accounting -- it never reports a 'remaining'. When the harness writes its own rate-limit line (Codex does; Claude Code does not) that line is returned verbatim under `provider_limit`, labelled as the provider's. Numbers are as of the last update `archie serve` wrote, and are zero on a machine with no `policy.toml`, since nothing is metered until something is governed.
| Param | Required | Type | Description |
|---|---|---|---|
session_id | no | string or null | The session, by full id or a unique prefix. Defaults to the most recently active session in the loop's own index, which is the caller itself in the normal case. |
JSON schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"session_id": {
"description": "The session, by full id or a unique prefix. Defaults to the most recently active\nsession in the loop's own index, which is the caller itself in the normal case.",
"type": [
"string",
"null"
]
}
},
"type": "object"
}session_carry_forward
The last N handoffs for one repository, newest first, so a session's first tool call can be "what happened here recently" and the answer is structured rather than a file it has to find and parse. `repo` is the same key session_handoff's receipt reports (e.g. `unfoundbox/agentworth`); a repo's worktrees all answer to one value. n defaults to 3, ceiling 10. Handoffs are listed, never merged -- merging two contradictory facts needs judgment about which is current, and that is not in the index. Subagent transcripts are excluded unless include_subagents is true. Redacted by default.
| Param | Required | Type | Description |
|---|---|---|---|
include_raw | no | boolean | Same per-call raw opt-in `session_handoff` has, applied to every handoff returned. |
include_subagents | no | boolean | Include subagent transcripts as their own entries. Defaults to false: a subagent starts after its parent and would otherwise win "newest" for a session the parent is still running (docs/specs/wake.md). |
max_lines | no | integer or null | Line budget for each rendered handoff. Defaults to 60, hard ceiling 120. |
n | no | integer or null | How many handoffs to return, newest first. Defaults to 3, ceiling 10. |
repo | yes | string | Repository/workspace key, as `session_list`'s `repo` and the handoff receipt report it (e.g. `unfoundbox/agentworth`). A repo's worktrees all answer to one value. |
since | no | string or null | RFC 3339 timestamp; only sessions started at or after this instant. |
JSON schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"include_raw": {
"default": false,
"description": "Same per-call raw opt-in `session_handoff` has, applied to every handoff returned.",
"type": "boolean"
},
"include_subagents": {
"default": false,
"description": "Include subagent transcripts as their own entries. Defaults to false: a subagent\nstarts after its parent and would otherwise win \"newest\" for a session the parent is\nstill running (docs/specs/wake.md).",
"type": "boolean"
},
"max_lines": {
"description": "Line budget for each rendered handoff. Defaults to 60, hard ceiling 120.",
"format": "uint",
"minimum": 0,
"type": [
"integer",
"null"
]
},
"n": {
"description": "How many handoffs to return, newest first. Defaults to 3, ceiling 10.",
"format": "uint",
"minimum": 0,
"type": [
"integer",
"null"
]
},
"repo": {
"description": "Repository/workspace key, as `session_list`'s `repo` and the handoff receipt report\nit (e.g. `unfoundbox/agentworth`). A repo's worktrees all answer to one value.",
"type": "string"
},
"since": {
"description": "RFC 3339 timestamp; only sessions started at or after this instant.",
"type": [
"string",
"null"
]
}
},
"required": [
"repo"
],
"type": "object"
}session_drift
What moved under a session since it read it. The support set U is the paths the session actually read, hashed at the time; this re-hashes them and returns the ones that differ, each with the session that predicted a write to that path afterwards, or nothing when no agent on this machine did (someone edited it by hand, or another tool did). The answer to "did my ground move because of me or someone else", which no harness summary can give. Reads files and rows; never scans, never writes. Files over 4 MB were not hashed and are counted as unhashed rather than reported as unchanged.
| Param | Required | Type | Description |
|---|---|---|---|
session_id | no | string or null | The session, by full id or a unique prefix. Defaults to the most recently active session in the loop's own index, which is the caller itself in the normal case. |
JSON schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"session_id": {
"description": "The session, by full id or a unique prefix. Defaults to the most recently active\nsession in the loop's own index, which is the caller itself in the normal case.",
"type": [
"string",
"null"
]
}
},
"type": "object"
}session_forgotten
The decisions this session's compaction rounds threw away, quoted verbatim with a receipt on each. Compaction replaces the conversation with a summary in the model's view while the full transcript stays on disk, so the dropped span and the summary that replaced it both exist and can be diffed. Measured on one real 8-round session (docs/specs/compaction-diff.md): 402 decision-shaped sentences went in and 28 came out -- conclusions survive at 15%, reasons at 1.7%, which is the shape that makes a session re-propose something it already rejected. Filter with round (1-based) and classes (decision, rejected, reason); limit defaults to 20, ceiling 200, and the totals describe the whole session regardless of it. Every statement carries its round, source sequence, and what the session did in the next few events, so a stated decision that was acted on can be told from one that was only claimed. Three answers are kept distinct and none is padded: never compacted, compacted with nothing decision-shaped dropped, and a real list. No model is involved -- three regexes return the sentence verbatim, because a paraphrase would make this a second summariser. Refuses if the raw session file is gone. Redacted by default; include_raw=true opts out, per call.
| Param | Required | Type | Description |
|---|---|---|---|
classes | no | array or null | Any of `decision`, `rejected`, `reason`. Defaults to all three. An unknown name is an error, not an ignored filter. |
include_raw | no | boolean | Return unredacted sentences, paths and evidence labels. Defaults to false -- everything this tool returns is transcript text (docs/specs/mcp-server.md, "What it must not expose"). |
limit | no | integer or null | How many statements to return, newest first. Defaults to 20, hard ceiling 200. The totals in the response describe the whole session regardless of this. |
round | no | integer or null | One 1-based compaction round. Defaults to every round. |
session_id | no | string or null | Session to diff. Defaults to the most recent indexed session for the repository this server process is running in, which is what an agent asking "what did I forget here" means; pass one explicitly to reach any other session. |
JSON schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"classes": {
"description": "Any of `decision`, `rejected`, `reason`. Defaults to all three. An unknown name is an\nerror, not an ignored filter.",
"items": {
"type": "string"
},
"type": [
"array",
"null"
]
},
"include_raw": {
"default": false,
"description": "Return unredacted sentences, paths and evidence labels. Defaults to false -- everything\nthis tool returns is transcript text (docs/specs/mcp-server.md, \"What it must not\nexpose\").",
"type": "boolean"
},
"limit": {
"description": "How many statements to return, newest first. Defaults to 20, hard ceiling 200. The\ntotals in the response describe the whole session regardless of this.",
"format": "uint",
"minimum": 0,
"type": [
"integer",
"null"
]
},
"round": {
"description": "One 1-based compaction round. Defaults to every round.",
"format": "uint32",
"minimum": 0,
"type": [
"integer",
"null"
]
},
"session_id": {
"description": "Session to diff. Defaults to the most recent indexed session for the repository this\nserver process is running in, which is what an agent asking \"what did I forget here\"\nmeans; pass one explicitly to reach any other session.",
"type": [
"string",
"null"
]
}
},
"type": "object"
}session_handoff
The handoff for one session, written from rows rather than by a model: what it said it would do and never did, what it said it decided, which files changed, which commands ran and with what exit code, the outcome rung reached, and how often the context was compacted. Returns markdown under a line budget (max_lines, default 60, ceiling 120), the receipt every claim traces back to, and `gaps` -- the machine-readable list of what this session could not answer, which is never padded over. Open decisions, PR/CI state and environment traps are NOT in the index and the output says so. Defaults to the newest session for the repo this server runs in. Redacted by default; include_raw=true opts out, per call.
| Param | Required | Type | Description |
|---|---|---|---|
include_loose_ends | no | boolean or null | Include the "said it would, no evidence it did" section. Defaults to true. |
include_raw | no | boolean | Return unredacted paths, commands and quoted sentences. Defaults to false -- redacted is the default for every tool that can carry event or file content (docs/specs/mcp-server.md, "What it must not expose"). |
max_lines | no | integer or null | Line budget for the rendered markdown. Defaults to 60, hard ceiling 120. |
session_id | no | string or null | Session to hand over. Defaults to the most recent indexed session for the repository this server process is running in, which is what an agent asking "what did I just do here" means; pass one explicitly to reach any other session or repo. |
JSON schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"include_loose_ends": {
"description": "Include the \"said it would, no evidence it did\" section. Defaults to true.",
"type": [
"boolean",
"null"
]
},
"include_raw": {
"default": false,
"description": "Return unredacted paths, commands and quoted sentences. Defaults to false -- redacted\nis the default for every tool that can carry event or file content\n(docs/specs/mcp-server.md, \"What it must not expose\").",
"type": "boolean"
},
"max_lines": {
"description": "Line budget for the rendered markdown. Defaults to 60, hard ceiling 120.",
"format": "uint",
"minimum": 0,
"type": [
"integer",
"null"
]
},
"session_id": {
"description": "Session to hand over. Defaults to the most recent indexed session for the repository\nthis server process is running in, which is what an agent asking \"what did I just do\nhere\" means; pass one explicitly to reach any other session or repo.",
"type": [
"string",
"null"
]
}
},
"type": "object"
}session_list
Find sessions by adapter, model, outcome, search text, date range, token floor, or derived repo/workspace name. `limit` is required with a hard ceiling of 200 -- there is no silent default, so state how many results you want. Returns summaries only (no event content); `source_path` is redacted.
| Param | Required | Type | Description |
|---|---|---|---|
adapter | no | string or null | Exact adapter name match (e.g. `claude_code`, `codex`, `gemini`). |
end_date | no | string or null | RFC 3339 timestamp; only sessions started at or before this instant. |
include_stubs | no | boolean or null | Include near-empty session stubs (defaults to excluding them). |
limit | yes | integer | Maximum rows to return. Required -- there is no silent default -- and capped at `SESSIONS_FIND_LIMIT_CEILING` (200). |
min_tokens | no | integer or null | Only sessions with at least this many total tokens. |
model | no | string or null | Substring match against the session's recorded models. |
offset | no | integer or null | - |
order_by | no | - | Sort order; defaults to `started_at_desc`. |
outcome | no | string or null | Exact match against the stored primary outcome, snake_case (e.g. `commit_observed`). |
repo | no | string or null | Filter to sessions whose derived repository/workspace name matches exactly. Not a stored column -- computed per-row from `source_path` and post-filtered client-side, so combining this with `limit` may require over-fetching (see `truncated` in the response). |
search | no | string or null | Substring match across session ID, source path, models, and adapter. |
start_date | no | string or null | RFC 3339 timestamp; only sessions started at or after this instant. |
JSON schema
{
"$defs": {
"SessionsOrderBy": {
"description": "Mirrors `agentworth_storage::SessionOrderBy` with the same snake_case wire values. A local\ncopy rather than deriving `schemars::JsonSchema` on the storage crate's own enum, since\n`agentworth-storage` has no reason to take on a `schemars` dependency for one MCP-only need.",
"enum": [
"started_at_desc",
"started_at_asc",
"tokens_desc",
"tokens_asc",
"events_desc",
"events_asc",
"duration_desc",
"score_desc",
"score_asc"
],
"type": "string"
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"adapter": {
"description": "Exact adapter name match (e.g. `claude_code`, `codex`, `gemini`).",
"type": [
"string",
"null"
]
},
"end_date": {
"description": "RFC 3339 timestamp; only sessions started at or before this instant.",
"type": [
"string",
"null"
]
},
"include_stubs": {
"default": null,
"description": "Include near-empty session stubs (defaults to excluding them).",
"type": [
"boolean",
"null"
]
},
"limit": {
"description": "Maximum rows to return. Required -- there is no silent default -- and capped at\n`SESSIONS_FIND_LIMIT_CEILING` (200).",
"format": "uint",
"minimum": 0,
"type": "integer"
},
"min_tokens": {
"description": "Only sessions with at least this many total tokens.",
"format": "uint64",
"minimum": 0,
"type": [
"integer",
"null"
]
},
"model": {
"description": "Substring match against the session's recorded models.",
"type": [
"string",
"null"
]
},
"offset": {
"format": "uint",
"minimum": 0,
"type": [
"integer",
"null"
]
},
"order_by": {
"anyOf": [
{
"$ref": "#/$defs/SessionsOrderBy"
},
{
"type": "null"
}
],
"description": "Sort order; defaults to `started_at_desc`."
},
"outcome": {
"description": "Exact match against the stored primary outcome, snake_case (e.g. `commit_observed`).",
"type": [
"string",
"null"
]
},
"repo": {
"description": "Filter to sessions whose derived repository/workspace name matches exactly. Not a\nstored column -- computed per-row from `source_path` and post-filtered client-side,\nso combining this with `limit` may require over-fetching (see `truncated` in the\nresponse).",
"type": [
"string",
"null"
]
},
"search": {
"description": "Substring match across session ID, source path, models, and adapter.",
"type": [
"string",
"null"
]
},
"start_date": {
"description": "RFC 3339 timestamp; only sessions started at or after this instant.",
"type": [
"string",
"null"
]
}
},
"required": [
"limit"
],
"type": "object"
}session_show
Get full detail for one session by ID: the trace, its 5-component TraceScore, outcome evidence, and recovery signals -- the same shape /api/traces/:id returns. Redacted by default (trace events, outcome summaries, and recovery summaries all pass through the redaction engine); pass include_raw=true for the unredacted trace. `trace.events` is paginated: events_offset (default 0) and events_limit (default 500, must be > 0) page through it, and the response's events_total says how many events the session actually has, so a large session is never returned in full by accident.
| Param | Required | Type | Description |
|---|---|---|---|
events_limit | no | integer or null | Max number of events to return. Defaults to `SESSION_GET_DEFAULT_EVENTS_LIMIT` (500) so a call can never receive a session's full event list by accident; pass an explicit, larger value to see more. Must be greater than 0. |
events_offset | no | integer or null | Zero-based offset into the trace's events. Defaults to 0. |
include_raw | no | boolean | Return the unredacted trace, outcomes, and recoveries. Defaults to false -- redacted output is the default for every tool that can carry event or file content (see docs/specs/mcp-server.md, "What it must not expose"). |
session_id | yes | string | - |
JSON schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"events_limit": {
"default": null,
"description": "Max number of events to return. Defaults to `SESSION_GET_DEFAULT_EVENTS_LIMIT` (500) so\na call can never receive a session's full event list by accident; pass an explicit,\nlarger value to see more. Must be greater than 0.",
"format": "uint",
"minimum": 0,
"type": [
"integer",
"null"
]
},
"events_offset": {
"default": null,
"description": "Zero-based offset into the trace's events. Defaults to 0.",
"format": "uint",
"minimum": 0,
"type": [
"integer",
"null"
]
},
"include_raw": {
"default": false,
"description": "Return the unredacted trace, outcomes, and recoveries. Defaults to false -- redacted\noutput is the default for every tool that can carry event or file content (see\ndocs/specs/mcp-server.md, \"What it must not expose\").",
"type": "boolean"
},
"session_id": {
"type": "string"
}
},
"required": [
"session_id"
],
"type": "object"
}session_wake
One call for a cold or just-compacted agent: the checkout it stands in (branch, HEAD, dirty, ahead), the newest primary session for the repo (task, last prompt, outcome rung, last passed and last failed verification command and whether the failure was re-run, files changed, loose ends, what it said it decided, what compaction dropped), the two sessions before it one line each, and a Next block: blocker and next step. At most 30 lines of markdown. Subagent transcripts never answer for their parent. Every line is a row, a git read, or a stat; missing facts are named in gaps, never padded. PR and CI state are not in the index and the output says so. Redacted by default; include_raw opts out per call. Does not scan.
| Param | Required | Type | Description |
|---|---|---|---|
include_raw | no | boolean | Return unredacted paths, commands and quoted sentences. Defaults to false -- redacted is the default for every tool that can carry event or file content (docs/specs/mcp-server.md, "What it must not expose"). |
repo | no | string or null | Repository/workspace key, as `session_list`'s `repo` and `session_carry_forward` take it (e.g. `unfoundbox/agentworth`). Defaults to the key derived from `workspace`. |
workspace | no | string or null | Directory to read the checkout from and to derive `repo` from when `repo` is absent. Defaults to the server's working directory. |
JSON schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"include_raw": {
"default": false,
"description": "Return unredacted paths, commands and quoted sentences. Defaults to false -- redacted\nis the default for every tool that can carry event or file content\n(docs/specs/mcp-server.md, \"What it must not expose\").",
"type": "boolean"
},
"repo": {
"description": "Repository/workspace key, as `session_list`'s `repo` and `session_carry_forward` take\nit (e.g. `unfoundbox/agentworth`). Defaults to the key derived from `workspace`.",
"type": [
"string",
"null"
]
},
"workspace": {
"description": "Directory to read the checkout from and to derive `repo` from when `repo` is absent.\nDefaults to the server's working directory.",
"type": [
"string",
"null"
]
}
},
"type": "object"
}stats_ladder
The evidence ladder over a window, in three blocks: how many sessions reached each rung (rung 0 is unflown -- no outcome evidence at all, which is not a failure) with the API-equivalent spend that sits below the evidence line; what a verified outcome costs per model, repo, adapter or effort; and the newest sessions that got past the line. A group under the sample floor returns rate: null and cost_per_verified_usd: null rather than a number nothing supports. Every dollar is API-equivalent at list prices (cost_basis says so), never what the account was billed. Reads the index only -- no transcript is reparsed. See docs/specs/archie-bench.md.
| Param | Required | Type | Description |
|---|---|---|---|
adapter | no | string or null | Exact adapter name (`claude_code`, `codex`, `opencode`, ...). |
by | no | object | Axis for the cost-per-verified-outcome table. Defaults to `model`. |
include_stubs | no | boolean or null | Include near-empty session stubs in the population. Defaults to false. |
min_n | no | integer or null | A group with fewer than this many claimed sessions returns a null rate and a null cost rather than a number nothing supports. Defaults to 20. |
model | no | string or null | Model substring (`sonnet`, `gpt-4o`, ...). |
period | no | string or null | Lookback window: `day`, `week`, `month`, `year` or `all`. Defaults to `month` (30 days). This is how far back the window reaches, not a rollup granularity. |
repo | no | string or null | Repository or workspace substring, as `session_list`'s `repo` reports it. |
JSON schema
{
"$defs": {
"LadderGroupByParam": {
"description": "Mirrors `agentworth_storage::LadderGroupBy` with the same snake_case wire values -- a\nlocal copy for the same reason `OutcomeRateGroupByParam` is one.",
"oneOf": [
{
"enum": [
"model",
"repo",
"adapter"
],
"type": "string"
},
{
"const": "effort",
"description": "Only Codex records an effort today; sessions without one are counted and named, not\ngiven a made-up value.",
"type": "string"
}
]
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"adapter": {
"description": "Exact adapter name (`claude_code`, `codex`, `opencode`, ...).",
"type": [
"string",
"null"
]
},
"by": {
"$ref": "#/$defs/LadderGroupByParam",
"description": "Axis for the cost-per-verified-outcome table. Defaults to `model`."
},
"include_stubs": {
"default": null,
"description": "Include near-empty session stubs in the population. Defaults to false.",
"type": [
"boolean",
"null"
]
},
"min_n": {
"description": "A group with fewer than this many claimed sessions returns a null rate and a null\ncost rather than a number nothing supports. Defaults to 20.",
"format": "uint",
"minimum": 0,
"type": [
"integer",
"null"
]
},
"model": {
"description": "Model substring (`sonnet`, `gpt-4o`, ...).",
"type": [
"string",
"null"
]
},
"period": {
"description": "Lookback window: `day`, `week`, `month`, `year` or `all`. Defaults to `month`\n(30 days). This is how far back the window reaches, not a rollup granularity.",
"type": [
"string",
"null"
]
},
"repo": {
"description": "Repository or workspace substring, as `session_list`'s `repo` reports it.",
"type": [
"string",
"null"
]
}
},
"type": "object"
}stats_outcomes
Verified-outcome rate by model, adapter, or repo: of the sessions that claimed done, what share left evidence (a passed test/build or stronger), with the sample size next to every row. Groups under min_n (default 20) are suppressed and counted in suppressed_groups rather than shown; a group with sessions but zero detected outcomes comes back as rate: null with reason: "no_outcome_detection" instead of being suppressed -- those are different claims. Includes a receipt (db_path, counted_at, index_last_session_at, the non-stub predicate, and the session IDs behind each row) so the answer is checkable.
| Param | Required | Type | Description |
|---|---|---|---|
group_by | yes | object | - |
include_stubs | no | boolean or null | Include near-empty session stubs in the population. Defaults to false. |
min_n | no | integer or null | Groups with fewer than this many claimed sessions are suppressed (counted in `suppressed_groups`) rather than returned as a row. Defaults to 20. |
since | no | string or null | RFC 3339 timestamp; only sessions started at or after this instant. |
until | no | string or null | RFC 3339 timestamp; only sessions started at or before this instant. |
JSON schema
{
"$defs": {
"OutcomeRateGroupByParam": {
"description": "Mirrors `agentworth_storage::OutcomeRateGroupBy` with the same snake_case wire values -- a\nlocal copy for the same reason `SessionsOrderBy` is one (see its doc comment above).",
"enum": [
"model",
"adapter",
"repo"
],
"type": "string"
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"group_by": {
"$ref": "#/$defs/OutcomeRateGroupByParam"
},
"include_stubs": {
"default": null,
"description": "Include near-empty session stubs in the population. Defaults to false.",
"type": [
"boolean",
"null"
]
},
"min_n": {
"description": "Groups with fewer than this many claimed sessions are suppressed (counted in\n`suppressed_groups`) rather than returned as a row. Defaults to 20.",
"format": "uint",
"minimum": 0,
"type": [
"integer",
"null"
]
},
"since": {
"description": "RFC 3339 timestamp; only sessions started at or after this instant.",
"type": [
"string",
"null"
]
},
"until": {
"description": "RFC 3339 timestamp; only sessions started at or before this instant.",
"type": [
"string",
"null"
]
}
},
"required": [
"group_by"
],
"type": "object"
}stats_usage
Daily, weekly, or monthly usage rollups: session counts, token breakdown, estimated cost, and cache hit ratio, grouped by adapter -- the same rollups /api/usage returns for one period at a time. Every estimated_cost_usd is an API list-price equivalent, not what the account actually paid -- see cost_basis/subscription_tier.
| Param | Required | Type | Description |
|---|---|---|---|
limit | no | integer or null | Row cap; defaults match the HTTP route's own per-period defaults (30 / 20 / 12). |
period | yes | object | - |
JSON schema
{
"$defs": {
"UsagePeriodParam": {
"description": "Rollup period for the `stats_usage` tool, mirroring `Storage::get_daily_usage` /\n`get_weekly_usage` / `get_monthly_usage`.",
"enum": [
"day",
"week",
"month"
],
"type": "string"
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"limit": {
"description": "Row cap; defaults match the HTTP route's own per-period defaults (30 / 20 / 12).",
"format": "uint",
"minimum": 0,
"type": [
"integer",
"null"
]
},
"period": {
"$ref": "#/$defs/UsagePeriodParam"
}
},
"required": [
"period"
],
"type": "object"
}window_show
Rolling burn-rate window (default 5 hours): tokens/hour, active adapters and models, estimated cost, and cache hit ratio -- the same window /api/pacing computes. Answers "what am I burning right now".
| Param | Required | Type | Description |
|---|---|---|---|
hours | no | integer or null | Rolling window size in hours; defaults to 5. |
JSON schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"hours": {
"description": "Rolling window size in hours; defaults to 5.",
"format": "int64",
"type": [
"integer",
"null"
]
}
},
"type": "object"
}