Skip to main content
Glama

trw-mcp

Give your coding agent a memory that carries over from one session to the next.

Python 3.11+ License: BSL 1.1 MCP Docs

trw-mcp is a local MCP server for the coding agent you already use. Your agent writes down what it learns in a repository (patterns, gotchas, decisions) and gets the relevant pieces back when the next session starts. It also keeps run state and delivery checks, so work can be picked up where it stopped. One installer sets it up for Claude Code, Codex, Cursor, GitHub Copilot CLI, OpenCode, Antigravity CLI and Grok Build CLI.

Local-first · MCP-native · source-available (BSL 1.1)

Quick start · What's new in 9.x · Upgrading · Tools · Configuration · Network and security · Troubleshooting

Why TRW

A new coding-agent session usually starts without what the last one learned. It rediscovers the same repository quirks, retries the approach that failed last week, and asks again why a file is laid out the way it is.

With trw-mcp, the agent records short learnings as it works, gets up to three relevant ones back at the start of the next session, and can search for more. Checkpoints let a later session, or a different agent, resume a run. Your learnings and run state stay on your machine: learnings in one local store, run state in each project's .trw/ directory.

What sets it apart:

  • More than memory. Recall, run state, build evidence, delivery checks and requirements tracing come from one server.

  • One setup for many clients. The same install configures instructions, hooks, skills and agents for each supported client.

  • Local by design. Memory lives in SQLite on your machine and runs without a cloud service.

Related MCP server: myBrAIn

What you get

  • Memory across sessions. trw_learn records a learning; trw_session_start recalls once at session start and returns up to three short stubs; trw_recall searches on demand.

  • Hybrid recall. Every recall uses keyword search; vector search joins it when embeddings are installed, which the installer does by default.

  • One store for all your projects. A local memory daemon (from trw-memory) serves one store per user account; each checkout reads and writes its own namespace.

  • Resumable runs. Phases, checkpoints, events and delivery records live in the project's .trw/ directory.

  • Delivery checks. trw_build_check records the build and test results your agent ran (it runs nothing itself). By default trw_deliver refuses coding work with no passing build record.

  • Requirements workflow. Write AARE-F PRDs, validate them, and trace requirements to code.

  • Client setup. trw-mcp init-project writes each selected client's instruction file, MCP config, hooks, skills and agent definitions where that client supports them.

Quick start

Inside the git repository you want to set up, run:

curl -fsSL https://trwframework.com/install.sh | bash

Sign in or create a free account in the browser when asked, and the installer does the rest: it installs trw-mcp and trw-memory with semantic recall, caches the recall model, sets up the project for your client and brings over learnings from an older install.

Installer flags go after bash -s --, for example curl -fsSL https://trwframework.com/install.sh | bash -s -- --ide codex; --no-embeddings and --no-migrate work the same way. --allow-unauthenticated skips the account and installs the trw-mcp package only, without embeddings. What a signed-in install connects to is listed under Network and security.

Or install with pip (no account; migration and model caching are then up to you):

pip install trw-mcp 'trw-memory[embeddings]'   # drop the second package for keyword-only recall
cd /path/to/your/repo
trw-mcp init-project .                        # add --ide <id> to choose clients
trw-mcp doctor .                              # checks the install, clients and retrieval

Reconnect your MCP client afterwards (/mcp in Claude Code; restart the session elsewhere).

Supported clients (--ide id): Antigravity CLI (antigravity-cli), Claude Code (claude-code), Codex (codex), GitHub Copilot CLI (copilot), Cursor CLI (cursor-cli), Cursor IDE (cursor-ide), Grok Build CLI (grok) and OpenCode (opencode). --ide all sets up every client, which suits a repository shared across tools. Without --ide, init-project detects the client. Per-client details: trwframework.com/docs/clients.

Requirements: Python 3.11 to 3.14 and a git repository, on macOS (arm64, x86_64) or Linux with glibc (x86_64, aarch64). On Windows, run it inside WSL2, which works as Linux. Native Windows is not supported: the installer stops and points to WSL2. Alpine is not supported, because sqlite-vec publishes no musl wheel.

Alpha release: source-available under the Business Source License 1.1, free for any use except offering a competing commercial product, converting to Apache 2.0 on 2030-03-21. The API may still change.

What's new in 9.x

  • Recovery after compaction keeps what you recorded. A pre-compaction checkpoint keeps your run and message, and the PreCompact hook keeps its directive and anchor.

  • An installer that refuses before it fetches. No canary channel; an inherited non-stable TRW_CHANNEL is refused before anything downloads, and a failed check names its fix.

  • Learnings that know their commit. trw_learn records your checkout's commit on assertions that have none, so a checkout git shows to be behind holds the claim as unknown, not failed.

  • Answers about your project, wherever you run. Tools read your project's repository even when the server started elsewhere; telemetry channel-stats and handoff new now use the bound project too.

  • Dispatch setup in the installer. Turn on trw_dispatch and pin a model and effort per client while installing, or later with trw-mcp config dispatch.

  • trw-mcp config set and unset. Change or remove one setting safely: validated exactly as TRW loads it, secrets refused, and every other line of your file kept.

  • Handoffs another session can trust. The trw-handoff skill seals a record with labelled claims and constraints copied from their source; handoff check --strict accepts only positive evidence.

Requires Python 3.11+ and trw-memory 5.4.0. 9.0.0 was a breaking release: read the upgrade notes and the CHANGELOG first.

Upgrading

From 8.x to 9.0.0:

  1. Install trw-memory 5.2.0 first, then trw-mcp 9.0.0: pip install -U "trw-memory>=5.2,<6" and pip install -U "trw-mcp>=9,<10", then run trw-mcp update-project in each project and reconnect your MCP clients.

  2. The trw-prd-new compatibility skill is gone: use /trw-prd-ready, which takes a feature description or an existing PRD.

  3. Remove self_review_blocking from .trw/config.yaml if you set it; the key no longer exists.

  4. Turn on team_sync_enabled if you want recall to search your team's learnings on the platform: a recall query no longer leaves the machine without it. Team learnings you pull are still recalled locally either way.

From 7.x to 8.0.0:

  1. Use Python 3.11 or newer, then install trw-memory 5.0.0 first, then trw-mcp 8.0.0: pip install -U "trw-memory>=5,<6" and pip install -U "trw-mcp>=8,<9".

  2. Run trw-mcp update-project in each project. It writes AGENTS.md for Claude Code, removes a TRW-only CLAUDE.md, and refreshes every client's instructions.

  3. If you use formations, run trw-mcp formation comms-upgrade once per mailbox, from the formation's orchestrator session, to move it to schema v5.

  4. Stop the old memory daemon (manual in 8.0.0), then restart the MCP server. Upgrading does not restart the running 7.x daemon. Until you stop it, the first memory call is refused with daemon_version_mismatch ... The user should stop the old daemon (process <pid>) ... Agents must not stop or remove it themselves; report this to the user., and the refusal touches no data; trw-mcp doctor names the pid too. Stop that process (after checking it is python -m trw_memory.server), or delete a stale ~/.trw/memory/daemon.json, and the next memory call starts a 5.0.0 daemon. The memory store migrates to schema v13 on first open, after one automatic backup of a store that already holds entries. trw-mcp doctor should then show memory_daemon PASS at version 5.0.0.

