| name | ctx-audit |
| description | Audits token efficiency of a context architecture โ analyzes CLAUDE.md conciseness, hierarchy depth, information duplication, and context distribution, then suggests improvements. ์ปจํ
์คํธ ๊ฐ์ฌ, ํ ํฐ ํจ์จ์ฑ, CLAUDE.md ๊ฐ๊ฒฐ์ฑ, ๊ณ์ธต ๊ตฌ์กฐ, ์ ๋ณด ์ค๋ณต, ์ปจํ
์คํธ ๋ถ์ฐ. |
Context Architecture Audit
Audit the token efficiency of a context architecture end to end. For detailed optimization techniques, see the guide skill's references/token-optimization.md.
Respond to the user in Korean.
Execution Steps
Step 1: CLAUDE.md conciseness audit
- Read the project root CLAUDE.md and analyze its information density.
- Check for:
- Frequently changing information
- Whether detailed docs are properly distributed via
@ import, subdirectory CLAUDE.md, or .claude/rules/
- Style rules that a linter could automate instead
- Noise such as standard-library explanations
- If the content is long, propose concrete ways to distribute it.
Example output:
## CLAUDE.md ๊ฐ๊ฒฐ์ฑ ๊ฐ์ฌ
**ํ์ฌ**: 285๋ผ์ธ โ ๋ถ์ฐ ๊ถ์ฅ
### ๋ถ์ฐ ๊ถ์ฅ ์น์
| ์น์
| ๋ผ์ธ ์ | ๋ถ์ฐ ๋ฐฉ๋ฒ |
|------|---------|-----------|
| API ๋ช
์ธ | 42๋ผ์ธ | โ `@src/api/API-GUIDE.md` import ๋๋ `src/api/CLAUDE.md` |
| ํ
์คํธ ์ ๋ต | 28๋ผ์ธ | โ `.claude/rules/testing.md` (glob: `tests/**`) |
| ์คํ์ผ ๊ฐ์ด๋ | 15๋ผ์ธ | โ ๋ฆฐํฐ ์ค์ ์ผ๋ก ๋์ฒด (์ญ์ ) |
Step 2: Hierarchy analysis
- Collect context files across the whole project:
**/CLAUDE.md (auto-loaded by Claude Code)
.claude/rules/*.md (path-scoped rules)
**/CONTEXT.md (for manual reference)
/AGENTS.md (for other-tool compatibility)
- Classify by directory depth:
- Layer 0:
/CLAUDE.md, /AGENTS.md, .claude/rules/
- Layer 1: one level down, e.g.
/src/CLAUDE.md
- Layer 2: two levels down, e.g.
/src/api/CLAUDE.md
- Layer 3+: deeper layers
- Verdict:
- โ
โค3 levels: optimal
- โ ๏ธ 4 levels: caution โ rising complexity
- โ >4 levels: excessive โ consider merging
Example output:
## ๊ณ์ธต ๊ตฌ์กฐ ๋ถ์
**๊ณ์ธต ๊น์ด**: 3 ๋ ๋ฒจ โ
| ๋ ์ด์ด | ํ์ผ ์ | ํ์ผ ๋ชฉ๋ก |
|--------|---------|-----------|
| Layer 0 | 2 | CLAUDE.md, AGENTS.md |
| Layer 1 | 3 | src/, tests/, docs/ |
| Layer 2 | 5 | src/api/, src/components/, ... |
| Layer 3 | 2 | src/api/auth/, src/api/users/ |
Step 3: Information duplication detection
- Extract key keywords/phrases from each context file.
- Detect duplicated content across files:
- The same build command appearing in multiple files
- The same architecture description repeated
- Identical content in both a parent and a child file
- Propose how to deduplicate.
Step 4: Context coverage analysis
- Collect the project's main directories.
- For each directory, check whether a context file exists (CLAUDE.md, a matching
.claude/rules/ rule, or CONTEXT.md).
- Identify directories that lack context but should have it:
- Directories with 10+ source files
- Directories holding independent domain logic
- Also identify directories that carry an unnecessary context file:
- Directories with only 1โ2 files
- Cases where the parent context is sufficient
Step 5: Comprehensive audit report
# ์ปจํ
์คํธ ์ํคํ
์ฒ ํ ํฐ ํจ์จ์ฑ ๊ฐ์ฌ ๋ฆฌํฌํธ
## ์์ฝ ์ ์
| ํญ๋ชฉ | ์ ์ | ์ํ |
|------|------|------|
| CLAUDE.md ๊ฐ๊ฒฐ์ฑ | ์ํธ | โ
|
| ๊ณ์ธต ๊น์ด | ์ต์ | โ
|
| ์ ๋ณด ์ค๋ณต | 2๊ฑด ๋ฐ๊ฒฌ | โ ๏ธ |
| ์ปค๋ฒ๋ฆฌ์ง | 80% | ๐ก |
## ์ ์ฒด ํจ์จ์ฑ ๋ฑ๊ธ: B+ (์ํธ)
## ๊ฐ์ ์ ์ (์ฐ์ ์์์)
1. CLAUDE.md์ API ๋ช
์ธ๋ฅผ `@` import ๋๋ `src/api/CLAUDE.md`๋ก ๋ถ์ฐ
2. CLAUDE.md์ ์๋ธ๋๋ ํ ๋ฆฌ CLAUDE.md์ ๋น๋ ๋ช
๋ น ์ค๋ณต ์ ๊ฑฐ
3. src/services/ ๋๋ ํ ๋ฆฌ์ CLAUDE.md ๋๋ `.claude/rules/` ๊ท์น ์ถ๊ฐ ๊ถ์ฅ