Claudemd Deep Dive — Development skill for Claude Code
Research into how Claude Code loads subdirectory CLAUDE.md files — what triggers injection, where content lands in the API payload, deduplication, session resume, and token cost, traced via intercepti.
How to install Claudemd Deep Dive
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open agynio/claudemd-deep-dive and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What Claudemd Deep Dive does
Research into how Claude Code loads subdirectory CLAUDE.md files — what triggers injection, where content lands in the API payload, deduplication, session resume, and token cost, traced via intercepting proxy.
Alternatives in Development
- Management Deep Dive — 管理层纵深研究:买股票就是买人 15.9k ★
- Review Claudemd — Review recent conversations to find improvements for CLAUDE.md files 6.5k ★
- Oob — Out-of-band orchestrator — confirm BLIND SSRF/XXE/SQLi/RCE/Log4Shell by correlating interactsh callbacks to th 4.5k ★
README
How Claude Code Reads CLAUDE.md Files — Experiment
Claude Code supports `CLAUDE.md` files at multiple levels. Global and project-root files are simple — loaded once at session start, always in context. Subdirectory files are different: the docs say they load *"on demand as Claude navigates your codebase"* but explain nothing about the actual mechanism.
We had questions that mattered for building agents:
- What exactly triggers the load — any tool, or a specific one?
- Does it re-inject on every file read, or is there deduplication?
- Where does the content go — system prompt or messages?
- What survives a session resume?
- Does repeated injection blow up token costs?
To answer these we put an intercepting HTTP proxy between Claude Code and the Anthropic API and traced every `/v1/messages` call. Full write-up: **[REPORT.md](./REPORT.md)**
Key Findings
| Question | Answer |
|---|---|
| What triggers subdir CLAUDE.md? | Read tool only — not Bash, Glob, or Write |
| Where does it appear? | Concatenated into the tool result text — not the system prompt, not a separate message |
| Does system prompt grow? | Never — stays constant regardless of how many subdirs load |
| Re-injected on every Read? | No — once per subprocess per directory (readFileState Map) |
| Visible after injection? | Yes — sticky in message history for all subsequent turns |
| Parallel reads, same dir? | One injection total for the whole batch |
| Persisted to disk? | Stripped before writing — disk session is always clean |
| Session resume? | readFileState resets → fresh injection on first Read |
| Token cost? | Near-zero — prompt caching absorbs it |
Repository Structure
Experiment scripts
| File | Description |
|---|---|
src/experiment.ts |
Experiment 1 — 9 scenarios covering first Read, same-session re-read, new session, multiple subdirs, Write-only, Glob-only, Bash-only, and resumed session. Outputs results.json. |
| `src/exper |
Related Skills
Nay Costs
Use the Nay agent to do a deep-dive cost analysis of my Claude Code spending.
Claude Cost Optimizer
Save 30-60% on Claude Code costs -- 6 deep-dive guides, 15 ranked strategies, 12 CLAUDE.md templates, token es
Prompt Injection Benchmark
A reproducible prompt-injection benchmark that measures which defenses actually work: each payload is replayed
How Claude Code Works
Deep dive into Claude Code internals — architecture, agent loop, context engineering, and more. / 深入解析 Claude
Native Feel Skill
An Agent Skill for designing cross-platform desktop apps that feel native — distilled from Raycast's 2.0 deep-
Claude Reviews Claude
Claude reads its own source code — 17-chapter architectural deep-dive into Claude Code v2.1.88. EN/ZH bilingua
Related Agents
Token Economy Agent
Cost-Classification Auditor. Owns whether a proposed recurring mechanism (per-sprint or per-commit) should be
Evasion
Antivirus and EDR evasion specialist for authorized red team engagements. Handles AMSI bypass, payload obfusca
AI Redteam
Use PROACTIVELY for AI CTF challenges and LLM security challenges. Triggers on prompt injection, jailbreak, LL