Reference

Every command, route, and tool -- read straight from the code.

Generated by agentworth docs --write from v0.1.30, October 20, 2026. CI regenerates it on every change and fails the build if this page would disagree with the binary -- so nothing here is hand-typed prose. Also available as plain markdown and inlined in llms-full.txt.

CLI

Global flags

Accepted before the subcommand on every command below.

FlagRequiredHelpDefaultValues
--verbose, -vnoEnable verbose debug loggingfalse-
--db-pathnoCustom path for the local SQLite index database--
--no-jsonnoForce text output even if persisted config defaults to JSON (see `archie config`)false-
--no-colornoDisable colour. NO_COLOR in the environment does the same thingfalse-
--plainnoNo colour and ASCII-only glyphs, at identical column positionsfalse-

archie scan

Scan and index agent histories from the local system

FlagRequiredHelpDefaultValues
PATHSnoOptional session paths or directories to scan; omit to also refresh global human-turn history--
--force, -fnoForce rescanning and re-indexing of unchanged source filesfalse-
--include-stubsnoKeep storing/pruning near-empty stub sessions instead of filtering them outfalse-
--jsonnoOutput scan results as formatted JSONfalse-

archie stats

Machine-wide summary statistics. `stats usage` rolls spend up by period; `stats outcomes` reports the verified-outcome rate

FlagRequiredHelpDefaultValues
--jsonnoOutput summary statistics as formatted JSONfalse-

archie stats usage

Deep usage, pacing, and token expenditure rollups

FlagRequiredHelpDefaultValues
--period, -pnoRollup 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`--
--pacingnoShow 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-
--hoursnoPacing window duration in hours5-
--alert-abovenoAlert and highlight if window spend exceeds this threshold in USD--
--limit, -lnoMaximum 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--
--bynoGroup the rollup by adapter (default; most informative when nearly every session shares one adapter, e.g. Claude Code), model (usually the useful one), or repoadapteradapter, model, repo
--sincenoOnly 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`)--
--jsonnoOutput usage data as JSONfalse-

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

FlagRequiredHelpDefaultValues
--bynoGroup the rate by model (default), adapter, or repomodelmodel, adapter, repo
--min-nnoSuppress groups with fewer than this many sessions (default 20)--
--sincenoOnly sessions started at or after this time: an absolute date (`2026-08-01` or RFC 3339), or a relative shorthand (`1d`, `7d`, `2w`, `3m`)--
--untilnoOnly sessions started before this time, same formats as `--since`--
--include-stubsnoInclude 1-event session stubs in the populationfalse-
--jsonnoOutput as formatted JSONfalse-

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

FlagRequiredHelpDefaultValues
--period, -pnoHow 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--
--bynoGroup 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 cannotmodelmodel, repo, adapter, effort
--reponoFilter by repository or workspace substring (e.g. unfoundbox/agentworth)--
--adapter, -anoFilter by adapter name (e.g. claude_code, codex, gemini, opencode)--
--model, -mnoFilter by model substring (e.g. sonnet, gpt-4o, gemini-2.5)--
--min-nnoBlank a group's rate and cost below this many claimed sessions (default 20, the same floor `stats outcomes` applies)--
--include-stubsnoInclude 1-event session stubs in the populationfalse-
--jsonnoOutput all three blocks as formatted JSONfalse-

archie session

Everything that acts on sessions: list them, read one, hand one over

archie session list

List indexed sessions with optional filtering

FlagRequiredHelpDefaultValues
--limit, -lnoMaximum number of sessions to display (default 20, or persisted `config limit`)--
--adapter, -anoFilter by adapter name (e.g. claude_code, codex, gemini, opencode)--
--model, -mnoFilter by model substring (e.g. sonnet, gpt-4o, gemini-2.5)--
--all-stubsnoInclude 1-event session stubs in the listingfalse-
--kindnoWhich 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
--unprovennoOnly sessions whose completion claims were never independently corroborated by tests or CI -- the blind spotsfalse-
--jsonnoOutput as formatted JSONfalse-

archie session show

Read one session in detail, with its timeline

