adamlinscott/claude-skills/context-audit
Claude Code and agent skill by adamlinscott/claude-skills
- community
- ext:[{"type":"config","description":"Configuration overrides"}]
Checking that the SKILL.md file is still in the repository.
[Adam''s Skills] Audits a repository''s Claude context-injection setup — CLAUDE.md, CONTEXT.md, docs/, .claude/agents/, and the per-project memory directory. Reports bloat, broken links, orphaned docs, security risks, missing rules in subagent prompts, settings that override agents'' model or effort, and conflicts between memory and project instructions. Use when the user asks to audit their Claude setup, asks "what''s wrong with my CLAUDE.md", wants to know if their agents/memory/docs are conf…
Install
npx vskill@latest install adamlinscott/claude-skills/context-auditSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as adamlinscott/claude-skills/context-audit.
Context audit
Audit the context that gets injected into every Claude session in the current repository. The goal: identify everything that could be working against the agent — security risks, conflicts, bloat, orphaned docs, broken links, and rules that exist in memory but never reach subagents.
Read-only. Print one markdown report. Do not modify any files. (The skill is granted no edit tools, so this is enforced, not just asked.)
Scope note. This is a whole-setup audit. For a deep, classification-based review of the memory directory on its own (Keep / Move / Refresh / Merge / Drop), defer to /memory-audit. Here, assess memory only where it interacts with the rest of the context: conflicts, subagent gaps, and stale references.
What to read
- `CLAUDE.md` at the repo root, plus any nested
CLAUDE.mdfiles (Glob "**/CLAUDE.md"). - `CONTEXT.md` at the repo root and anywhere it appears.
- Everything under `docs/` (
Glob "docs/**/*.md"). - Every agent file under `.claude/agents/` (
Glob ".claude/agents/*.md") — note each agent'sdescription,toolsfrontmatter, and body. - The repo's `.claude/settings.json` and `.claude/settings.local.json` if present.
- The repo's per-project memory directory (Claude's per-user memory, scoped to this repo). To locate it reliably, list
~/.claude/projects/and pick the directory whose name is the current repo path with every:,/, and\replaced by-(e.g.C:\Users\me\proj→C--Users-me-proj— note the double dash where:meets\). Match against the actual listing rather than hand-building the path from a guessed rule.
- The index is
MEMORY.md; sibling.mdfiles are individual memories. Read all of them, including any not listed inMEMORY.md. - Note each memory's declared
type(user / feedback / project / reference) from its frontmatter. - If the directory does not exist, note that no per-project memory has been set up and continue.
- Agent tuning overrides. Three variables, read by name only — never dump the whole
environment, which can hold secrets: CLAUDE_CODE_EFFORT_LEVEL, CLAUDE_CODE_SUBAGENT_MODEL, CLAUDE_CODE_SUBAGENT_MODEL_FORCE. Check each in the shell environment (printenv CLAUDE_CODE_EFFORT_LEVEL), in the env block of ~/.claude/settings.json, and in the env block of the repo's .claude/settings.json and .claude/settings.local.json. Then read the name, model and effort frontmatter of every agent under ~/.claude/agents/ (recursive, following links): installed agents live there, not in the repo.
What to check
Security
- "Don't ask permission" / "just do it" / "no need to confirm" instructions that bypass the permission system. Flag and recommend using
.claude/settings.jsonallowlists instead. - Hard-coded credentials, API keys, tokens, or secrets in any context file.
- Instructions that authorise irreversible operations (push, force-push, delete, deploy, post-to-external) without confirmation.
- Overly broad tool access in agent frontmatter (
tools: *,tools: All tools) when the agent's role doesn't justify it. - Agents that can write/edit and also have network egress (
WebFetch, vendor MCPs) without scoping. - In
.claude/settings.json/.claude/settings.local.json: a repo-widedefaultModeofbypassPermissions(or broadacceptEdits), an over-broad permission allowlist (e.g.Bash(*),Bash(rm *),Bash(curl *)), orhooksthat run unreviewed shell commands. Flag each with the specific risk it creates.
Conflicts
- A memory feedback rule that directly contradicts a rule in CLAUDE.md or an agent prompt.
- Two agents claiming overlapping responsibility without a delegation hint distinguishing them.
- CLAUDE.md and an agent file disagreeing on the same convention (naming, testing, error handling, etc.).
- Memory feedback files whose claims contradict each other.
Agent tuning overrides
An agent's model and effort frontmatter are how a team decides that a cheap job runs on a cheap model and judgement runs on a strong one. Two settings override that silently, for every agent at once. This precedence was measured on Claude Code 2.1.289; the docs disagree with each other on it:
- `CLAUDE_CODE_EFFORT_LEVEL` overrides every agent's own
effort. Flag it, and name the agents
that set effort.
- `CLAUDE_CODE_SUBAGENT_MODEL` together with `CLAUDE_CODE_SUBAGENT_MODEL_FORCE` (set, and not
0 or false) overrides every agent's own model. Flag it, and name the agents that set model.
- `CLAUDE_CODE_SUBAGENT_MODEL` without FORCE does not touch an agent that pins its model. Report
it as information only, naming the agents with no model line, which do take it.
- Do not flag
effortLevelin settings, or--effort//effort. An agent's owneffortbeats
all three.
Say where each one is set. A project settings file applies to everyone who opens the repo; a user setting or the shell applies only to this machine. Either may be deliberate, so recommend confirming, not removing.
Missing rules in subagents (the big one for AI-quality)
Subagents do not see the user's memory files — they only see their own system prompt. For each memory feedback item that states a universal coding/style rule (not a personal preference, not agent-behaviour governance), check whether the project's coding agent (whatever the repo names it under .claude/agents/, e.g. coder.md or builder.md) has an equivalent rule in its body. If not, flag as a gap — every fresh subagent invocation will re-violate it.
Distinguish:
- Universal rules worth promoting to the subagent (naming conventions, error-handling requirements, no-unilateral-interface-changes, etc.) — flag the gap.
- Personal style preferences the user has explicitly classified as their own (preferred idioms, formatting choices, etc.) — do not flag.
- Agent-behaviour rules (e.g. "don't run deep git archaeology", "don't pipe tool output through ad-hoc scripts") — memory is the correct home; do not flag.
Legacy prompting patterns
Instructions age badly. Each Claude generation ships with its own prompting notes, and some of that advice inverts — a line that fixed a real problem two model releases ago now causes the opposite one. Nobody goes back and deletes those lines, so a mature CLAUDE.md accumulates them, and they are invisible precisely because they used to work.
Flag each of the following, quoting the line and saying what it now causes:
- Mandated self-verification — "double-check your answer", "always re-verify before
responding", "include a final verification step for any non-trivial task", "use a subagent to verify your work". Current models self-check; the instruction compounds with that and spends extra passes on work that was already correct. Fix: delete rather than reword.
- Anti-laziness and thoroughness prompting — "always be thorough", "if in doubt, use
\<tool\>", "default to using \<tool\>", "read as many files as you can before answering". Written when tools under-triggered. They now over-trigger. Fix: narrow to when the tool actually helps ("use \<tool\> when it would clarify the problem"), or delete.
- Shouted emphasis —
CRITICAL:,YOU MUST,NEVER EVER, ALL-CAPS imperatives, and
emphasis stacked on ordinary instructions. Models are far more responsive to the system prompt than the generation these were written for, so the volume now buys over-triggering rather than compliance. Fix: normal prose — "Use this when…" instead of "CRITICAL: You MUST use this when…".
- Conservatism filters on review instructions — "only report high-severity issues", "be
conservative", "don't flag minor problems". Taken literally, these make the model report less rather than judge better, and the findings lost are the marginal ones a human would have wanted to see. Fix: ask for everything, ranked, and filter in a separate pass.
- Mandated subagent fan-out — "always delegate to subagents", "spawn an agent per module",
"use parallel agents for exploration". Models now delegate readily on their own; the standing advice is to damp it. Fix: state when delegation is warranted, or delete.
- Blanket anti-formatting blocks — long "never use bullet points / headers / bold" sections.
Written against models that over-formatted. Newer ones under-format, and a block like this suppresses structure the content needed. Fix: replace with a rule about when formatting helps.
- Narration suppression — "hold all findings for the final response", "do not comment
between tool calls". These now produce an agent that goes silent for minutes. Fix: say what a good update looks like instead.
- Stale model identifiers, in context files and in code the docs point at —
claude-3-*,
claude-*-4-5, or any pinned model string that is no longer current. Also flag budget_tokens and manual extended-thinking config, which is deprecated in favour of effort. Verify against the claude-api skill or current docs rather than from memory; do not assert an ID is stale without checking.
- Instructions not to think or reason. Rare, but worth catching: they increase internal-tag
leakage into visible output rather than reducing reasoning. Fix: delete; control cost with effort instead.
Do not flag a safety gate as over-emphasis. This is the failure mode of this whole section, and it is worse than the problem it solves. "Never publish without explicit confirmation", "never force-push", "always show the user the finished text before filing" are load-bearing controls on irreversible or externally-visible actions, and their emphasis is doing real work. The test is what the line protects: emphasis on an irreversible or outward-facing act stays; emphasis on an ordinary working instruction is the thing to dial down. When you are unsure which one you are looking at, leave it and say why.
State plainly at the top of this section which model generation's guidance you are applying, and that these are calibrations rather than errors — the lines were correct when written.
Bloat
- CLAUDE.md sections over ~20 lines covering a single domain that most sessions don't touch. Recommend moving the detail to
docs/<domain>/and replacing with a one-line pointer. - Repeated explanations of the same concept across CLAUDE.md, agent files, and docs.
- CLAUDE.md over ~400 lines total — every session pays the token cost.
- Agent prompts over ~800 lines that include content most invocations won't use.
The next three checks are lookups, not judgement. Collect what they need while reading — every file cited by a CLAUDE.md or agent file, every path or symbol a memory or doc names, the top-level modules, and the docs under docs/ — and hand it to the scout agent in one call (Agent tool, subagent_type: scout; general-purpose if it is not installed, and say so in a line). It returns what exists, what is missing, and what references each doc, with path:line. Turning those results into findings stays with you.
Broken or missing links
- Files referenced from CLAUDE.md or an agent file that do not exist on disk (
Globto verify each citation). - Docs under
docs/that no CLAUDE.md, agent file, or README references (orphaned). - Bidirectional back-references between CLAUDE.md and docs ("see CLAUDE.md §X" inside a doc that CLAUDE.md already points to) — pick one direction; the doc should be the source of truth and CLAUDE.md should link to it, not vice versa.
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/context-audit/SKILL.md
Popularity
- Repository stars
- 3
- 7-day trend score
- 7
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Extension points
configConfiguration overrides
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/adamlinscott/claude-skills/context-audit)