claude-context-improver

claude-context-improver is a skill for Claude Code from bahayonghang/my-ai-cli-toolkit. It costs 173 tokens per session (5,180 once invoked), scanned A, original, MIT.

A tool for checking and improving the guidance files that Claude Code loads for a repository.

In plain words
What is it for?
It reviews CLAUDE.md files, path-specific rules, and code maps, then proposes focused improvements and can apply an approved plan.
Why use it?
It finds outdated, conflicting, overly long, or poorly organized instructions before they affect coding work.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: reads .claude/ paths; mentions CLAUDE.md; mentions subagents.

Good fit It reviews CLAUDE.md files, path-specific rules, and code maps, then proposes focused improvements and can apply an approved plan.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/bahayonghang/my-ai-cli-toolkit/claude-context-improver
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add bahayonghang/my-ai-cli-toolkit --skill claude-context-improver
Clone the repo
git clone --depth 1 https://github.com/bahayonghang/my-ai-cli-toolkit

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for claude-context-improver

README.md
[![agentmods](https://agentmods.dev/badge/skills/bahayonghang/my-ai-cli-toolkit/claude-context-improver.svg)](https://agentmods.dev/skills/bahayonghang/my-ai-cli-toolkit/claude-context-improver)
Your own site
<a href="https://agentmods.dev/skills/bahayonghang/my-ai-cli-toolkit/claude-context-improver"><img src="https://agentmods.dev/badge/skills/bahayonghang/my-ai-cli-toolkit/claude-context-improver.svg" alt="Measured on agentmods" height="20"></a>
Per session 173 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,180 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 9 findings, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Prompt Injection · line 66
    Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.
    Fix: Audit all comments and invisible characters. Remove any instructions that direct the agent to perform unauthorized actions. Use plain, reviewable content.
  • high Prompt Injection · line 72
    Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.
    Fix: Audit all comments and invisible characters. Remove any instructions that direct the agent to perform unauthorized actions. Use plain, reviewable content.
  • high Agent Snooping · line 112
    Skill reads from agent configuration directories (.claude/, .codex/, .gemini/). These directories may contain API keys, personal settings, and other credentials that the skill has no legitimate need to access.
    Fix: Remove all code or instructions that access agent configuration directories (.claude/, .codex/, .gemini/). If configuration values are needed, pass them explicitly as parameters or environment variabl
  • high Agent Snooping · line 119
    Skill reads from agent configuration directories (.claude/, .codex/, .gemini/). These directories may contain API keys, personal settings, and other credentials that the skill has no legitimate need to access.
    Fix: Remove all code or instructions that access agent configuration directories (.claude/, .codex/, .gemini/). If configuration values are needed, pass them explicitly as parameters or environment variabl
  • medium Prompt Injection · line 43
    Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.
    Fix: Remove the large whitespace padding (blank-line blocks or long space runs) and review any content hidden below or to the right of it. Keep skill files compact and reviewable so no instructions can be
  • medium Prompt Injection · line 91
    Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.
    Fix: Remove the large whitespace padding (blank-line blocks or long space runs) and review any content hidden below or to the right of it. Keep skill files compact and reviewable so no instructions can be
  • medium Prompt Injection · line 136
    Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.
    Fix: Remove the large whitespace padding (blank-line blocks or long space runs) and review any content hidden below or to the right of it. Keep skill files compact and reviewable so no instructions can be
  • medium Prompt Injection · line 170
    Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.
    Fix: Remove the large whitespace padding (blank-line blocks or long space runs) and review any content hidden below or to the right of it. Keep skill files compact and reviewable so no instructions can be
  • medium Rogue Agent · line 189
    Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
    Fix: Remove any persistence mechanisms (cron jobs, startup scripts, state files). Skills should not maintain state across sessions without explicit user consent.
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00173 $0.05180
Opus 5 $0.00086 $0.02590
Sonnet 5 $0.00035 $0.01036
Haiku 4.5 $0.00017 $0.00518

Measured 8d ago against content hash 8043fd90a742, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

claude-context-improver scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Reads agent configuration directorieslowAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

find . -path '*/.claude/rules/*.md' -not -path './.git/*' -not -path './node_modules/*'

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

skills/developer-tools-integrations/claude-context-improver/SKILL.md · 272 lines

How it starts

The opening of the file, as written. The whole thing — 272 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Claude Context Improver

Audit and improve the context Claude Code loads before it sees a prompt: CLAUDE.md guidance files, .claude/rules/ path-scoped rules, and the companion code_map.md navigation map. The goal is a context layer that is concise, current, conflict-free, and progressively disclosed — sized for Claude 5 generation models rather than for the weaker models most existing guidance was written against.

Default mode is report-first. Output a quality report and proposed diff before writing. If the user explicitly asks to implement an approved plan, continue directly to targeted edits and verification.

Relationship to /doctor. Claude Code's bundled /doctor is Anthropic's automated rightsizer for skills and CLAUDE.md. This skill is the repo-tailored, report-first companion: it scores against a rubric, verifies claims against the actual codebase, covers code_map.md and .claude/rules/, and shows diffs before editing. Recommending a /doctor run alongside the report is reasonable; neither replaces the other.

Trivial edit fast path. If the request is a single scoped edit the user has already specified (add or fix one line or one small section in an identified file), skip the scope question and the full workflow: apply the edit directly, checking only that hook marker blocks stay intact, the file stays under the 200-line target, and no @code_map.md import is introduced. Everything below applies to audit and optimization requests.

Context Engineering Principles (Claude 5)

Anthropic removed over 80% of Claude Code's system prompt for Claude Opus 5 and Fable 5 with no measurable loss on coding evals. The same over-constraining that hobbled the system prompt hobbles most CLAUDE.md files. Audit against these shifts:

Then Now
Give Claude rules Let Claude use judgement — phrase intent, reserve absolutes for expensive mistakes
Give Claude examples Design interfaces — expressive parameters and contracts beat example walls that narrow the space
Put it all upfront Progressive disclosure — a tree of files loaded at the right time, not one central repository
Repeat yourself Say it once, in the layer that owns it
Memory in CLAUDE.md Auto-memory — session facts and decisions are saved automatically, not pasted into guidance
Simple specs Rich references — specs-as-code, test suites, HTML artifacts, and rubrics beat restated prose

Read the full file on GitHub · 272 lines

Files

What ships with it

7 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 272 lines · 173 tokens per session scan A 8043fd90a742

Subscribe to this mod's changes

claude-context-improver is a skill published in the GitHub repository bahayonghang/my-ai-cli-toolkit (16 stars, last pushed today), licensed MIT. It adds 173 tokens to every session and 5,180 once invoked, about $0.0009 per session on Opus 5. A static security scan graded it A with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.