mcp-code-context: Instructions file for Claude Code

CLAUDE.md

mcp-code-context CLAUDE.md is an instructions file for Claude Code from achatainga/mcp-code-context. It costs 810 tokens per session, scanned A, original, MIT.

Project instructions for building and running the mcp-code-context server. They document its TypeScript and Tree-sitter setup, commands, project layout, tests, backups, locking, and path checks.

In plain words
What is it for?
Use them when building, testing, cleaning, or reviewing changes to this code-context MCP server.
Why use it?
They give contributors the repository-specific commands and safety rules needed to change and verify the server correctly.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md.

This is achatainga/mcp-code-context's own configuration. It tells Claude Code how to work on mcp-code-context 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 mcp-code-context configures →

Reuse

Borrowing it

Nothing to install: this file belongs to achatainga/mcp-code-context. 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/achatainga/mcp-code-context/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/achatainga/mcp-code-context

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 mcp-code-context CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/achatainga/mcp-code-context/claude-md/github.svg)](https://agentmods.dev/instructions/achatainga/mcp-code-context/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/achatainga/mcp-code-context/claude-md"><img src="https://agentmods.dev/badge/instructions/achatainga/mcp-code-context/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 mcp-code-context CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/achatainga/mcp-code-context/claude-md"><img src="https://agentmods.dev/badge/instructions/achatainga/mcp-code-context/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 810 This file is loaded in full into every session.
When invoked 810 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.00810 $0.00810
Opus 5.5 $0.00324 $0.00324
Sonnet 5.5 $0.00162 $0.00162
Haiku 4.5 $0.00081 $0.00081

Measured today against content hash 9a158964237e, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

mcp-code-context 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 today.

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 · 47 lines

How it starts

The opening of the file, as written. The whole thing — 47 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Project Instructions: mcp-code-context

Tech Stack

  • Runtime: Node.js >= 18.0.0 (Pure ESM, "type": "module")
  • Language: TypeScript 5.7.2 (Strict, ES2022)
  • AST Engine: Pure WebAssembly Tree-sitter (web-tree-sitter v0.25.1 + tree-sitter-wasms v0.1.13)
  • Protocols: Model Context Protocol (@modelcontextprotocol/sdk v1.29.0) with Dual Transport (Stdio + SSE)
  • Persistence: In-Memory SQLite via WebAssembly (sql.js v1.14.1) + Rolling Backups (BackupManager)
  • Concurrency & Safety: Cross-process atomic file locking (proper-lockfile v4.1.2) + Path Traversal Validation (SecurityValidator)

Build & Run

  • Build: npm run build (runs tsc and copies JSON schemas to dist/)
  • Dev: npm run dev
  • Start: npm start
  • Rebuild: npm run rebuild (npm run clean && npm run build)
  • Clean: npm run clean (rimraf dist dist-tests)

Testing

  • Fast Unit Test Runner: npx vitest run (44 test suites, 189 tests)
  • Single Suite: npx vitest run tests/unit/operations/<file>.spec.ts
  • Adversarial Vectors Test: npm run test:vectors
  • Full Production Integration Suite: npm test (builds tests, runs security, file-lock, rate-limiter, telemetry, backup-manager, index-manager, and wasm-parsers test suites)

Project Structure

src/
├── core/            # Engine lifecycle, SecurityValidator, SessionManager
├── parsers/         # BaseParser, ParserRegistry, 10 language WASM grammars
├── operations/      # AST operations (read, write, taint, type inference, diff, query)
├── tools/           # MCP tool definitions and request dispatch handlers
│   ├── toolDefinitionsCore.ts   # Core AST & analysis tool schemas
│   ├── toolDefinitionsAdmin.ts  # Admin & session tool schemas
│   ├── readHandlers.ts          # Read & static analysis handlers
│   └── writeHandlers.ts         # 2-Phase atomic write handlers
└── utils/           # FileLock, BackupManager, Telemetry, AuditLogger, ProjectRoot

Engineering Guardrails & Conventions

  1. WASM Tree Lifecycle: Always call tree.delete() in finally blocks for every parsed Tree-sitter tree to prevent linear memory leaks.
  2. 2-Phase Surgical Write Protocol: Write tools (write_file_surgical, insert_symbol, remove_symbol, rename_symbol) must execute dry-run preview diffs on Phase 1, issue an ephemeral confirmationToken, and require explicit confirmation (confirm: true + token) on Phase 2.
  3. SRE Physical Resource Bounds:
    • Stream processing chunks must not exceed 8,192 bytes.
    • Max file size for full AST loading is capped at 2MB by SecurityValidator.
    • External command execution (e.g. git diff) must use execFileAsync without a shell, enforce isValidGitRef, and specify timeout: 15000ms.
  4. Thermo-Nuclear Maintainability: Keep handler files decomposed under 1,000 lines. When adding new tools, extract dedicated submodule handlers instead of expanding readHandlers.ts.
  5. Git Conventions: Conventional Commits (feat(scope): ..., fix(scope): ..., chore(scope): ...).

Read the full file on GitHub · 47 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. today First seen · 47 lines · 810 tokens per session scan A 9a158964237e

Subscribe to this mod's changes

mcp-code-context CLAUDE.md is an instructions file published in the GitHub repository achatainga/mcp-code-context (3 stars, last pushed today), licensed MIT. It adds 810 tokens to every session, about $0.0032 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-11-08.

Related

mcp-code-context CLAUDE.md compared with instructions from other repositories

mcp-code-context CLAUDE.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
mcp-code-context CLAUDE.mdachatainga/mcp-code-contextInstructions file3todayMITA810Claude Code
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA9,719GitHub Copilot
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA5,516GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143kyesterdayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149ktodayMITA4,680Codex, OpenCode
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA3,093GitHub Copilot
vscode model-prompts.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA2,022GitHub Copilot