FlagRequiredHelpDefaultValues
SESSION_IDnoThe 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`--
--lastnoThe newest session for this directory's repository. The default when no ID is given and stdout is not a TTYfalse-
--currentnoAlias of `--last`false-
--jsonnoOutput raw trace structure as formatted JSONfalse-

archie session export

Export one session safely, in JSON or ATIF format

FlagRequiredHelpDefaultValues
SESSION_IDnoThe 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`--
--lastnoExport the newest session for this directory's repository. The default when no ID is given and stdout is not a TTYfalse-
--currentnoAlias of `--last`false-
--redact, -rnoApply redaction to mask secrets, API keys, tokens, emails, and home pathsfalse-
--format, -fnoExport format: json (default), atif, receipt, or svgjsonjson, atif, receipt, terminal, ansi, svg
--output, -onoOptional file path to write export output to (defaults to stdout)--

archie session receipt

Render one session's Flight Receipt, as ANSI or SVG

FlagRequiredHelpDefaultValues
SESSION_IDnoThe 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`--
--lastnoRender the newest session for this directory's repository. The default when no ID is given and stdout is not a TTYfalse-
--currentnoAlias of `--last`false-
--format, -fnoOutput format: terminal (default), ansi, svg, receipt, or jsonterminalterminal, ansi, svg, receipt, json
--output, -onoOptional 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

FlagRequiredHelpDefaultValues
SESSION_IDnoSession 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`--
--lastnoHand over the newest session for this repository. The default when no ID is given and stdout is not a TTYfalse-
--currentnoAlias of `--last`false-
--redact, -rnoMask secrets, paths, and this session's own repository name before printingfalse-
--markdownnoEmit the same markdown the `session_handoff` MCP tool returnsfalse-
--max-linesnoLine budget for `--markdown` (default 60, ceiling 120)--
--jsonnoOutput the structured handoff as JSONfalse-

archie session wake

What you were doing: the checkout, the newest session's task, proof, loose ends, and the next step, in 30 lines

FlagRequiredHelpDefaultValues
--workspacenoDirectory to read the checkout from and to derive the repo from. Defaults to the current directory--
--reponoRepository/workspace key, as `session handoff`'s receipt reports it. Defaults to the key derived from `--workspace`--
--redact, -rnoMask secrets, paths, and this session's own repository name before printingfalse-
--jsonnoOutput the wake report as JSONfalse-
--injectnoRead 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

FlagRequiredHelpDefaultValues
SESSION_IDnoSession 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`)--
--lastnoDiff the newest session for this directory's repository. The default when no ID is given and stdout is not a TTYfalse-
--currentnoAlias of `--last`false-
--roundnoOne 1-based compaction round. Defaults to every round--
--classnoAny of decision, rejected, reason. Repeatable. Defaults to all three--
--limitnoHow many statements to return, newest first (default 20, ceiling 200)--
--redact, -rnoMask secrets, paths, and this session's own repository name before printingfalse-
--jsonnoOutput the structured diff as JSONfalse-

archie session loose-ends

The handoff's loose-ends section alone: what a session said it would do and did not

FlagRequiredHelpDefaultValues
SESSION_IDnoSession 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`--
--lastnoCheck the newest session for this repository. The default when no ID is given and stdout is not a TTYfalse-
--currentnoAlias of `--last`false-
--redact, -rnoMask secrets, paths, and this session's own repository name before printingfalse-
--promptnoPrint the copyable prompt to hand to an agent that has the repository openfalse-
--jsonnoOutput the loose ends as JSONfalse-

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

FlagRequiredHelpDefaultValues
SESSION_IDnoSession 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`--
--sessionnoThe same session, named with a flag. Kept because `archie session asks --session <id>` is the spelling that shipped in #97--
--lastnoResolve the newest session for this directory's repository, falling back to the newest session anywherefalse-
--currentnoAlias of `--last`false-
--sincenoOnly questions asked at or after this time: RFC 3339, `YYYY-MM-DD`, or a relative duration like `2h`, `30m`, `1d`, `3w`--
--unanswerednoOnly questions that are not `answered` -- still open, or flagged back to youfalse-
--jsonnoOutput the structured index as JSONfalse-

archie session cache

Diagnose turn-by-turn prompt caching dynamics and identify cache drop root causes

FlagRequiredHelpDefaultValues
SESSION_IDnoThe 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`--
--lastnoThe newest session for this directory's repository. The default when no ID is given and stdout is not a TTYfalse-
--currentnoAlias of `--last`false-
--jsonnoOutput findings as formatted JSONfalse-