Every breaking change, with its migration, is in the CHANGELOG.

From 6.x to 7.0.0:

  1. Upgrade both packages together. trw-mcp 7.0.0 needs a trw-memory 4.x memory daemon, and a 4.x daemon refuses a 3.x client by name.

    pip install -U "trw-mcp==7.0.0" "trw-memory[embeddings]==4.0.0"
  2. Restart the memory daemon. A running 3.x daemon keeps serving until it exits. Stop the pid in daemon.json in the user memory directory ($TRW_USER_DIR/memory, else $XDG_DATA_HOME/trw/memory, else ~/.trw/memory); the next memory call starts a 4.0.0 daemon.

  3. Fetch the models: trw-mcp models fetch. Runtime loads never download, and trw-memory 4.0.0 loads the embedding model at one pinned revision, so a cache filled by 3.x may not satisfy it.

  4. Refresh each project: trw-mcp update-project --ide <id> (or --ide all; --dry-run previews). It rewrites hooks, skills, agents and instruction files that named tools that no longer exist.

  5. Reconnect every MCP client (a client started before the upgrade keeps the old server), then run trw-mcp doctor. If its retrieval row counts stored vectors outside the active embedding space, run trw-mcp memory reembed --json and check that status is ok.

  6. Check your memory store. trw-memory releases before 4.0.0 could corrupt a store shared by two processes, and 2.0.0, 3.0.0 and 3.1.0 could lose a new store's first writes. Run sqlite3 <store> 'pragma integrity_check' on the user store (memory.db in the directory from step 2) and on any project store (<project>/.trw/memory/memory.db); output other than ok reports a problem, and trw-memory restore --from-snapshot latest --db <path> (with every process using the store stopped) rebuilds it. A memory.db.corrupt.*.bak file beside the store from its first use may hold lost learnings; open it read-only before deleting it.

install-trw.py --upgrade covers steps 1 and 3, and step 4 only when the deployed framework is out of date. It never stops the memory daemon.

Also carried from 7.0.0, if you are coming from 6.x (every change is in the CHANGELOG):

  • 51 tools became 15. Removed tools have no aliases: each is now a mode of a tool that stays, a trw-mcp command, or deleted. The CHANGELOG maps every name.

  • trw_dispatch needs dispatch_tools_exposed: true in .trw/config.yaml; there is no per-call grant any more.

  • One network switch. The old offline environment variable is gone: runtime model loads never download, and platform_contact_enabled: false turns off team sync.

  • Retired config keys log a warning (list); a profile that still sets allowed_tools_by_phase fails validation.

  • Rebuild the code index: run trw-mcp code index; the build deletes any legacy .trw/code-index/chunks.json itself.

How it works

  • Processes. Each MCP client starts its own trw-mcp process over stdio. Memory calls go to one local memory daemon per user account, which the first memory call starts and which exits when idle.

  • Where data lives. Run state and logs live in the project's .trw/; client files go where each client reads them. Learnings live in the daemon's store, ~/.trw/memory/memory.db (or under $TRW_USER_DIR or $XDG_DATA_HOME/trw when set), under the checkout's project_namespace, reached through the checkout's grant (.trw/runtime/memory-token).

  • Tool surface. The surface is flat: every session sees the kernel plus every capability pack whose config flag is on (comms_enabled, dispatch_tools_exposed, assess_enabled). See the resolved surface with trw_status(detail="surface") or the CLI trw-mcp profile explain [--json].

  • Lifecycle. TRW's method runs work through RESEARCH, PLAN, IMPLEMENT, VALIDATE, REVIEW and DELIVER, with exit checks between phases. The protocol is in FRAMEWORK.md and the lifecycle docs.

MCP tools, skills and agents

trw-mcp exposes 15 tools. The most used:

Area

Tools

Session and runs

trw_session_start, trw_init, trw_status, trw_checkpoint (heartbeat=True / pre_compact=True modes); CLI trw-mcp run adopt

Memory

trw_learn, trw_recall (incl. graph mode); CLI trw-mcp instructions sync

Verification and delivery

trw_build_check, trw_review, trw_deliver (its status: trw_status(delivery=...)); experimental CLI trw-mcp receipt verify records a receiver's intended-use check as a content-bound receipt (Alpha, off unless factory_enabled: true, refuses after 2026-12-27; trw-mcp factory status --run RUN is the read-only companion report)

Requirements

trw_prd_validate; CLI trw-mcp prd create / trw-mcp prd diff

Code intelligence

trw_code (mode="hint" default / "symbol"); CLI trw-mcp code index / trw-mcp code risk

Coordination (optional)

trw_send, trw_inbox, trw_dispatch

Surface and diagnostics

trw_status(detail="surface"); CLI trw-mcp profile explain [--json], trw-mcp telemetry events / trw-mcp telemetry security

Experimental, off by default

trw_assess

The tool reference covers the rest.

Skills (23 bundled). Workflows the agent loads only when invoked; the invocation syntax depends on the client. The ones you invoke directly:

  • Delivery: /trw-deliver, /trw-commit, /trw-reflect, /trw-handoff

  • Requirements: /trw-prd-ready

  • Review and quality: /trw-audit, /trw-self-review, /trw-security-check, /trw-test-strategy, /trw-dry-check, /trw-delegate, /trw-plan-review

  • Memory: /trw-learn, /trw-memory-audit, /trw-memory-optimize

  • Framework: /trw-ceremony-guide, /trw-framework-check, /trw-project-health, /trw-feedback

Agents (8 bundled). Optional role definitions for clients that support delegation: trw-lead, trw-implementer, trw-researcher, trw-reviewer, trw-auditor, trw-adversarial-auditor, trw-prd-groomer and trw-requirement-reviewer. TRW does not need multiple agents; the same lifecycle works in one session.

CLI

