Claude Code Context Window Audit Capability Pack Skill
Expert Claude Code context window audit capability pack for measuring what loads at session start, what each read and extension adds, when compaction drops path-scoped rules, and how to delegate or compact before quality drops.
Open the source and read safety notes before installing.
Safety notes
- This skill recommends context-management actions; it must not run `/compact`, `/clear`, or delete local memory files without explicit user approval.
- `/compact` and automatic compaction summarize conversation history and can drop path-scoped rules until matching files are read again.
- Moving always-on instructions from path-scoped rules into project-root `CLAUDE.md` changes what survives compaction; show the proposed diff first.
- Subagent delegation isolates large reads but still consumes tokens in the subagent window; do not spawn many parallel subagents without a cost plan.
- Prompt-cache invalidation from model switches, large CLAUDE.md edits, or mid-session settings changes can cause expensive uncached turns.
Privacy notes
- `/context` breakdowns, `/memory` listings, and session transcripts can expose repository paths, branch names, MCP server names, hook commands, and internal project structure.
- Compaction summaries may retain task details, credentials mentioned in chat, customer names, or incident context unless redacted before sharing.
- Auto memory and nested `CLAUDE.md` files may contain team-specific conventions, URLs, or identifiers that should not be pasted into public issues.
- Public PR or support notes should summarize pressure categories and recommended actions, not full `/context` output or complete transcript dumps.
Prerequisites
- An active or recently compacted Claude Code session where context pressure, cost, or recall quality is a concern.
- Permission to run `/context`, `/memory`, and optionally `/compact` or `/clear` in the affected session.
- Redacted access to project and user `CLAUDE.md`, `.claude/rules/`, skill descriptions, MCP server list, and hook configuration when relevant.
- A concrete symptom such as repeated compaction, rising token cost, missed conventions, or degraded tool selection.
Schema details
- Install type
- package
- Reading time
- 9 min
- Difficulty score
- 79
- Troubleshooting
- Yes
- Breaking changes
- No
- Scope
- Source repo
- Skill type
- capability-pack
- Skill level
- expert
- Verification
- validated
- Verified at
- 2026-06-13
| Platform | Support | Install path |
|---|---|---|
| claude-code | Native | .claude/skills/<skill-name>/SKILL.md |
| codex | Native | .agents/skills/<skill-name>/SKILL.md |
| windsurf | Native | .windsurf/skills/<skill-name>/SKILL.md |
| gemini | Native | .gemini/skills/<skill-name>/SKILL.md or .agents/skills/<skill-name>/SKILL.md |
| cursor | Adapter | .cursor/rules/<skill-name>.mdc |
| cli | Manual | AGENTS.md or tool-specific context file |
Full copyable content
# Trigger
"Apply the Claude Code context window audit capability pack to this session."
# Required output
1) Session context inventory and primary pressure lane
2) Source-backed review of startup load, reads, skills, MCP, rules, and hooks
3) Compaction-survival assessment for CLAUDE.md, rules, skills, and nested files
4) Minimal reduction plan with /context, /compact, /clear, or subagent delegation
5) Privacy-safe summary of local paths, settings, and transcript excerpts reviewedAbout this resource
Knowledge Freshness
This capability pack is grounded in Claude Code context window, features overview, cost management, configuration debugging, prompt caching, and skills documentation verified on 2026-06-13. Prefer live official docs over remembered token estimates when reviewing new Claude Code releases or model variants with extended context.
Retrieval Sources
- https://code.claude.com/docs/en/context-window
- https://code.claude.com/docs/en/features-overview
- https://code.claude.com/docs/en/costs
- https://code.claude.com/docs/en/debug-your-config
- https://code.claude.com/docs/en/prompt-caching
- https://code.claude.com/docs/en/skills
- https://github.com/anthropics/claude-code
- https://developers.google.com/search/docs/fundamentals/creating-helpful-content
Scope Note
This is not a generic prompt-engineering guide. Use it as a reusable audit
workflow when a Claude Code session is hitting context limits, losing
path-scoped rules after compaction, or spending tokens on startup load that
should be on-demand. For step-by-step cost guidance, the adjacent docs at
content/guides/ and official cost pages remain references, not duplicates of
this audit contract.
Core Workflow
- Capture the symptom lane: slow turns, rising cost, missed rules, wrong skill selection, auto-compact thrashing, or inability to read needed files.
- Run
/contextfor a live category breakdown and note the largest buckets: system prompt, CLAUDE.md, skills, MCP, messages, tool results, and hooks. - Run
/memoryto confirm which project-rootCLAUDE.md, auto memory, and nested files loaded at startup versus on demand. - Inventory extension load from the features overview: CLAUDE.md (every request), skill descriptions (every request unless user-only), MCP tool names at start, path-scoped rules (on matching file reads), hooks (zero unless they return output), and subagents (isolated window).
- Classify recent growth drivers: large file reads, verbose tool results, many invoked skills, MCP schema expansion, hook output injected into context, or long multi-task conversation history.
- Assess compaction survival. Project-root
CLAUDE.md, auto memory, system prompt, and invoked skill bodies reload; path-scoped rules and nestedCLAUDE.mdare summarized away until a matching file is read again. - Check skill truncation rules after compaction: invoked skill bodies re-inject
with per-skill and total caps; confirm critical instructions are near the top
of
SKILL.mdfiles. - Recommend one reversible action at a time: focused
/compact,/clearbetween unrelated tasks, subagent delegation for large reads,disable-model-invocationfor side-effect skills, or moving must-survive rules to project-rootCLAUDE.md. - Define verification: rerun
/context, confirm expected rules still apply after compaction, and validate cost or recall improvement on the next task slice.
Capability Scope
- Live context breakdown interpretation with
/context. - Startup load review for CLAUDE.md, auto memory, skills, and MCP.
- Compaction survival matrix for rules, nested CLAUDE.md, and skill bodies.
- Subagent delegation planning for large reads and research tasks.
- Prompt-cache and model-switch impact awareness.
- Privacy-safe reporting of context pressure findings.
Compatibility
Native
- Claude Code / Claude: use as an Agent Skill when auditing an active session, reviewing extension configuration, or preparing a compaction strategy.
Manual Adaptation
- Codex, Cursor, Windsurf, and Generic AGENTS workflows: use the workflow as a deterministic checklist for diagnosing Claude Code context pressure in support tickets, onboarding docs, or team runbooks.
Required Inputs
- Symptom description and when it started relative to compaction or task switches.
/contextcategory breakdown or equivalent observation of pressure.- Redacted lists of loaded skills, MCP servers, rules, and large recent reads.
- Model alias in use and whether extended
[1m]context is available on the plan.
Production Rules
- Treat context as the primary constraint; do not add more extensions before measuring existing load.
- Prefer
/clearbetween unrelated tasks instead of one long mixed conversation. - Use focused
/compactwith instructions before automatic compaction guesses what matters. - Delegate large research reads to subagents so file contents stay out of the main window.
- Do not move sensitive always-on secrets into
CLAUDE.mdjust to survive compaction; use safer project conventions instead. - Redact paths, customer names, credentials, and hook commands before posting public summaries.
Review Matrix
| Symptom | First route | Safer first check |
|---|---|---|
| Rules stop applying after long session | Compaction survival | Confirm path-scoped rules vs project-root CLAUDE.md |
| Cost spikes after model change | Prompt caching | Check cache invalidation and recent settings edits |
| Wrong skill keeps loading | Skill descriptions | Review overlapping descriptions and user-only flags |
| Cannot read needed files | Context pressure | Run /context and compact or delegate before more reads |
| Verbose tool output dominates | Tool results | Summarize or delegate; avoid re-pasting large outputs |
| Startup feels heavy before first prompt | Startup load | Review CLAUDE.md size, skill count, and MCP server list |
Output Contract
- Context inventory and primary pressure lane.
- Evidence reviewed, including
/contextcategories and redaction notes. - Compaction-survival assessment for rules, skills, and nested files.
- Minimal reduction recommendation with exact command or configuration change.
- Verification checklist for the next task slice.
- Privacy-safe summary suitable for an issue, runbook, or support handoff.
Duplicate Check
Checked content/skills, content/guides, generated catalog text, and open
pull requests for Claude Code Context Window Audit, context window audit,
/context, compaction survival, and token reduction workflows. Official docs
cover context interactively, but no skills entry provides a reusable Claude
Code context window audit workflow with output contract and review matrix. This
entry complements cost and best-practices guides without duplicating them.
Editorial Disclosure
Submitted as an independent source-backed HeyClaude content entry by
kiannidev. It is based on public Claude Code documentation, the public
Anthropic claude-code repository, and Google Search Central helpful-content
guidance. No paid placement, referral link, affiliate link, or vendor
sponsorship is used.
Source citations
Signals
Loading live community signals…
A short, calm digest of reviewed Claude resources. Unsubscribe any time.