Reference

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

Generated by agentworth docs --write from v0.1.14, September 2, 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 `agentworth config`)false-
--no-colornoDisable colour. NO_COLOR in the environment does the same thingfalse-
--plainnoNo colour and ASCII-only glyphs, at identical column positionsfalse-

agentworth scan

Scan and index agent histories from the local system

FlagRequiredHelpDefaultValues
PATHSnoOptional specific paths or directories to scan--
--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-

agentworth stats

Show machine-wide summary statistics of indexed traces

FlagRequiredHelpDefaultValues
--jsonnoOutput summary statistics as formatted JSONfalse-

agentworth traces

List indexed traces with optional filtering

FlagRequiredHelpDefaultValues
--limit, -lnoMaximum number of traces 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-
--jsonnoOutput traces as formatted JSONfalse-

agentworth matrix

Display extraction capabilities and coverage matrix across all 20 agent adapters

FlagRequiredHelpDefaultValues
--jsonnoOutput matrix as formatted JSONfalse-

agentworth inspect

Inspect a specific trace session in detail with timeline visualization

FlagRequiredHelpDefaultValues
SESSION_IDyesThe session ID to inspect--
--jsonnoOutput raw trace structure as formatted JSONfalse-

agentworth export

Export a trace session safely in JSON or ATIF format

FlagRequiredHelpDefaultValues
SESSION_IDyesThe session ID to export--
--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)--

agentworth receipt

Generate and render an authentic ANSI or SVG Flight Receipt for a trace session

FlagRequiredHelpDefaultValues
SESSION_IDyesThe session ID to generate flight receipt for--
--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)--

agentworth audit

Safety and threat audit detecting forbidden commands, leaked variables, sweeps, and fake claims

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

agentworth 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-
--jsonnoOutput blunder exhibits as formatted JSONfalse-

agentworth 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--

agentworth 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 -- agentworth mcp`

agentworth usage

View deep usage, pacing, and token expenditure rollups

FlagRequiredHelpDefaultValues
--period, -pnoRollup period: day, week, or month (default day, or persisted `config period`)-day, week, month
--pacingnoShow 5-hour rolling pacing window (burn rate, active models, quota headroom)false-
--hoursnoPacing window duration in hours5-
--alert-abovenoAlert and highlight if window spend exceeds this threshold in USD--
--limit, -lnoMaximum number of rows to display (default 20, or persisted `config limit`)--
--by-modelnoGroup the rollup by model instead of adapter (e.g. how many tokens each of claude-opus-5 / claude-sonnet-5 / claude-fable-5 used)false-
--jsonnoOutput usage data as JSONfalse-

agentworth blame

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

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

agentworth handoff

Hand a session over: what it promised and dropped, decided, changed, ran, and proved

FlagRequiredHelpDefaultValues
SESSION_IDnoSession to hand over. Defaults to the newest session indexed for this directory's repository, which is what `--last` also selects--
--lastnoHand over the newest session for this repository. The default when no ID is givenfalse-
--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-

agentworth 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. Defaults to the newest session indexed for this directory's repository--
--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-

agentworth 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
--sessionnoSession to index, by full ID, a unique prefix, or a raw JSONL file path (parsed directly if it isn't an indexed session). Defaults to the newest session for this directory's repository, same as `--current`--
--currentnoResolve the newest session for this directory's repository. The default when `--session` is not given -- this flag exists so an invocation can say that on purposefalse-
--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-

agentworth loose-ends

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

FlagRequiredHelpDefaultValues
SESSION_IDnoSession to check. Defaults to the newest session for this directory's repository--
--lastnoCheck the newest session for this repository. The default when no ID is givenfalse-
--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-

agentworth doctor

Check local environment, adapter discoveries, and SQLite database health

FlagRequiredHelpDefaultValues
--jsonnoOutput diagnostic report as formatted JSONfalse-

agentworth 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-

agentworth 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-

agentworth 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-

agentworth 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--

agentworth cache-doctor

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

FlagRequiredHelpDefaultValues
SESSION_IDyesTarget session ID to inspect--
--jsonnoOutput findings as formatted JSONfalse-

agentworth blind-spots

List sessions whose completion claims were never independently corroborated by tests or CI

FlagRequiredHelpDefaultValues
--limit, -lnoMaximum number of sessions to list (default 20, or persisted `config limit`)--
--jsonnoOutput results as JSONfalse-

agentworth threat-digest

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-

agentworth 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-

agentworth 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-

agentworth bisect

Pinpoint the exact turning point where an agent session trajectory turned negative

FlagRequiredHelpDefaultValues
SESSION_IDyesSession ID to bisect--
--jsonnoOutput results as JSONfalse-

agentworth 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-

agentworth 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. Resolves it to the files AI Code Blame attributes to that session--
--top, -tnoIn default mode (no --file or --session), number of top blunders to bridge5-
--jsonnoOutput results as JSONfalse-

agentworth 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-

agentworth config

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

agentworth config list

List every persisted config key and its current value

FlagRequiredHelpDefaultValues
--jsonnoOutput as JSONfalse-

agentworth config get

Print the persisted value for one config key

FlagRequiredHelpDefaultValues
KEYyesConfig key: json, limit, or period--
--jsonnoOutput as JSONfalse-

agentworth config set

Persist a default value for one config key

FlagRequiredHelpDefaultValues
KEYyesConfig key: json, limit, or period--
VALUEyesValue to store (json: true/false, limit: a number, period: day/week/month)--
--jsonnoOutput as JSONfalse-

agentworth 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-

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

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.

blame_find

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"
}

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. Redacted by default.

ParamRequiredTypeDescription
include_rawnobooleanSame per-call raw opt-in `session_handoff` has, applied to every handoff returned.
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 `sessions_find`'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"
    },
    "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 `sessions_find`'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"
}

coverage_stats

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"
}

forgotten_context

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"
}

outcome_rate

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"
}

pacing_window

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"
}

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 `forgotten_context` 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_get

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_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"
}

sessions_find

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"
}

suspect_commits

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"
}

usage_summary

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.

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 `usage_summary` 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"
}

Point it at your own machine.

npx -y agentworth scan