trw-mcp init-project .                # set up TRW in a project
trw-mcp update-project .              # refresh an existing installation
trw-mcp doctor .                      # check the environment, clients and retrieval
trw-mcp check-instructions .          # instruction-to-tool parity (exits 1 on mismatch)
trw-mcp audit .                       # audit the TRW configuration
trw-mcp config-reference              # list the TRW_ variables for config settings
trw-mcp version-status                # compare package, framework and live-server versions
trw-mcp memory migrate --to user      # preview moving an old checkout store (--apply to move)
trw-mcp memory token                  # mint this checkout's memory grant
trw-mcp export --scope learnings      # export learnings as JSON (--format csv also works)
trw-mcp uninstall .                   # remove TRW from a project; ~/.trw is kept

Names starting with trw- inside client folders (.claude, .cursor, .opencode, .github, .agents and the rest) are TRW's: give your own skills, rules and agents another name, so TRW never treats them as its own files.

Configuration

Settings come from .trw/config.yaml, then ~/.trw/config.yaml, and TRW_-prefixed environment variables override both. Full reference: trwframework.com/docs/config.

# .trw/config.yaml (all optional, shown with their defaults)
embeddings_enabled: true           # trw-mcp's own embedding use (learn-time dedup); needs trw-memory[embeddings]
deliver_gate_mode: "block_coding"  # no passing build record blocks coding work or a run that changed files; "advisory" only warns
ceremony_mode: "full"              # or "light"
comms_enabled: true                # peer messaging tools (formation members only)
dispatch_tools_exposed: false      # tools that launch another installed agent client
assess_enabled: false              # the experimental trw_assess tool

A running server caches its settings, so reconnect the client after a change. A malformed .trw/config.yaml logs a warning and falls back to defaults; set TRW_CONFIG_STRICT=1 to fail closed instead.