archie session bisect

Pinpoint the exact turning point where a session's trajectory turned negative

FlagRequiredHelpDefaultValues
SESSION_IDnoThe 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`--
--lastnoThe newest session for this directory's repository. The default when no ID is given and stdout is not a TTYfalse-
--currentnoAlias of `--last`false-
--jsonnoOutput findings as formatted JSONfalse-

archie session recall

Semantically recall past solutions joined with outcome validation and cost

FlagRequiredHelpDefaultValues
QUERYyesSearch query to match against previous trajectories--
--limit, -lnoMaximum number of results to return (default 5, or persisted `config limit`)--
--min-scorenoMinimum similarity score threshold (0.0 to 1.0)0-
--jsonnoOutput results as JSONfalse-

archie session audit

Safety and threat audit detecting forbidden commands, leaked variables, sweeps, and fake claims, machine-wide over every session

FlagRequiredHelpDefaultValues
--safetynoRestrict audit to safety and threat vectors onlyfalse-
--jsonnoOutput audit results as formatted JSONfalse-

archie session blunder

Discover top agent blunders, render thermal receipts, and export to the Hall of Blunders

FlagRequiredHelpDefaultValues
--top, -tnoNumber of top blunder exhibits to retrieve and display (default: 5)5-
--submit, -snoSubmit redacted blunder receipts to the public Hall of Blunders at stfuopus.lolfalse-
--dry-runnoPrint the exact redacted payload a submission would POST, and send nothing. Read this before you ever pass --submitfalse-
--jsonnoOutput blunder exhibits as formatted JSONfalse-

archie session autopsy

Surface recurring human correction and steering phrases across all sessions

FlagRequiredHelpDefaultValues
--min-occurrences, -mnoMinimum number of occurrences across sessions to report (default: 2)2-
--jsonnoOutput results as JSONfalse-

archie session watch

Watch active session transcripts and detect doom loops or file edit thrashing

FlagRequiredHelpDefaultValues
--interval-secs, -inoPolling interval in seconds (default: 3)3-
--poll-oncenoRun a single poll check and exit immediatelyfalse-
--jsonnoOutput findings as formatted JSONfalse-
--paths, -pnoCustom path directories to monitor--

archie session risk

Rank indexed sessions by real secret/credential exposure risk, by category and severity

FlagRequiredHelpDefaultValues
--limit, -lnoMaximum 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-severitynoOnly include sessions whose worst finding is at least this severitylowlow, medium, high, critical
--jsonnoOutput results as JSONfalse-

archie session drift

What moved under this session since it read it, and which session moved it

FlagRequiredHelpDefaultValues
SESSION_IDnoThe session, by full id or a unique prefix. Defaults to the most recently active one--
--lastnoThe most recently active session, which is also the defaultfalse-
--jsonnoOutput as formatted JSONfalse-

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

FlagRequiredHelpDefaultValues
SESSION_IDnoThe session, by full id or a unique prefix. Defaults to the most recently active one--
--lastnoThe most recently active session, which is also the defaultfalse-
--jsonnoOutput as formatted JSONfalse-

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

FlagRequiredHelpDefaultValues
SESSION_IDnoThe session, by full id or a unique prefix. Defaults to the most recently active one--
--lastnoThe most recently active session, which is also the defaultfalse-
--jsonnoOutput as formatted JSONfalse-

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

FlagRequiredHelpDefaultValues
--jsonnoOutput the coverage matrix as formatted JSONfalse-

archie agent show

One adapter in detail: what it extracts, whether it is present here, and what it has actually put in the index

FlagRequiredHelpDefaultValues
ADAPTERyesAdapter name (e.g. claude_code, codex, gemini, opencode)--
--jsonnoOutput as formatted JSONfalse-

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

FlagRequiredHelpDefaultValues
--jsonnoOutput as formatted JSONfalse-

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

FlagRequiredHelpDefaultValues
--limit, -lnoMaximum number of repositories to display (default 20, or persisted `config limit`)--
--jsonnoOutput as formatted JSONfalse-

archie repo blame

Trace file modifications back to the session, model, and prompt that authored them

FlagRequiredHelpDefaultValues
FILE_PATHyesTarget file path or pattern to search--
--jsonnoOutput results as JSONfalse-

archie repo pr-blame

Annotate changed PR files with AI agent authoring provenance and outcome validation

FlagRequiredHelpDefaultValues
FILESnoList of files to check (if omitted, infers from git diff)--
--jsonnoOutput results as JSONfalse-

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

FlagRequiredHelpDefaultValues
--reponoPath to a git checkout. Defaults to the current directory--
--sincenoA date (RFC 3339 or YYYY-MM-DD) or a git ref to measure from. Defaults to the branch's upstream, then origin/main--
--branchnoBranch to walk. Defaults to HEAD--
--basenoRef to diff against, if you want to name it separately from --since--
--window-hoursnoHow long before a commit a session's file touch still counts as authoring it--
--hooknoPrint a ready-to-install pre-push hook and exit. The hook never blocks a pushfalse-
--quietnoPrint only the copyable prompt, and only when something is suspect. What the hook runsfalse-
--jsonnoOutput the full report as JSONfalse-

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

FlagRequiredHelpDefaultValues
--filenoBlame -> blunder direction: file path or pattern. Checks every session AI Code Blame attributes this file to for a recorded blunder--
--sessionnoBlunder -> 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--
--lastnoBlunder -> blame direction for the newest session in this repository, same as `--session` with that session's IDfalse-
--currentnoAlias of `--last`false-
--top, -tnoIn default mode (no --file or --session), number of top blunders to bridge5-
--jsonnoOutput results as JSONfalse-

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

FlagRequiredHelpDefaultValues
--reponoPath to a git checkout. Defaults to the current directory--
--writenoWrite the workflow and hook, create the key, and record consentfalse-
--jsonnoOutput as JSONfalse-

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

FlagRequiredHelpDefaultValues
--reponoPath to a git checkout. Defaults to the current directory--
--basenoRef to cover commits since. Defaults to the branch's upstream, then origin/main--
--pushnoPush refs/notes/agentworth after writing the note (what the pre-push hook runs)false-
--remotenoRemote to push the notes ref to. Defaults to origin--
--transportnoWhere the receipt goesnotesnotes, file
--include-spendnoInclude API-equivalent spend (micro-USD). Off by default: receipts carry tokens onlyfalse-
--jsonnoOutput the result, and the receipt itself, as JSON. Never promptsfalse-
--quietnoOne line on stderr, never a prompt, never a failure. What the hook runsfalse-

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

FlagRequiredHelpDefaultValues
RECEIPT_ID_OR_SHAyesA receipt id (or a prefix of one, 4+ hex characters) or a commit--
--reponoPath to a git checkout. Defaults to the current directory--
--jsonnoOutput as JSONfalse-

archie repo receipt key

Print the receipt public key; --github prints the `gh ssh-key add --type signing` line

FlagRequiredHelpDefaultValues
--githubnoPrint 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-
--jsonnoOutput as JSONfalse-

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

FlagRequiredHelpDefaultValues
--baseyesBase of the PR range (a commit or ref)--
--headyesHead of the PR range (a commit or ref)--
--cinoCheck runs and statuses on the head SHA, as collected with `gh api`--
--keysnoGitHub signing keys of the PR and commit authors, as collected with `gh api`--
--receiptnoAn extra receipt file to read, beyond notes and .agentworth/receipts/ (repeatable)--
--fail-onnoOpt-in failure: invalid-signature, below-rung:N, unattributed (comma-separated)--
--formatnoOutput formatmdmd, check-json
--reponoPath 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

FlagRequiredHelpDefaultValues
--hoursnoWindow duration in hours5-
--alert-abovenoAlert and highlight if window spend exceeds this threshold in USD--
--jsonnoOutput as formatted JSONfalse-

archie window list

The recent rolling windows, newest first

FlagRequiredHelpDefaultValues
--hoursnoWindow duration in hours5-
--limit, -lnoHow many consecutive windows to show, newest first (default 6)--
--jsonnoOutput as formatted JSONfalse-

archie serve

Start the local API server and interactive explorer UI

FlagRequiredHelpDefaultValues
--port, -pnoPort to bind the server to3000-
--opennoAutomatically open the Web UI in the default browserfalse-
--distnoOptional path to custom web frontend dist directory--
--no-socketnoDo 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-
--homenoStart 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

FlagRequiredHelpDefaultValues
--gatenoAnswer the harness synchronously instead of recording and returning: one socket round trip inside 50 ms, and exit 0 with nothing on stdout if it missesfalse-

archie hook print

Print the hook registration snippet for a harness. Never writes a settings file

FlagRequiredHelpDefaultValues
HARNESSyesThe 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
--governnoAlso 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 hookfalse-

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

FlagRequiredHelpDefaultValues
--reponoWrite `.agentworth/policy.toml` in the current repo instead of `~/.agentworth/policy.toml`false-
--forcenoOverwrite an existing filefalse-

archie policy show

What is governed right now, and which files were read to decide that

FlagRequiredHelpDefaultValues
--jsonnoOutput as formatted JSONfalse-

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

FlagRequiredHelpDefaultValues
SESSIONyesThe session to lift, by full id--

archie policy replay

What the current thresholds would have done to the sessions already indexed

FlagRequiredHelpDefaultValues
--sincenoHow far back to replay, in days30d-
--jsonnoOutput as formatted JSONfalse-

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)

FlagRequiredHelpDefaultValues
--jsonnoOutput the full insights payload as formatted JSONfalse-
--sincenoWindow start (UTC RFC3339); inclusive--
--untilnoWindow end (same format); exclusive. Defaults to the index's newest usable session--
--adapternoSingle-select equality filter; valid values list under --json (insights.facets)--
--modelnoFilter by a recorded per-session model usage row--
--reponoFilter 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)

FlagRequiredHelpDefaultValues
--forcenoRe-parse every turn source regardless of fingerprints (dedup keeps stored rows stable)false-
--jsonnoOutput the ingest summary as JSONfalse-

archie doctor

Check local environment, adapter discoveries, and SQLite database health

FlagRequiredHelpDefaultValues
--jsonnoOutput diagnostic report as formatted JSONfalse-
--self-testnoRun 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 failsfalse-

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

FlagRequiredHelpDefaultValues
--formatnoOutput format when printing to stdout (ignored with --write, which always writes both forms)markdownmarkdown, json
--writenoWrite docs/REFERENCE.md and docs/reference.json (relative to the current directory, which must be the repository root) instead of printing to stdoutfalse-

archie config

Get, set, or list persisted CLI defaults (~/.agentworth/config.toml)

archie config list

List every persisted config key and its current value

FlagRequiredHelpDefaultValues
--jsonnoOutput as JSONfalse-

archie config get

Print the persisted value for one config key

FlagRequiredHelpDefaultValues
KEYyesConfig key: json, limit, period, archie.accessory, or archie.colourway--
--jsonnoOutput as JSONfalse-

archie config set

Persist a default value for one config key

FlagRequiredHelpDefaultValues
KEYyesConfig key: json, limit, period, archie.accessory, or archie.colourway--
VALUEyesValue to store (json: true/false, limit: a number, period: day/week/month, archie.accessory: lamp/goggles/none, archie.colourway: C1/C2/C3/C4)--
--jsonnoOutput as JSONfalse-

archie version

Print version details: binary version, npm install detection, and a live check for a newer release

FlagRequiredHelpDefaultValues
--offlinenoSkip the live GitHub-releases update check (fully local, no network call)false-
--jsonnoOutput as formatted JSONfalse-

archie update

Check for a newer AgentWorth release and show exactly how to get it

FlagRequiredHelpDefaultValues
--offlinenoSkip the live GitHub-releases check and just show install-method guidancefalse-
--jsonnoOutput as formatted JSONfalse-

archie completions

Write a shell completion script to stdout

FlagRequiredHelpDefaultValues
SHELLyesShell to generate a completion script for-bash, elvish, fish, powershell, zsh

archie merge

Merge another local SQLite index database into this index

FlagRequiredHelpDefaultValues
SOURCE_DByesPath to the source SQLite database file to merge from--
--jsonnoOutput results as JSONfalse-

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

FlagRequiredHelpDefaultValues
--jsonnoPrint the overview as JSON and exit, without opening anythingfalse-

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 ParamDescription
adapterFilter by adapter name
modelFilter by model substring
searchFull-text search across session content
outcomeFilter by primary outcome kind
min_tokensMinimum total token count
limitMaximum number of sessions to return (default 50)
offsetNumber of sessions to skip
order_bySort order for the result list

GET /api/traces/:id

Full trace details: metadata, stats, 5-factor score, outcome evidence, timeline

Query ParamDescription
offsetNumber of events to skip (default 0)
limitMaximum number of events to return (default: all)

GET /api/traces/:id/events

Just the paginated event slice for one trace

Query ParamDescription
offsetNumber of events to skip (default 0)
limitMaximum number of events to return (default: all)

GET /api/usage

Daily, weekly, and monthly token usage rollups

Query ParamDescription
daily_limitMaximum number of daily rollup rows
weekly_limitMaximum number of weekly rollup rows
monthly_limitMaximum number of monthly rollup rows

GET /api/pacing

Rolling pacing window: burn velocity and cache hit ratio

Query ParamDescription
hoursPacing window duration in hours (default 5)

GET /api/blame

File change lineage matching session histories

Query ParamDescription
fileTarget file path or pattern
pathAlias 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 ParamDescription
sincewindow start (UTC RFC3339, inclusive)
untilwindow end (exclusive; requires since)
adaptersingle-select equality slice; values validated against the payload's facets
modelsingle-select model equality over recorded per-session usage
reposingle-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 ParamDescription
viewladder | day_hour | friction
keyrung outcome | <dow>-<hour> | trigger
sincewindow start (UTC RFC3339, inclusive)
untilwindow end (exclusive; requires since)
adaptersingle-select equality slice
modelsingle-select model equality
reposingle-select display-repo equality
limitrows 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.

ParamRequiredTypeDescription
include_matrixnobooleanAlso 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.

ParamRequiredTypeDescription
adapternostring or nullExact adapter match (e.g. `claude_code`); valid values in the payload's facets.
modelnostring or nullExact model match over recorded per-session model usage. Optional.
reponostring or nullExact display-repo match over session source paths. Optional.
sincenostring or nullRFC 3339 timestamp; only sessions (and stored human turns) starting at or after this instant. Optional; omit for all-time.
untilnostring or nullRFC 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.

ParamRequiredTypeDescription
adapternostring or nullExact adapter match (e.g. `claude_code`); valid values in the payload's facets.
modelnostring or nullExact model match over recorded per-session model usage. Optional.
reponostring or nullExact display-repo match over session source paths. Optional.
sincenostring or nullRFC 3339 timestamp; only sessions (and stored human turns) starting at or after this instant. Optional; omit for all-time.
untilnostring or nullRFC 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.

ParamRequiredTypeDescription
file_pathyesstringSubstring 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.

ParamRequiredTypeDescription
basenostring or nullRef 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.
branchnostring or nullBranch to walk. Defaults to `HEAD`.
include_spendnoboolean or nullPut API-equivalent spend (micro-USD) in the preview, as `create --include-spend` would. Defaults to false: receipts carry tokens only.
max_commitsnointeger or nullCeiling on commits walked. Defaults to 200, hard-capped at 1000.
repoyesstringAbsolute path to a git checkout on this machine. Anything inside it works — the repository root is resolved with `git rev-parse --show-toplevel`.
sincenostring or nullRFC 3339 timestamp. Only consulted when `base` is absent.
window_hoursnointeger or nullHow 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.

ParamRequiredTypeDescription
basenostring or nullRef to diff against. Defaults to the branch's own upstream, then `origin/main`, then `origin/master`, then the most recent `max_commits` commits.
branchnostring or nullBranch to walk. Defaults to `HEAD`.
max_commitsnointeger or nullCeiling on commits walked. Defaults to 200, hard-capped at 1000.
repoyesstringAbsolute path to a git checkout on this machine. Anything inside it works — the repository root is resolved with `git rev-parse --show-toplevel`.
sincenostring or nullRFC 3339 timestamp. Only consulted when `base` is absent.
window_hoursnointeger or nullHow 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.

ParamRequiredTypeDescription
include_rawnobooleanReturn 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").
limitnointeger or nullHow 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_idnostring or nullSession to index. Defaults to the most recent indexed session for the repository this server process is running in, same default `session_handoff` uses.
sincenostring or nullRFC 3339 timestamp; only questions asked at or after this instant.
unanswered_onlynobooleanOnly 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.

ParamRequiredTypeDescription
session_idnostring or nullThe 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.

ParamRequiredTypeDescription
include_rawnobooleanSame per-call raw opt-in `session_handoff` has, applied to every handoff returned.
include_subagentsnobooleanInclude 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_linesnointeger or nullLine budget for each rendered handoff. Defaults to 60, hard ceiling 120.
nnointeger or nullHow many handoffs to return, newest first. Defaults to 3, ceiling 10.
repoyesstringRepository/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.
sincenostring or nullRFC 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.

ParamRequiredTypeDescription
session_idnostring or nullThe 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.

ParamRequiredTypeDescription
classesnoarray or nullAny of `decision`, `rejected`, `reason`. Defaults to all three. An unknown name is an error, not an ignored filter.
include_rawnobooleanReturn 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").
limitnointeger or nullHow many statements to return, newest first. Defaults to 20, hard ceiling 200. The totals in the response describe the whole session regardless of this.
roundnointeger or nullOne 1-based compaction round. Defaults to every round.
session_idnostring or nullSession 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.

ParamRequiredTypeDescription
include_loose_endsnoboolean or nullInclude the "said it would, no evidence it did" section. Defaults to true.
include_rawnobooleanReturn 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_linesnointeger or nullLine budget for the rendered markdown. Defaults to 60, hard ceiling 120.
session_idnostring or nullSession 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.

ParamRequiredTypeDescription
adapternostring or nullExact adapter name match (e.g. `claude_code`, `codex`, `gemini`).
end_datenostring or nullRFC 3339 timestamp; only sessions started at or before this instant.
include_stubsnoboolean or nullInclude near-empty session stubs (defaults to excluding them).
limityesintegerMaximum rows to return. Required -- there is no silent default -- and capped at `SESSIONS_FIND_LIMIT_CEILING` (200).
min_tokensnointeger or nullOnly sessions with at least this many total tokens.
modelnostring or nullSubstring match against the session's recorded models.
offsetnointeger or null-
order_byno-Sort order; defaults to `started_at_desc`.
outcomenostring or nullExact match against the stored primary outcome, snake_case (e.g. `commit_observed`).
reponostring or nullFilter 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).
searchnostring or nullSubstring match across session ID, source path, models, and adapter.
start_datenostring or nullRFC 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.

ParamRequiredTypeDescription
events_limitnointeger or nullMax 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_offsetnointeger or nullZero-based offset into the trace's events. Defaults to 0.
include_rawnobooleanReturn 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_idyesstring-
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.

ParamRequiredTypeDescription
include_rawnobooleanReturn 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").
reponostring or nullRepository/workspace key, as `session_list`'s `repo` and `session_carry_forward` take it (e.g. `unfoundbox/agentworth`). Defaults to the key derived from `workspace`.
workspacenostring or nullDirectory 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.

ParamRequiredTypeDescription
adapternostring or nullExact adapter name (`claude_code`, `codex`, `opencode`, ...).
bynoobjectAxis for the cost-per-verified-outcome table. Defaults to `model`.
include_stubsnoboolean or nullInclude near-empty session stubs in the population. Defaults to false.
min_nnointeger or nullA 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.
modelnostring or nullModel substring (`sonnet`, `gpt-4o`, ...).
periodnostring or nullLookback window: `day`, `week`, `month`, `year` or `all`. Defaults to `month` (30 days). This is how far back the window reaches, not a rollup granularity.
reponostring or nullRepository 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.

ParamRequiredTypeDescription
group_byyesobject-
include_stubsnoboolean or nullInclude near-empty session stubs in the population. Defaults to false.
min_nnointeger or nullGroups with fewer than this many claimed sessions are suppressed (counted in `suppressed_groups`) rather than returned as a row. Defaults to 20.
sincenostring or nullRFC 3339 timestamp; only sessions started at or after this instant.
untilnostring or nullRFC 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.

ParamRequiredTypeDescription
limitnointeger or nullRow cap; defaults match the HTTP route's own per-period defaults (30 / 20 / 12).
periodyesobject-
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".

ParamRequiredTypeDescription
hoursnointeger or nullRolling 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"
}

Point it at your own machine.

npx -y agentworth@latest scan