TRACE: Instructions file for Claude Code

CLAUDE.md

TRACE CLAUDE.md is an instructions file for Claude Code from Thru-Echoes/TRACE. It costs 3,738 tokens per session, scanned A, original, Apache-2.0.

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 for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: reads .claude/ paths; mentions CLAUDE.md; mentions subagents.

This is Thru-Echoes/TRACE's own configuration. It tells Claude Code how to work on TRACE itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything TRACE configures →

Reuse

Borrowing it

Nothing to install: this file belongs to Thru-Echoes/TRACE. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/Thru-Echoes/TRACE/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/Thru-Echoes/TRACE

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for TRACE CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/thru-echoes/trace/claude-md/github.svg)](https://agentmods.dev/instructions/thru-echoes/trace/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/thru-echoes/trace/claude-md"><img src="https://agentmods.dev/badge/instructions/thru-echoes/trace/claude-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for TRACE CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/thru-echoes/trace/claude-md"><img src="https://agentmods.dev/badge/instructions/thru-echoes/trace/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 3,738 This file is loaded in full into every session.
When invoked 3,738 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.03738 $0.03738
Opus 5.5 $0.01495 $0.01495
Sonnet 5.5 $0.00748 $0.00748
Haiku 4.5 $0.00374 $0.00374

Measured 23d ago against content hash ab3e915909ce, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 23d 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 · 244 lines

How it starts

The opening of the file, as written. The whole thing — 244 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.2.dev0 (package, unreleased; latest release 0.5.1) · protocol/schema v0.5.1 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
  • MCPServer (mcp 2.x) @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 label — metadata.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 · 244 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. 23d ago Changed · +2 lines · +43 tokens per session ab3e915909ce
  2. 1mo ago Changed · +9 lines · +113 tokens per session 7ee91d03c858
  3. 1mo ago Changed · +14 tokens per session 21f554a34b62
  4. 1mo ago Changed · +14 lines · +257 tokens per session 16ca3c15c998
  5. 1mo ago Changed · +1 lines · +7 tokens per session b78057fca61c
  6. 1mo 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 (25 stars, last pushed 15d ago), licensed Apache-2.0. It adds 3,738 tokens to every session, about $0.0150 per session on Opus 5.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.

Related

Other instructions, from other repositories

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 9,715 tokens

next.js AGENTS.md

AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,461 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, cache eligibility and rollout and applying the notice (cutover).

microsoft/vscode · 5,262 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,680 tokens

vscode copilot-instructions.md

Copilot instructions for microsoft/vscode, covering vs code copilot instructions, project overview, root folders, core architecture (src/ folder) and built-in extensions (extensions/ folder).

microsoft/vscode · 2,731 tokens

deepseek-harness AGENTS.md

AGENTS.md instructions for deepseek-ai/deepseek-harness, covering agents.md, pre-stable apis and released session data, repository layout, commands and host sandbox failures.

deepseek-ai/deepseek-harness · 4,261 tokens