Optional features:

  • Peer messaging (comms_enabled, on by default) exposes trw_send and trw_inbox (trw_inbox's action parameter also enrolls, lists, and heartbeats among formation peers). Outside a formation they refuse and create no state. Messages are pull-based: a message does not wake an idle agent. Set comms_enabled: false to hide the tools.

  • Dispatch (dispatch_tools_exposed, off by default) launches another installed agent client, for example for a second-opinion review (trw-mcp dispatch --client <client> ...). It does not install that client or supply its credentials. dispatch_child_trw_access (off by default) gives supported children TRW's own stdio MCP connection and no other host configuration. Containment differs by client: headless Antigravity, for example, still loads its own configured MCP servers, and TRW's macOS write-denial wrapper for it does not isolate network access. Check trw-mcp dispatch --help and the result's sandbox_verified field before relying on a read-only review.

  • trw_assess (assess_enabled, off by default, experimental) returns calibrated probabilities for judgment calls. It is advisory. With the setting on and an OPENROUTER_API_KEY in the environment or the project .env, it sends the question and its state, with secrets redacted, to an allowlisted openrouter.ai endpoint.

None of these switches grants permission to modify files or bypass review gates, and peer messages are not trusted instructions.

Network and security

trw-mcp is local-first. Tool-call telemetry is recorded locally in .trw/logs/tool-telemetry.jsonl (telemetry_enabled, on by default). Learning content and usage telemetry are uploaded only if you turn on learning_sharing_enabled or platform_telemetry_enabled; both are off by default.

Platform connection. A signed-in install.sh install connects the project to the TRW platform: it adds platform_urls (https://api.trwframework.com) to .trw/config.yaml and stores your API key in .trw/credentials.yaml. Each session start compares the version the installer last recorded in .trw/installed-version.json with the running server, locally and without a network call, and suggests a reconnect if the recorded version is newer than the running server. With a platform URL configured, TRW also polls for team learnings every five minutes by default. The API key is attached only when the target host is on a trusted-host allowlist — the official platform host, or a host you add via ~/.trw/config.yaml (platform_trusted_hosts) or TRW_PLATFORM_TRUSTED_HOSTS; a project's own tracked .trw/config.yaml can point platform_urls/backend_url at any host, but doing so never makes that host trusted, so a cloned repo cannot redirect your key by editing tracked config. To turn the connection off, set platform_contact_enabled: false (or TRW_PLATFORM_CONTACT_ENABLED=false), or remove platform_urls (and platform_url or backend_url, if set) from .trw/config.yaml and ~/.trw/config.yaml. A pip install with trw-mcp init-project does not configure one.

These are the surfaces that can reach the network:

Surface

When

Default

How to control it

Installer sign-in

install.sh device login and installer download from trwframework.com

on for install.sh

--allow-unauthenticated, or install with pip

Model fetch

Only when you ask: the installer, or trw-mcp models fetch. Downloads the embedding model (default BAAI/bge-small-en-v1.5, pinned to one Hub commit) and the re-ranker into the local Hugging Face cache. At runtime, models load from that cache only, so recall and store make zero huggingface.co requests

runs only when invoked

don't run it; copy a populated cache instead

Team sync pull

Every sync_interval_seconds (default 300), when a platform URL and API key are configured: GET /v1/intel/state with this client's id, the model family and the framework version. The API key is attached only when the target host is on the trusted-host allowlist over HTTPS (never over plain HTTP to a non-localhost host); pulled team learnings are merged only with team_sync_enabled: true (off by default)

on with a platform URL and key

platform_contact_enabled: false, or remove the platform URL

Usage telemetry

Only when enabled

off (platform_telemetry_enabled: false)

leave it off

Learning publishing

Only when enabled

off (learning_sharing_enabled: false)

leave it off

trw_assess backend

Only with assess_enabled and an OPENROUTER_API_KEY

off

leave assess_enabled: false

Feedback submission

Only when you call trw_status(feedback=...) or run /trw-feedback, with a backend URL and API key configured: POST <backend>/v1/submissions with your API key, the message and attached metadata

off until invoked

do not invoke it

Model downloads are not a runtime behavior, so no consent flag governs them: learning_sharing_enabled and platform_telemetry_enabled govern uploads only. When a model is missing from the local Hugging Face cache, recall runs keyword-only and the embedding_egress row of trw-mcp doctor names the fix, trw-mcp models fetch. Loading a model that ships its own Python code is refused unless you set trw-memory's embedding_trust_remote_code: true; the default model does not need it.

Security defaults

Capability

Default

Notes

Encryption at rest

not available

planned for a later release; trw-memory 4.0 rejects encryption_enabled=true at config load, backend creation and trw-memory-server startup with EncryptionAtRestUnsupportedError. Use disk encryption

Secret redaction in logs

on

API keys, tokens and secret-named fields are masked in log output

Secrets in memory writes

refused

with PII detection on (pii_enabled, the default), a write containing a recognized API-key pattern is refused; a secret in a shape the patterns do not recognize is not caught. Other detected PII (emails, phone numbers) is recorded as metadata and stored as written

Recall integrity filter

strict

a recalled entry whose content no longer matches its signed hash is dropped (recall_filter_mode: strict)

Prompt-injection refusal

on

instruction- and code-injection shapes are refused at write time on every path: stores, team-sync pulls and corrections

Learning and telemetry upload

off

learning_sharing_enabled: false, platform_telemetry_enabled: false; the team-sync pull is separate (see above)

File permissions

0700 / 0600

.trw/ state directories are owner-only; memory.db and secret files are owner read/write

The memory security settings (RBAC, the recall filter, canary and provenance) are daemon-wide, because one daemon serves every checkout. Set them as MEMORY_* variables in the environment the daemon starts from; a trw-mcp process that resolves a different value is refused and told which variable to set.

Trust boundary. A checkout's memory grant (.trw/runtime/memory-token) covers its own project namespace and your shared user:local namespace, so a checkout cannot reach another checkout's project namespace through the daemon, and the grant files are owner-only (0600, in a 0700 directory). The boundary is your OS user account: grants scope what a checkout may reach, they are not isolation from same-user processes. Any process running as the same user can read those files and the store itself, so run untrusted code under a different account.

For an air-gapped or compliance-sensitive setup: run trw-mcp models fetch once while online (or copy a populated model cache), set platform_contact_enabled: false and export TRW_CONFIG_STRICT=1, and leave platform_telemetry_enabled, learning_sharing_enabled and assess_enabled off. Then check that .trw/ directories are 0700, the daemon's store is 0600, and trw_session_start makes no outbound connection.

Environment variables

Variable

Purpose

Default

TRW_CONFIG_STRICT

Fail closed on a malformed .trw/config.yaml

unset (warns and uses defaults)

TRW_LOG_LEVEL

DEBUG, INFO, WARNING, ERROR or CRITICAL

from --debug or defaults

TRW_PLATFORM_API_KEY

Platform credential, kept out of git-tracked config

unset

TRW_PROBE_ENABLED

Enables the sandboxed trw-mcp probe run experiment command

unset

ENABLE_TOOL_SEARCH

Claude Code's MCP tool deferral (true/false)

client default

MEMORY_*

trw-memory settings; see the trw-memory README

per setting

trw-mcp config-reference prints the TRW_ variable for every config setting, plus every variable read directly from the environment (never a TRWConfig field) — TRW_PROBE_ENABLED, for example — from one explicit registry kept in sync with the source by a dedicated test.

Troubleshooting

[Errno 2] No such file or directory on a TRW tool call. The server process exited. In Claude Code run /mcp to reconnect; in other clients, restart the session.

Claude Code searches for TRW tools before trw_session_start. The always-on tools are marked to load up front, but an explicit ENABLE_TOOL_SEARCH=true in Claude Code's environment overrides that and defers them all. Leave ENABLE_TOOL_SEARCH unset so the always-on tools load up front.

trw_session_start finds no learnings. Normal on first use. Learnings accumulate as the agent calls trw_learn.

Recall is keyword-only. Check the retrieval row of trw-mcp doctor, which names the missing piece and its fix. Usually trw-memory[embeddings] is not installed in the interpreter trw-mcp runs from (the daemon uses the same one). Install it, stop the memory daemon (send SIGTERM to the pid in daemon.json beside the store) so the next call starts a fresh one, and reconnect the client. embeddings_enabled: false is reported as a choice, not a fault.

Memory tools fail closed and print a memory migrate command. The checkout still has learnings in its old .trw/memory/memory.db, from before the per-user store. Run the printed command (trw-mcp memory migrate --to user previews; add --apply, which backs up first).

Memory is refused after moving a checkout. Mint a grant for the namespace it was pinned to: trw-mcp memory token --namespace <pinned namespace>.

update-project refuses because .trw/managed-artifacts.yaml is missing or invalid. Run trw-mcp uninstall --keep-memory, then trw-mcp init-project.

The memory store's -wal file keeps growing. A store reclaims WAL space only on SQLite 3.51.3 or newer (or the 3.44.6 and 3.50.7 backports). Older versions are safe but the file does not shrink. The memory_wal row of trw-mcp doctor reports the SQLite engine in use and measures the WAL of your resolved user store (TRW_USER_DIR, then XDG_DATA_HOME, then ~/.trw/memory/) — the same store the daemon writes to — not a per-checkout .trw/memory/memory.db-wal. When the engine is too old, the row names which of python3.14, python3.13, python3.12 and python3 on your PATH carry a qualifying SQLite (it probes those four within a 5-second budget and does not search further).

Debugging

trw-mcp --debug serve or TRW_LOG_LEVEL=DEBUG trw-mcp serve. Logs go to .trw/logs/trw-mcp-YYYY-MM-DD.jsonl.

Development

git clone https://github.com/wallter/trw-mcp.git && cd trw-mcp
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
pytest tests/test_dedup_trw_learn.py -v  # one file while you work
pytest tests/ -q -n 8                    # the full suite before a change is done
mypy --strict src/trw_mcp/
ruff check src/

See CONTRIBUTING.md and, for vulnerability reports, SECURITY.md.

License

Business Source License 1.1: source-available, free for non-competing use, and it converts to Apache 2.0 on 2030-03-21. The LICENSE file has the exact terms.


Built by Tyler Wall · TRW Framework · Documentation · License

Available Tools

41 tools
trw_adopt_runA

Transfer an existing run's pin to the caller's session.

Use when:

  • Resuming a run started by another session (fresh context, same task).

  • Reclaiming a run whose previous owner went away without delivering.

Guards:

  • Out-of-project run_path raises StateError (no force override).

  • Terminal status (delivered/complete/failed) requires force=True.

  • Live owner (heartbeat within pin_ttl_hours) requires force=True and emits run_adopted_potential_writer_conflict WARN when displaced.

Input:

  • run_path: absolute path to the run directory to adopt (required).

  • force: override terminal-status and live-owner guards.

Output: TrwAdoptRunResultDict with fields {adopted_run_id, previous_pin_key, from_pin_key, to_pin_key, adopted_ts, from_owner_was_live, force_used}.

Example: trw_adopt_run(run_path="/repo/.trw/runs//") → {"adopted_run_id": "", "from_pin_key": "sess-a", "to_pin_key": "sess-b", "force_used": false, ...}

Inputs: force, run_path.

trw_agent_work_evidenceA

Export canonical privacy-safe AgentWorkEvidence for a TRW run.

Use when a judge, eval harness, reviewer, or knowledge-graph importer needs one schema-valid work record instead of scraping run internals.

Inputs: run_path, include_events, include_schema.

trw_before_edit_hintB

Return cold-start codebase intelligence for file_path.

Use when an agent is about to edit a file and needs sidecar-backed risk context plus relevant prior learnings before reading broadly.

Sources:

  • trw-distill sidecar (tier-gated; requires team/pro/enterprise)

  • existing learnings via trw_recall (always)

Returns BeforeEditHintResult.model_dump() enriched by client tier. NEVER raises — failure paths populate distill_status + distill_action so the operator gets an actionable next step.

Inputs: file_path (required), cache_dir, repo_root. Returns: object

trw_before_edit_hint_batchA

Return c735+c743 BeforeYouEditBatch for the current SHA.

Use when an agent is planning a multi-file edit and needs batched before-edit hints from a persisted trw-distill sidecar.

Tier-gated (paid tiers only — see trw_before_edit_hint for the free-tier learnings counterpart). Returns BeforeEditHintBatchResult.model_dump(). NEVER raises.

Inputs: cache_dir, repo_root. Returns: object

trw_build_checkA

Record build/test results for ceremony tracking and delivery gates.

Use when:

  • You just ran project-native validation (via shell/CI/script) and need the outcome logged.

  • You want the delivery gate to see the latest pass/fail + coverage.

  • You want Q-learning feedback attached to a phase transition.

This tool does NOT execute subprocesses — run validation commands first, then call this with the results.

Input:

  • tests_passed: True or False — required; no default guess.

  • test_count: total checks/tests that ran.

  • failure_count: number that failed.

  • coverage_pct: 0.0-100.0, if measured.

  • static_checks_clean: preferred neutral status for configured static/type/lint/schema checks.

  • mypy_clean: legacy compatibility alias; use only for older clients or Python-specific reports.

  • scope: label like full, quick, type-check, cargo test, npm test.

  • failures: optional list of up to 10 failure descriptions.

  • run_path: optional run directory for event logging.

  • min_coverage: when set, falls tests_passed to False if coverage_pct is below the threshold (adds coverage_threshold_failed flag).

Output: dict with fields {status, run_id?, outcome, tests_passed, coverage_pct, static_checks_clean, mypy_clean, coverage_threshold_failed?, gate_effects: list[str]}.

Inputs: scope, failures, run_path, mypy_clean, +6 more.

trw_checkpointA

Append a progress snapshot so work survives context compaction.

Use when:

  • You complete a milestone or before context compaction/interruption.

  • After each meaningful work batch so another agent can resume safely.

Input: optional run_path plus required message. Optional shard_id and wave_id annotate delegated or wave-aware progress.

Output: dict with status, run_path, checkpoint path, and message metadata.

Inputs: message, wave_id, run_path, shard_id.

trw_claude_md_syncA

Deprecated alias for trw_instructions_sync.

Use when: maintaining backward compatibility with older callers; prefer trw_instructions_sync in new code. This alias emits a deprecation warning on every invocation and will be removed in a future release.

Output: same as trw_instructions_sync — ClaudeMdSyncResultDict with fields {status, files_written, sections_synced}.

Inputs: scope, client, target_dir.

trw_codebase_risk_reportA

Return c737/c739 ranked composite-risk report for the current SHA.

Use when a reviewer needs file-level structural risk ordering from a persisted trw-distill sidecar before prioritizing review effort.

Tier-gated. top_n=0 returns all entries; default 20. Returns CodebaseRiskReportResult.model_dump() enriched by client tier. NEVER raises.

Inputs: top_n, cache_dir, repo_root. Returns: object

trw_code_index_updateA

Update the local SHA-256 code-index manifest.

Use when an agent needs a fresh local code-index manifest before code search or symbol analysis without returning file bodies.

Inputs: repo_root (required), force, paths.

trw_code_symbolA

Find local indexed symbols with exact matches ranked first.

Use when an agent needs symbol locations from the local code index without scanning or returning full file bodies.

Inputs: symbol (required), repo_root (required), path, top_k.

trw_cross_repo_orderingA

Return the latest c745 CrossRepoOrderingAggregate.

Use when comparing structural-risk ordering consistency across multiple repositories from a persisted aggregate sidecar.

Sidecar SHA derived from sorted-repo-names (NOT git HEAD), so operator passes sidecar_path/sidecar_dir or the tool searches the repo-default location for the most-recent aggregate. Tier-gated. NEVER raises.

Inputs: repo_root, sidecar_dir, sidecar_path. Returns: object

trw_deliverA

Persist learnings and progress so future sessions inherit this session's work.

Use when:

  • Your session is about to end and you want discoveries to persist for future agents.

  • A milestone is reached and you want to close out the current run directory.

Before calling, check: did you record at least one discovery with trw_learn? If not, add even a one-line root-cause learning so the next agent avoids re-discovery.

Runs reflect + checkpoint synchronously, then launches housekeeping (consolidation, publish, telemetry, tier sweep) in the background. Background work is concurrency-safe — overlapping batches are skipped rather than queued.

Input:

  • run_path: path to run directory (auto-detected if None).

  • skip_reflect: skip reflection step (e.g., already reflected).

  • skip_index_sync: skip INDEX/ROADMAP sync step.

  • allow_unverified: explicit override for delivery without a passing trw_build_check record. Use only for documented acceptable failures.

  • unverified_reason: required rationale when allow_unverified is true.

Output: DeliverResultDict with fields {run_path: str, reflect: dict, checkpoint: dict, deferred: str, critical_steps_completed: int, deferred_steps: int, errors: list, success: bool, learning_reflection?: str}.

Example: trw_deliver() → {"run_path": "/path/...", "critical_steps_completed": 2, "deferred": "launched", "success": true}

See Also: trw_checkpoint, trw_instructions_sync

Inputs: run_path, skip_reflect, skip_index_sync, allow_unverified, +1 more.

trw_entity_risk_mapA

Return entity-level structural risk rows for the current SHA.

Use when a reviewer needs symbol/function/class/endpoint blast-radius triage from a persisted sidecar. Tier-gated. top_n=0 returns all matching rows. NEVER raises for sidecar failures.

Inputs: top_n, cache_dir, repo_root, changed_only. Returns: object

trw_heartbeatA

Refresh the caller's pin heartbeat and append a heartbeat event.

Use when:

  • A long-running campaign needs to keep its pin alive between work units.

  • You want to probe whether the current run is stale enough to checkpoint.

Rate-limit: if now - last_heartbeat_ts < 60s the call short-circuits (no events.jsonl append, no pin-store write) and returns rate_limited=True so long-running loops don't spam the audit trail. Rate-limit state lives in pins.json::<pin_key>::last_heartbeat_ts so the 60s window survives server restart.

Input:

  • message: optional context string logged alongside the heartbeat event.

Output: TrwHeartbeatResultDict — on success {run_id, last_heartbeat_ts, stale_after_ts, age_hours, should_checkpoint, rate_limited}; on missing-pin {error: "no_active_pin", hint: "call trw_init or trw_adopt_run first"}.

Inputs: message.

trw_initA

Create a run directory and register it as the active run.

Use when:

  • Starting a new task, sprint, or investigation that needs persistent TRW state.

  • You need run metadata, framework assets, and active-run pinning before work begins.

Bootstraps state, run metadata, events, framework assets, optional wave/artifact metadata, and a trace/profile-aware task_profile.

Input: task_name plus optional objective, config_overrides, task_root, wave_manifest, complexity signals, artifacts, and protection flag.

Output: dict with run_id, run_path, task_dir, phase, and status fields.

Inputs: run_type, artifacts, objective, prd_scope, +9 more.

trw_instructions_syncA

Sync TRW protocol and ceremony guidance into the client's instruction file.

Use when:

  • Onboarding a new project and the instruction file (CLAUDE.md / AGENTS.md) does not yet contain the TRW auto-generated section.

  • You've changed the behavioral protocol template and need it re-rendered.

  • You switch IDE clients and need the correct surface written.

Renders behavioral protocol and ceremony guidance into the auto-generated block of whichever client surface is present (CLAUDE.md, AGENTS.md, .codex/INSTRUCTIONS.md). Learnings are not promoted into the instruction file — trw_session_start() recall handles that (PRD-CORE-093).

Output: ClaudeMdSyncResultDict with fields {status: "success"|"error", files_written: list[str], sections_synced: int}.

Inputs: scope, client, target_dir.

trw_learnA

Persist a non-obvious discovery so future agents inherit the finding.

Use when:

  • You just found a root cause, gotcha, or durable pattern worth remembering.

  • Capture it the moment you validate an approach that prevents repeated mistakes.

  • You hit an architecture constraint that is not obvious from reading the code.

Only record learnings that:

  • prevent repeated mistakes,

  • change future implementation/debugging/review behavior,

  • are specific enough to recall later. Routine observations ("I read the file", "the test passed") degrade recall quality.

Required:

  • summary: one-line headline.

  • detail: full finding with context, symptoms, and why it matters.

Recommended:

  • tags: keywords for trw_recall filtering. Accepts a JSON list (["a","b"]) OR a comma/whitespace-separated string ("a,b c").

  • impact: 0.0-1.0; high values surface more often.

Advanced (auto-detected if omitted):

  • shard/source/client/model/type/domain/phase/team/protection metadata.

  • scope: write-tier override (PRD-CORE-185). "auto" (default) routes portable learnings to the machine-local user tier when a user-scope store is present, else the project tier; "project"/"user" force it. Most learnings need only summary and detail. Adding tags and impact improves recall precision. All other fields are auto-detected.

Output: LearnResultDict with {id: str, status: "saved"|"deduped"|"error", dedup_match?: dict, ceremony_hint?: str}.

See Also: trw_recall, trw_learn_update

Inputs: tags, type, scope, detail, +19 more.

trw_learn_updateA

Update an existing learning — status, fields, or feedback signal.

Use when:

  • The issue a learning describes has been fixed (status="resolved").

  • A pattern is no longer applicable (status="obsolete").

  • Detail or summary can be sharpened now that root cause is clearer.

  • You want to boost/demote an entry's recall ranking via feedback.

Output: dict with fields {status: "updated"|"not_found"|"invalid", error?: str, field_updated?: str}.

Inputs: tags, type, detail, domain, +15 more.

trw_mcp_security_statusD

Inputs: no named parameters. Returns: object

trw_meta_tune_rollbackA

Roll back a previously promoted meta-tune proposal.

Use when a promoted candidate is causing regressions and you need to restore the prior surface content while writing an entry to the SAFE-001 audit log.

Returns: dict serialization of the rollback result, including the proposal id and the restored content hash.

Inputs: proposal_id (required), state_dir, audit_log_path. Returns: object

trw_ordering_compareA

Return c741 RiskOrderingComparison for the current SHA.

Use when comparing two persisted risk-ordering sidecars for overlap and rank-correlation drift.

Tier-gated. NEVER raises.

Inputs: cache_dir, repo_root. Returns: object

trw_pipeline_healthA

Probe the five compounding-pipeline signals (sync_push, graph_edges, embedding_coverage, recall_feedback, bandit_state). Returns a structured report with degraded flag and advisory.

Use when:

  • trw_session_start returns a pipeline_health_advisory and you need the full per-signal breakdown to diagnose which subsystem is degraded.

  • Performing a routine operator health check outside of ceremony.

Checks: sync_push (consecutive_failures + last_push_at age), graph_edges (knowledge graph empty?), embedding_coverage (< 10%?), recall_feedback (all recall_count=0?), and bandit_state (mtime stale?).

Returns a structured report with:

  • degraded: True if any signal is degraded.

  • advisory: Compact single-line string naming degraded signals.

  • Per-signal sub-dicts with detailed status.

All probes are read-only and fail-open individually.

Inputs: no named parameters.

trw_prd_createA

Generate an AARE-F compliant PRD from a feature description.

Use when:

  • You have a feature request or requirements and need a structured PRD.

  • Before writing code for a P0/P1/P2 feature or risky behavioral change.

  • You want auto-incremented PRD ID, YAML frontmatter, and catalogue sync.

Produces 12 standard sections, confidence scores, and traceability links. Updates INDEX.md/ROADMAP.md when index_auto_sync_on_status_change is on.

Input:

  • input_text: feature request or description (becomes Problem Statement + Background).

  • category: one of CORE, QUAL, INFRA, LOCAL, EXPLR, RESEARCH, FIX (plus any values added to .trw/config.yaml::extra_prd_categories).

  • priority: P0, P1, P2, or P3 — drives base confidence scores.

  • title: auto-generated from input_text when empty.

  • sequence: auto-increments from existing catalogue when default (1).

  • risk_level: optional critical|high|medium|low — scales validation strictness.

Output: PrdCreateResultDict with fields {prd_id: str, title: str, category: str, priority: str, output_path: str, content: str, sections_generated: int, index_synced: bool}.

Example: trw_prd_create(input_text="Add rate limiting to public API", category="CORE", priority="P1") → {"prd_id": "PRD-CORE-001", "output_path": "docs/requirements-aare-f/prds/PRD-CORE-001.md", "sections_generated": 12, "index_synced": true, ...}

See Also: trw_prd_validate

Inputs: input_text (required), title, category, priority, +2 more.

trw_prd_diffB

Diff two PRD files with requirement, metric, and acceptance-gate focus.

Use when:

  • Reviewing changes between two PRD versions or drafts.

  • Auditing how requirements or acceptance criteria have evolved.

Inputs: after_path (required), before_path (required).

trw_prd_validateA

Score a PRD against the V2 validation suite before implementation.

Use when:

  • A PRD just landed and you need a READY / NEEDS-WORK verdict before coding.

  • You want ambiguity / completeness / traceability gates checked in one call.

Runs structure compliance, content quality, AARE-F compliance, and ambiguity analysis. Catches issues here that would otherwise cause rework.

Input:

  • prd_path: path to the PRD markdown file (required).

Output: ValidateResultDict with fields {total_score: float (0-100), quality_tier: str, grade: str, valid: bool, ambiguity_rate: float, completeness_score: float, traceability_coverage: float, improvement_suggestions: list[ImprovementSuggestionDict], failures: list[ValidationFailureDict], dimensions: list[DimensionScoreDict], path: str, sections_found: list[str], sections_expected: list[str], smell_findings: list[dict], ears_classifications: list[dict], readability: dict[str, float], section_scores: list[SectionScoreDict], effective_risk_level: str, risk_scaled: bool, status_drift_warnings: list[str], integrity_warnings: list[str], cache: dict}.

quality_tier values: "skeleton" | "draft" | "review" | "approved" (QualityTier enum; no "PRODUCTION" tier exists).

Example: trw_prd_validate(prd_path="docs/requirements-aare-f/prds/PRD-QUAL-074.md") → {"total_score": 87, "quality_tier": "approved", "grade": "A", "valid": true, "improvement_suggestions": []}

Inputs: prd_path.

trw_pre_compact_checkpointA

Capture a safety checkpoint before the context window compacts.

Use when:

  • Invoked by the PreCompact hook on imminent context compaction.

  • You suspect compaction is near and want a clean resume point on disk.

PRD-CORE-165 FR-01: pass directive (the active operator directive / task you are mid-flight on) and context_anchor (where you are in it — e.g. the in-flight experiment or handoff pointer). These live in the conversation, not in trw state, so they cannot be auto-derived; when supplied they are persisted into the pre-compact state and surfaced on the next trw_session_start so the post-compaction session resumes exactly instead of re-orienting by hand. Both are optional and backward-compatible.

Best-effort: sub-step failures populate status but do not raise.

Output: PreCompactResultDict with fields {status: "written"|"skipped"|"error", reason?: str, checkpoint_path?: str, instructions_path?: str, compact_state_path?: str, directive?: str, context_anchor?: str}.

Inputs: directive, context_anchor.

trw_probeA

Run a bounded, sandboxed experiment to resolve a disputed plan assumption.

Use when, during the PLAN phase, two plan branches disagree on a load-bearing, empirically resolvable claim a rubric cannot adjudicate (e.g. "this parser handles a 50MB JSONL stream without OOM"). The command runs inside the shared SAFE-001 sandbox (subprocess + seccomp + no-network default), bounded by timeout_s and memory_mb, and a typed ProbeResult with verdict in {supports, refutes, inconclusive} comes back.

Budget is enforced per planning_mode (DIRECT=0, DUAL_DRAFT=1, TRIANGULATED=2, TRIANGULATED_WITH_PROBE=3); exhaustion returns a typed budget error. Identical probes within a run are served from cache.

Returns: dict serialization of ProbeResult (or a typed error dict on validation failure / budget exhaustion / feature-flag disabled).

Inputs: command (required), hypothesis (required), run_id, memory_mb, +4 more. Returns: object

trw_probe_budget_statusA

Report live probe budget usage for a session (read-only, FR-10).

Use when you need to detect runaway probe usage before it becomes cost/latency creep. Returns {used, remaining, total, planning_mode, by_hypothesis_id, by_mode} consistent with emitted ProbeEvents in the same run. Read-only — never mutates budget state.

Inputs: run_id, planning_mode. Returns: object

trw_profile_explainA

Explain the resolved profile's per-field layer attribution.

Use when:

  • A surprising ceremony/review/build-check gate fires and you need to see WHICH layer contributed the offending value.

  • Auditing the policy in force for the session (NIST 24h reconstruction).

Resolves the full 6-layer chain (defaults → org → domain → task-type → session → client) and reports, for every surface field, its effective value, the origin layer, and the full override chain.

Input (all optional — inferred when omitted):

  • domain: override the inferred domain layer (e.g. frontend).

  • task_type: override the inferred task-type layer (e.g. bugfix).

  • prd_path: PRD/file path used to infer the domain when not explicit.

  • task_name: task name used to infer the task-type when not explicit.

Output: dict with fields (list of {field, value, origin_layer, override_chain}), layers_applied, surface_snapshot_id, session_override_hash, and resolved_profile. On error: a {error: str} payload (fail-open, never raises).

Inputs: domain, prd_path, task_name, task_type.

trw_query_eventsB

Return a merged cross-emitter event view for a session.

Inputs: filters, session_id.

trw_recallA

Retrieve prior learnings relevant to your current task.

Use when:

  • You are about to work in an unfamiliar area of the codebase.

  • You suspect a bug has been seen before and want prior root-cause notes.

  • You want a narrow tag/impact slice before spawning a subagent.

See Also: trw_learn, trw_session_start.

Results are ranked by combined relevance (query match on summary/tags/detail) and utility (impact, type-aware recency decay, prior feedback). Context boosts prioritize entries matching your current domain, phase, and team.

Output: RecallResultDict with fields {learnings: list[{id, summary, detail?, tags, impact, ...}], count: int, query: str, ceremony_hint?: str}.

Inputs: tags, as_of, query, topic, +9 more. Returns: Return shape of ``trw_recall`` MCP tool.

trw_request_tool_accessA

Grant this session single-use access to a phase-masked tool.

Use when a genuine cross-phase or emergency-debug need requires a tool the current phase masks — and only then, since every grant is logged to telemetry. The grant is single-use (one subsequent call) and the TTL is capped at 5 minutes regardless of ttl_seconds.

Inputs: reason (required), tool_name (required), ttl_seconds.

trw_reviewA

Compute a structured code-review verdict and persist a review.yaml artifact.

Use when:

  • Gating a PR or delivery and you need a pass/warn/block verdict with receipts.

  • You have pre-collected findings from a reviewer subagent (auto mode).

  • You want to detect spec-vs-code drift between a PRD and git diff (reconcile).

Modes:

  • manual: caller passes findings=[...] directly (backward compatible).

  • auto: multi-reviewer analysis with confidence filtering.

  • cross_model: route diff to an external model family.

  • reconcile: compare PRD FRs against git diff.

Input:

  • findings: list[{category, severity, description}] — triggers manual mode.

  • run_path: explicit run directory; auto-detected when None.

  • mode: explicit mode override; auto-detected when None.

  • reviewer_findings: pre-collected findings from subagent layer (auto).

  • prd_ids: explicit PRD IDs; reconcile mode auto-discovers when None.

Output: dict with fields {verdict: "pass"|"warn"|"block", findings_count: int, categories: dict, review_path: str, run_id: str, mode: str}.

Example: trw_review(findings=[{"category":"security","severity":"high","description":"..."}]) → {"verdict": "block", "findings_count": 1, "review_path": ".../review.yaml", "mode": "manual"}

Inputs: mode, prd_ids, findings, run_path, +1 more.

trw_session_startA

Load prior learnings + any active run so you start with full context.

Use when:

  • Starting a new session (first action, before reading code or editing).

  • Resuming after context compaction and you need the pin and learnings reloaded.

  • Switching onto an unfamiliar task and want a focused recall on the topic.

Recalls high-impact learnings (patterns, gotchas, architecture decisions) and checks for an active run (phase, progress, last checkpoint). Partial-failure resilient: a failure in one sub-step does not block the others.

Input:

  • query: optional focus string. When set, performs a focused recall on your topic AND a baseline high-impact recall, then merges + dedupes. Empty string or "*" uses default wildcard behavior.

  • verbose: when False (default) returns a COMPACT payload — the learnings list is capped to the top-K most relevant (with a learnings_omitted "N more" indicator) and the low-signal diagnostic sub-blocks (embed_health/assertion_health/sync_health/step_durations_ms) are folded into a one-line health_summary to cut token cost. Run/pin recovery, errors, framework_reminder, and degraded advisories are always preserved. Set verbose=True for the full diagnostic payload (legacy behavior).

Output: SessionStartResultDict with fields {learnings: list, learnings_count: int, learnings_omitted?: int, run: RunStatusDict, auto_recalled?: list, health_summary?: str (compact), embed_health?: dict (verbose), assertion_health?: dict (verbose), framework_reminder: str, errors: list, success: bool, compact: bool, payload_token_estimate: int}.

Example: trw_session_start(query="sqlite extension macos") → {"learnings": [...], "learnings_count": 8, "compact": true, "health_summary": "embed=ok; start=42ms (verbose=True for ...)", "run": {"active_run": "/path/...", "phase": "IMPLEMENT"}, ...}

See Also: trw_init, trw_recall

Inputs: query, verbose.

trw_skill_discoveryA

Rank eligible SKILL.md files without executing them.

Use when an agent needs safe skill recommendations from explicit SKILL.md paths before invoking any workflow.

Inputs: query (required), skill_paths (required), mode, active_cap, +1 more.

trw_statusA

Report the active run's phase, wave progress, shard state, and last activity.

Use when:

  • Resuming after context compaction or a session restart.

  • Deciding whether to checkpoint, advance phase, or re-delegate a wave.

Input:

  • run_path: path to the run directory. Auto-detects from pin if None.

Output: TrwStatusDict with fields {run_id, task, phase, status, confidence, framework, event_count, reflection, waves?, wave_progress?, wave_status?, reversions, last_activity_ts?, hours_since_activity?, stale_count}.

Inputs: run_path.

trw_submit_feedbackA

Submit a memo to the TRW maintainer (PRD-CORE-182).

Use when:

  • You found a bug, installation problem, or rough edge worth flagging.

  • You want to send a feature request or piece of feedback that deserves a real reply instead of disappearing into a personal log.

  • You want the maintainer to see exactly which trw-mcp / Python / OS you are on without retyping it — environment metadata is attached automatically.

Input:

  • category: one of bugfix, installation, feedback, feature_request, question, other.

  • subject: short headline (1-200 chars, no newlines).

  • message: full memo body (10-10000 chars).

  • contact_email: optional reply-to address; defaults to no reply-to.

  • metadata: optional extra key/value pairs (16 keys max, 200 char values max). Merged on top of the auto-attached environment dict.

Output: dict with success, submission_id (when 200), error (when non-200), status_code (HTTP status or 0 on validation/transport error), and metadata_attached (the dict actually sent so you can audit it locally).

Never raises — transport and validation failures are reported in the error field.

Inputs: message (required), subject (required), category (required), metadata, +1 more. Returns: object

trw_surface_classifyA

Classify a meta-tune surface as control vs advisory.

Use when you need to know whether a candidate path is governed by the SAFE-001 control surface registry before promoting a meta-tune proposal.

Returns: dict with classification ("control"|"advisory"), surfaces (list of surface names), and rationale.

Inputs: path (required). Returns: object

trw_surface_diffB

Structured diff between two surface snapshots.

Returns {added, removed, changed} lists of surface_id strings. changed entries appear in both snapshots with different content_hash values.

Inputs: snapshot_id_a (required), snapshot_id_b (required).

trw_validate_agent_work_evidenceA

Validate an AgentWorkEvidence candidate and return structured errors.

Use when an external producer or fixture needs schema validation before evidence is accepted by a judge or graph-ingestion pipeline.

Inputs: data (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.1/5.0

    Scored across 41 tools

    Disambiguation4/5

    Most tools have distinct, well-described purposes, but a few overlaps exist (e.g., trw_claude_md_sync as a deprecated alias for trw_instructions_sync, and trw_before_edit_hint vs trw_before_edit_hint_batch). One tool lacks a description entirely (trw_mcp_security_status), causing ambiguity. Overall, descriptions are detailed enough to distinguish the majority.

    Naming Consistency4/5

    All tool names consistently use the 'trw_' prefix and snake_case, which is predictable. However, the pattern varies between verb_noun (e.g., trw_adopt_run), noun (e.g., trw_status), and noun_noun (e.g., trw_code_symbol), with no strict adherence to a single convention. The consistency is good but not perfect.

    Tool Count2/5

    41 tools is excessive for most MCP servers, far exceeding the typical 3-15 well-scoped range. While the server attempts to cover a broad framework, many tools are highly specific or deprecated, suggesting the surface could be streamlined. Agents may struggle to navigate this many options efficiently.

    Completeness4/5

    The tool set covers a wide range of TRW framework needs: run lifecycle, learnings, code indexing/search, PRD management, validation, reviews, and probes. Minor gaps exist (e.g., no explicit run deletion or listing), but the core workflows are well-supported. The surface is comprehensive for its intended domain.

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      Not graded
      maintenance
      An MCP server that provides persistent project context, workflow management, and knowledge capture for AI coding agents. It enables agents to maintain structured memory across sessions by tracking project profiles, conventions, skills, and technical debt.
      7
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      MCP server that provides persistent memory and contextual awareness to language models, enabling project onboarding, recall of architectural rules, and code consistency across sessions.
      32
      MIT
    • A
      license
      B
      quality
      D
      maintenance
      MCP server that gives AI coding assistants persistent memory, structural code graph analysis, and safe multi-agent coordination, enabling them to answer architectural questions, track decisions across sessions, and coordinate safely in multi-agent workflows.
      39
      4
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      MCP server that captures and recalls coding session memory (failures, decisions, diffs) for AI agents, enabling cross-agent continuity and preventing repeated mistakes.
      MIT