Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add instructions/thru-echoes/trace/claude-mdgit clone --depth 1 https://github.com/Thru-Echoes/TRACEWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.03304 | $0.03304 |
| Opus 5 | $0.01652 | $0.01652 |
| Sonnet 5 | $0.00661 | $0.00661 |
| Haiku 4.5 | $0.00330 | $0.00330 |
Grade A, and why
TRACE CLAUDE.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 218 lines — stays where its author put it; the contents beside it link to each section on GitHub.
TRACE — Project Instructions
Full documentation: README.md (architecture, tools, configuration, changelog) Orientation: docs/ONBOARDING.md (dev + user onboarding) · docs/WHAT-IS-TRACE.md (non-technical explainer) Formal specification: docs/specification.md Version: 0.5.0 (package) · protocol/schema v0.5.0 TRACE project name: "trace-mcp" (canonical project key:
trace-mcp)
Development
uv pip install -e ".[dev]" # Install with dev dependencies
uv run pytest # Run full test suite (1240+ tests)
uv run pytest tests/test_invariants.py # Invariant-registry guard (docs/INVARIANTS.md) — fast
uv run pytest -k llm # Run real LLM integration tests
uv run ruff check src/ # Lint
uv run pyright src/ # Type check
python scripts/generate_schema.py # Regenerate JSON Schema from Pydantic models
uv build && uv run pytest tests/test_packaging_artifacts.py # Verify the shipped wheel/sdist before tagging
trace-mcp identity check # Report project-identity drift (non-zero exit on findings)
trace-mcp doctor [DIR] [--live] # Report deployed-state drift for one project (non-zero exit on findings)
trace-mcp fleet-check [ROOTS...] # Same check across every TRACE project under the given roots
Two console scripts ship with the package: trace-mcp (the MCP server) and
trace-mcp-init (writes .mcp.json, the TRACE_PROJECT pin, and host adapter
assets into a consumer project). trace-mcp identity dispatches to the
migration tooling (snapshot, scan, apply, check, merge-stores,
adopt, bundle) — see docs/adr/006-project-identity-and-isolation.md.
Key Patterns
- Pydantic v2 for all data models:
model_dump(),model_validate(),model_rebuild() - Forward refs across files: Import both models in
schema/__init__.py, callmodel_rebuild()after - All modules import
Sessionfromtrace_mcp.schema(not.schema.session) to trigger rebuild from datetime import UTC(nottimezone.utc) — ruff UP017- FastMCP
@mcp.tool()needs parentheses asyncio_mode = "auto"in pytest config for async tests- Atomic writes (temp file +
os.replace) for all JSON writes — nofcntldependency (cross-platform) - Session writes go through
storage.locked.locked_disk_session— the single fail-closed, disk-truth read-modify-write path (INV-1,docs/INVARIANTS.md). Never hand-roll a lock block; never let a write proceed on a lock timeout. - Fail closed on integrity primitives: the per-session lock raises
TimeoutErrorrather than writing unlocked; stale-lock theft is gated on holder-PID liveness. A missed lock must be visible, not silent. - Read aggregates skip-and-report:
project_summary/health_checkcatch per-sessionValidationError/JSONDecodeErrorand surface askipped_sessionslist rather than aborting the whole aggregate. - Schema models preserve unknown fields (
extra="allow"via theTraceModelbase) for forward-compat;Environmentis the one closed exception (legacytrace_versiondrop). - A project is identified by its canonical key, never by its free-text label —
metadata.project_keyis authoritative when present; a document without one resolves through the alias registry (~/.trace/projects.json).projectstays an unconstrained display label. All matching and filtering goes throughproject_identity(INV-4, INV-9); never compare labels directly. - Label repair is alias-table-first — a mislabelled project is fixed by adding an alias, never by rewriting a capture record.
autoandsharedare reserved keys. - Cross-project reads and writes fail closed when the server is pinned via
TRACE_PROJECT;TRACE_REQUIRE_PINadditionally refuses both session-creation paths on an unpinned process. server.pyimports__version__fromtrace_mcpfor startup log- Per-project OpenAI key: the key lives in the project's own
.env, which overrides the machine-global~/.trace/.env(an exported env var still wins over both).TRACE_LOCAL_ONLYis the one exception — a restrict-only ratchet ORed across sources, so no project can switch a machine-wide kill switch off. Config is read once at server start; a.envedit needs a server restart. - A missing or refused key is loud: reported in the
trace_start_sessionbanner and in the affectedtrace_learn_*responses, and a provider 401/403 raisesApiKeyRejectedErrorregardless ofTRACE_STRICT_LLM. A backend that cannot be built degrades to keyword matching with a notice rather than failing registration — an unregistered extension is indistinguishable from an uninstalled one. - Line length: 120 (ruff configured)
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 3d ago First seen · 218 lines · 3,304 tokens per session scan A 8c2554716991
TRACE CLAUDE.md is an instructions file published in the GitHub repository Thru-Echoes/TRACE (22 stars, last pushed 5d ago), licensed Apache-2.0. It adds 3,304 tokens to every session, about $0.0165 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other instructions, from other repositories
heimdall-mcp AGENTS.md
AGENTS.md instructions for enmanuelmag/heimdall-mcp, covering agents.md — @cardor/heimdall-mcp, project, health check (run before making codebase changes), harness data (source of truth) and mcp tools (preferred).
heimdall-mcp CLAUDE.md
Claude Code instructions for enmanuelmag/heimdall-mcp, covering claude.md — @cardor/heimdall-mcp, project, health check (run before making codebase changes), harness data (source of truth) and mcp tools (preferred).
mcp-server-excel coverage-prevention-strategy.instructions.md
Instructions for sbroenne/mcp-server-excel, covering generated surface coverage, contract change workflow, required checks and common incomplete changes.
llm-context.py CLAUDE.md
Instructions for cyberchitta/llm-context.py, covering claude.md, working notes (gitignored) and draining the field notes.
openrouter-mcp-multimodal AGENTS.md
Instructions for stabgan/openrouter-mcp-multimodal, covering agent instructions, before you ship, releasing (read this before publishing), short version and version files (must all match package.json).
autotask-mcp dev_workflow.instructions.md
Guide for using Taskmaster to manage task-driven development workflows.