TRACE CLAUDE.md

Project instructions for TRACE, a software project with a documented architecture, formal specification, command-line tools, and automated tests.

In plain words
What is it for?
Installing development dependencies, running tests and checks, regenerating schemas, building packages, and diagnosing project or deployment drift.
Why use it?
They give contributors the project identity, setup commands, validation checks, and sources of truth needed to make changes without breaking its documented rules.

Instructions file

Install

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.

agentmods
npx agentmods add instructions/thru-echoes/trace/claude-md
Clone the repo
git clone --depth 1 https://github.com/Thru-Echoes/TRACE
Per session 3,304 This file is loaded in full into every session.
When invoked 3,304 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What 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.

ModelPer sessionOnce 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

Measured 3d ago against content hash 8c2554716991, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

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.

CLAUDE.md · 218 lines

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, call model_rebuild() after
  • All modules import Session from trace_mcp.schema (not .schema.session) to trigger rebuild
  • from datetime import UTC (not timezone.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 — no fcntl dependency (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 TimeoutError rather 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_check catch per-session ValidationError/JSONDecodeError and surface a skipped_sessions list rather than aborting the whole aggregate.
  • Schema models preserve unknown fields (extra="allow" via the TraceModel base) for forward-compat; Environment is the one closed exception (legacy trace_version drop).
  • A project is identified by its canonical key, never by its free-text labelmetadata.project_key is authoritative when present; a document without one resolves through the alias registry (~/.trace/projects.json). project stays an unconstrained display label. All matching and filtering goes through project_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. auto and shared are reserved keys.
  • Cross-project reads and writes fail closed when the server is pinned via TRACE_PROJECT; TRACE_REQUIRE_PIN additionally refuses both session-creation paths on an unpinned process.
  • server.py imports __version__ from trace_mcp for 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_ONLY is 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 .env edit needs a server restart.
  • A missing or refused key is loud: reported in the trace_start_session banner and in the affected trace_learn_* responses, and a provider 401/403 raises ApiKeyRejectedError regardless of TRACE_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)

Read the full file on GitHub · 218 lines

Changes

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.

  1. 3d ago First seen · 218 lines · 3,304 tokens per session scan A 8c2554716991

Subscribe to this mod's changes

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.