[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M71VAE1CJZ87HH52K3R1WJXK":3,"skill-same:01M71VAE1CJZ87HH52K3R1WJXK":67},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":37,"linkOnly":38,"markdownContent":39,"markdownBody":40,"frontMatter":41,"refName":44,"commitSha":45,"skillDirectory":46,"forksCount":47,"repositoryHtmlUrl":48,"repositoryHomepageUrl":6,"ownerHtmlUrl":49,"ownerBlogUrl":50,"ownerDescription":51,"updatedAt":52,"install":53,"resources":66},"01M71VAE1CJZ87HH52K3R1WJXK","token-audit",null,"Audit Claude Code configuration to measure fixed-context token overhead and produce a prioritized action plan. Use when sessions feel slow, context compresses early, or after adding many rules files.","FlorianBruniaux\u002Fctxharness","FlorianBruniaux","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F3902606?v=4","01M71VA3JB0M2XMP2VHSG5FFBQ","Florian BRUNIAUX","01M71VA3KBBW4EY7T1TRDDQ2ZR",27,"MIT","https:\u002F\u002Fgithub.com\u002FFlorianBruniaux\u002Fctxharness\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Ftoken-audit\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36],"token audit","token","audit","context","configuration","action","grep","read","overhead","plan","code","Bash","when","Rules","use","produce","files","sessions","2026-11-10 13:02:02",false,"---\nname: token-audit\ndescription: \"Audit Claude Code configuration to measure fixed-context token overhead and produce a prioritized action plan. Use when sessions feel slow, context compresses early, or after adding many rules files.\"\nallowed-tools: Read, Grep, Glob, Bash\neffort: medium\n---\n\n# \u002Ftoken-audit — Context Token Audit\n\n**Purpose**: Measure how many tokens your Claude Code configuration consumes before any user task begins. Identify the biggest sources of overhead. Produce a concrete action plan with savings estimates.\n\n## What You Will Measure\n\n| Component | Loaded when | Typical range |\n|-----------|-------------|---------------|\n| `~\u002F.claude\u002FCLAUDE.md` + @imports | Always | 5–15K tokens |\n| Project `CLAUDE.md` | Always | 2–8K tokens |\n| `.claude\u002Frules\u002F*.md` | Always (all files) | 5–40K tokens |\n| `MEMORY.md` | Always | 1–3K tokens |\n| Claude Code system prompt | Always | ~7,500 tokens |\n| Commands, agents, skills | On invocation only | 0 by default |\n\nKey insight: `.claude\u002Frules\u002F` loads every `.md` file at session start. Commands and agents are lazy-loaded — zero cost until invoked.\n\n---\n\n## Step 1 — Run the Measurement\n\n```bash\necho \"=== PROJECT CLAUDE.md ===\" && wc -c CLAUDE.md 2>\u002Fdev\u002Fnull || echo \"none\"\n\necho \"\"\necho \"=== RULES FILES (sorted by size) ===\" && find .claude\u002Frules -name \"*.md\" 2>\u002Fdev\u002Fnull \\\n  | xargs wc -c 2>\u002Fdev\u002Fnull | sort -rn | head -20\n```\n\nThen calculate the full budget:\n\n```bash\nPROJECT=$(wc -c \u003C CLAUDE.md 2>\u002Fdev\u002Fnull || echo 0)\nRULES=$(find .claude\u002Frules -name \"*.md\" 2>\u002Fdev\u002Fnull | xargs cat 2>\u002Fdev\u002Fnull | wc -c || echo 0)\nTOTAL=$(( PROJECT + RULES + 30000 ))\n\necho \"Project CLAUDE.md  : ~$(( PROJECT \u002F 4 )) tokens\"\necho \"Rules (auto-loaded): ~$(( RULES \u002F 4 )) tokens\"\necho \"System prompt      : ~7,500 tokens\"\necho \"---\"\necho \"TOTAL fixed context: ~$(( TOTAL \u002F 4 )) tokens\"\necho \"% of 200K window   : $(( TOTAL \u002F 4 * 100 \u002F 200000 ))%\"\n```\n\n---\n\n## Step 2 — Classify Rules Files\n\n| Class | Definition | Action |\n|-------|------------|--------|\n| **ALWAYS** | Applies to most tasks (conventions, safety) | Keep auto-loaded |\n| **SOMETIMES** | Relevant in 20–40% of sessions | Keep if small (\u003C3K chars) |\n| **RARELY** | Relevant in \u003C10% of sessions | Remove from auto-load |\n| **NEVER** | Outdated or covered elsewhere | Delete or archive |\n\nFor each file in `.claude\u002Frules\u002F`, output:\n\n```\n| File | Size (chars) | Class | Reasoning (one sentence) |\n```\n\nSort by size descending within each class. Calculate total chars saved by removing RARELY and NEVER files.\n\n---\n\n## Step 3 — Audit Hook Overhead\n\nHooks on `PreToolUse` and `PostToolUse` fire on every tool call. Check what you have:\n\n```bash\npython3 - \u003C\u003C 'EOF'\nimport json, os\nfor path in [os.path.expanduser(\"~\u002F.claude\u002Fsettings.json\"), \".claude\u002Fsettings.json\"]:\n    if not os.path.exists(path): continue\n    print(f\"\\n--- {path} ---\")\n    data = json.load(open(path))\n    for event, hooks in data.get(\"hooks\", {}).items():\n        for h in hooks:\n            cmd = h.get(\"command\", \"?\")\n            matcher = h.get(\"matcher\", \"*\")\n            print(f\"  [{event}] matcher={matcher} → {cmd[:80]}\")\nEOF\n```\n\n**Red flags**: hooks that `cat` files unconditionally, `git status` on every call, multi-line debug echo never removed.\n\n---\n\n## Step 4 — Action Plan\n\n| Action | Estimated savings | Effort | Risk |\n|--------|------------------|--------|------|\n| Remove RARELY files from auto-load | varies | 30 min | Low |\n| Split large rules into core + detail | varies | 1–2h | Low |\n| Trim hook stdout to essential fields | varies | 1h | Low |\n| Archive outdated MEMORY.md entries | 500–1K tokens | 30 min | Low |\n\n---\n\n## Output Format\n\n```markdown\n## Token Audit — ctxharness — [DATE]\n\n### Budget Summary\n\n| Component | Tokens | % of total |\n|-----------|--------|------------|\n| Project CLAUDE.md | X | Y% |\n| Rules (auto-loaded) | X | Y% |\n| System prompt | 7,500 | Y% |\n| **TOTAL** | **X** | **100%** |\n\nContext window used before any task: X% of 200K\n\n### Rules Classification\n\n| File | Chars | Class | Action |\n|------|-------|-------|--------|\n\n### Action Plan\n\n| Action | Savings | Effort |\n|--------|---------|--------|\n\n**Total achievable without infrastructure**: -X tokens → N% reduction\n```\n\n## Interpreting Results\n\n| Fixed context | Assessment |\n|---------------|------------|\n| \u003C 20K tokens | Healthy — no urgent action needed |\n| 20–40K tokens | Moderate — grab easy wins |\n| 40–60K tokens | High — rules audit is worth an afternoon |\n| > 60K tokens | Critical — you are burning 30%+ of your window before any task |\n","# \u002Ftoken-audit — Context Token Audit\n\n**Purpose**: Measure how many tokens your Claude Code configuration consumes before any user task begins. Identify the biggest sources of overhead. Produce a concrete action plan with savings estimates.\n\n## What You Will Measure\n\n| Component | Loaded when | Typical range |\n|-----------|-------------|---------------|\n| `~\u002F.claude\u002FCLAUDE.md` + @imports | Always | 5–15K tokens |\n| Project `CLAUDE.md` | Always | 2–8K tokens |\n| `.claude\u002Frules\u002F*.md` | Always (all files) | 5–40K tokens |\n| `MEMORY.md` | Always | 1–3K tokens |\n| Claude Code system prompt | Always | ~7,500 tokens |\n| Commands, agents, skills | On invocation only | 0 by default |\n\nKey insight: `.claude\u002Frules\u002F` loads every `.md` file at session start. Commands and agents are lazy-loaded — zero cost until invoked.\n\n---\n\n## Step 1 — Run the Measurement\n\n```bash\necho \"=== PROJECT CLAUDE.md ===\" && wc -c CLAUDE.md 2>\u002Fdev\u002Fnull || echo \"none\"\n\necho \"\"\necho \"=== RULES FILES (sorted by size) ===\" && find .claude\u002Frules -name \"*.md\" 2>\u002Fdev\u002Fnull \\\n  | xargs wc -c 2>\u002Fdev\u002Fnull | sort -rn | head -20\n```\n\nThen calculate the full budget:\n\n```bash\nPROJECT=$(wc -c \u003C CLAUDE.md 2>\u002Fdev\u002Fnull || echo 0)\nRULES=$(find .claude\u002Frules -name \"*.md\" 2>\u002Fdev\u002Fnull | xargs cat 2>\u002Fdev\u002Fnull | wc -c || echo 0)\nTOTAL=$(( PROJECT + RULES + 30000 ))\n\necho \"Project CLAUDE.md  : ~$(( PROJECT \u002F 4 )) tokens\"\necho \"Rules (auto-loaded): ~$(( RULES \u002F 4 )) tokens\"\necho \"System prompt      : ~7,500 tokens\"\necho \"---\"\necho \"TOTAL fixed context: ~$(( TOTAL \u002F 4 )) tokens\"\necho \"% of 200K window   : $(( TOTAL \u002F 4 * 100 \u002F 200000 ))%\"\n```\n\n---\n\n## Step 2 — Classify Rules Files\n\n| Class | Definition | Action |\n|-------|------------|--------|\n| **ALWAYS** | Applies to most tasks (conventions, safety) | Keep auto-loaded |\n| **SOMETIMES** | Relevant in 20–40% of sessions | Keep if small (\u003C3K chars) |\n| **RARELY** | Relevant in \u003C10% of sessions | Remove from auto-load |\n| **NEVER** | Outdated or covered elsewhere | Delete or archive |\n\nFor each file in `.claude\u002Frules\u002F`, output:\n\n```\n| File | Size (chars) | Class | Reasoning (one sentence) |\n```\n\nSort by size descending within each class. Calculate total chars saved by removing RARELY and NEVER files.\n\n---\n\n## Step 3 — Audit Hook Overhead\n\nHooks on `PreToolUse` and `PostToolUse` fire on every tool call. Check what you have:\n\n```bash\npython3 - \u003C\u003C 'EOF'\nimport json, os\nfor path in [os.path.expanduser(\"~\u002F.claude\u002Fsettings.json\"), \".claude\u002Fsettings.json\"]:\n    if not os.path.exists(path): continue\n    print(f\"\\n--- {path} ---\")\n    data = json.load(open(path))\n    for event, hooks in data.get(\"hooks\", {}).items():\n        for h in hooks:\n            cmd = h.get(\"command\", \"?\")\n            matcher = h.get(\"matcher\", \"*\")\n            print(f\"  [{event}] matcher={matcher} → {cmd[:80]}\")\nEOF\n```\n\n**Red flags**: hooks that `cat` files unconditionally, `git status` on every call, multi-line debug echo never removed.\n\n---\n\n## Step 4 — Action Plan\n\n| Action | Estimated savings | Effort | Risk |\n|--------|------------------|--------|------|\n| Remove RARELY files from auto-load | varies | 30 min | Low |\n| Split large rules into core + detail | varies | 1–2h | Low |\n| Trim hook stdout to essential fields | varies | 1h | Low |\n| Archive outdated MEMORY.md entries | 500–1K tokens | 30 min | Low |\n\n---\n\n## Output Format\n\n```markdown\n## Token Audit — ctxharness — [DATE]\n\n### Budget Summary\n\n| Component | Tokens | % of total |\n|-----------|--------|------------|\n| Project CLAUDE.md | X | Y% |\n| Rules (auto-loaded) | X | Y% |\n| System prompt | 7,500 | Y% |\n| **TOTAL** | **X** | **100%** |\n\nContext window used before any task: X% of 200K\n\n### Rules Classification\n\n| File | Chars | Class | Action |\n|------|-------|-------|--------|\n\n### Action Plan\n\n| Action | Savings | Effort |\n|--------|---------|--------|\n\n**Total achievable without infrastructure**: -X tokens → N% reduction\n```\n\n## Interpreting Results\n\n| Fixed context | Assessment |\n|---------------|------------|\n| \u003C 20K tokens | Healthy — no urgent action needed |\n| 20–40K tokens | Moderate — grab easy wins |\n| 40–60K tokens | High — rules audit is worth an afternoon |\n| > 60K tokens | Critical — you are burning 30%+ of your window before any task |\n",{"name":5,"effort":42,"description":7,"allowed-tools":43},"medium","Read, Grep, Glob, Bash","main","3e6c35b1a7f2102b725738506412ea442d0190d2",".claude\u002Fskills\u002Ftoken-audit",4,"https:\u002F\u002Fgithub.com\u002FFlorianBruniaux\u002Fctxharness","https:\u002F\u002Fgithub.com\u002FFlorianBruniaux","https:\u002F\u002Fwww.florian.bruniaux.com\u002F","Hands-on Fractional Chief AI Officer. Harness & context engineering. RTK’s first contributor. Claude Code Ultimate Guide author.","2026-11-13 07:58:02",{"source":8,"skillName":5,"commands":54,"prompt":64,"zipAvailable":65},[55,58,61],{"tool":56,"command":57},"npx","npx skills add FlorianBruniaux\u002Fctxharness --skill token-audit",{"tool":59,"command":60},"bunx","bunx skills add FlorianBruniaux\u002Fctxharness --skill token-audit",{"tool":62,"command":63},"pnpm","pnpm dlx skills add FlorianBruniaux\u002Fctxharness --skill token-audit","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FFlorianBruniaux\u002Fctxharness\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Ftoken-audit\u002FSKILL.md",true,[],[68,76,81,88,100,111],{"skillNo":69,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":75},"01M7BAM1KJXB5SM2G241VMTQY9","demo","Demonstrate explicit profile expectations.","https:\u002F\u002Fgithub.com\u002FFlorianBruniaux\u002Fctxharness\u002Fblob\u002Fmain\u002Fpackages\u002Fcore\u002Fsrc\u002Fagent-config\u002F__fixtures__\u002Fprofile-expectations\u002Fsources\u002FB\u002F.claude\u002Fskills\u002Fdemo\u002FSKILL.md",[],[],"2026-11-15 14:19:17",{"skillNo":77,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":75},"01M7BAKZ1GGG5R2Z7HTV18NHDT","https:\u002F\u002Fgithub.com\u002FFlorianBruniaux\u002Fctxharness\u002Fblob\u002Fmain\u002Fpackages\u002Fcore\u002Fsrc\u002Fagent-config\u002F__fixtures__\u002Fprofile-expectations\u002Fsources\u002FA\u002F.claude\u002Fskills\u002Fdemo\u002FSKILL.md",[],[],{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":37},"01M71VB808H3VZ0E5BHQC950XR","review","Review safely","https:\u002F\u002Fgithub.com\u002FFlorianBruniaux\u002Fctxharness\u002Fblob\u002Fmain\u002Fpackages\u002Fcore\u002Fsrc\u002Fagent-config\u002F__tests__\u002Ffixtures\u002Fshared-release\u002Foutputs\u002Fskills\u002Fcommon\u002Freview\u002FSKILL.md",[],[83],{"skillNo":89,"name":90,"nameZh":6,"description":91,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":92,"categories":93,"keywords":94,"publishedAt":37},"01M71VB6WXST14H564778MTB6F","claude-helper","Claude-only fixture skill","https:\u002F\u002Fgithub.com\u002FFlorianBruniaux\u002Fctxharness\u002Fblob\u002Fmain\u002Fpackages\u002Fcore\u002Fsrc\u002Fagent-config\u002F__tests__\u002Ffixtures\u002Fshared-release\u002Foutputs\u002Fskills\u002Fclaude-only\u002Fclaude-helper\u002FSKILL.md",[],[95,96,97,98,99],"helper","claude helper","fixture","fixture skill","only",{"skillNo":101,"name":83,"nameZh":6,"description":102,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":103,"categories":104,"keywords":105,"publishedAt":37},"01M71VB4R1CQS9NJ64CJYKV18A","Review a change for correctness and missing tests.","https:\u002F\u002Fgithub.com\u002FFlorianBruniaux\u002Fctxharness\u002Fblob\u002Fmain\u002Fpackages\u002Fcore\u002Fsrc\u002Fagent-config\u002F__tests__\u002Ffixtures\u002Fscanner-project\u002F.claude\u002Fskills\u002Freview\u002FSKILL.md",[],[83,106,107,108,109,110],"change","for","missing","tests","correctness",{"skillNo":112,"name":113,"nameZh":6,"description":114,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":115,"categories":116,"keywords":117,"publishedAt":37},"01M71VB2JXKNY5YF92HW85GRZ1","parent-reference","Demonstrate a parent traversal reference escape.","https:\u002F\u002Fgithub.com\u002FFlorianBruniaux\u002Fctxharness\u002Fblob\u002Fmain\u002Fpackages\u002Fcore\u002Fsrc\u002Fagent-config\u002F__tests__\u002Ffixtures\u002Fscanner-project\u002F.claude\u002Fskills\u002Fparent-reference\u002FSKILL.md",[],[118,119,120,121],"reference","parent","parent reference","escape"]