Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    Agent Rules Audit: Trim AGENTS.md and CLAUDE.md Bloat

    1

    The same paragraph gets pasted into CLAUDE.md, AGENTS.md and a nested copy, and an old rule sits beside the one that replaced it.

    $5.99

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned
    Agent Rules Audit: Trim AGENTS.md and CLAUDE.md Bloat

    Agent Rules Audit: Trim AGENTS.md and CLAUDE.md Bloat

    Example session with this skill installed

    My agent keeps ignoring half my rules and every session starts heavy. I usually start in apps/mobile. Audit the instruction files in this repo and tell me what I can cut.

    • Read your context and instructions
    • Compiled the agent rules audit

    6 instruction files, one pulled in by an import: 3,090 to 3,974 tokens in total (estimate), 39.3 percent of the text duplicated. 11 duplicate clusters, 4 dead references, 2 machine-specific paths, 2 contradiction candidates.

    Load set from apps/mobile (rows overlap, don't add them):

    AgentAlways loadedTokens (estimate)DuplicatedProjected saving
    Claude Code3 files1,742 to 2,2417.8 percent135 to 174
    Codex1 file1,026 to 1,3200 percent0
    GitHub Copilot2 files1,198 to 1,5416.2 percent74 to 96

    Largest clusters

    • Browser testing rules (exact): AGENTS.md:46-54, CLAUDE.md:48-56, apps/mobile/CLAUDE.md:13-21. The nested copy is what Claude Code loads twice.
    • TypeScript style (subset): four copies, the longest in .cursor/rules/style.mdc:7-16.
    • Git workflow (partial): AGENTS.md:56-62 and CLAUDE.md:58-64 share four lines.

    Dead references: docs/RELEASE.md (3 places), docs/CONTRIBUTING.md, scripts/deploy.sh, and the folder artifacts/screens.

    Machine-specific paths: C:/Users/dev/Android/Sdk at CLAUDE.md:84, /home/dev/android-sdk/system-images at apps/mobile/CLAUDE.md:10.

    Contradiction candidates

    1. "Always create a feature branch." (AGENTS.md:58, .github/copilot-instructions.md:15) against "Never create a branch without asking." (CLAUDE.md:60).
    2. "Always run the full test suite before you commit." (AGENTS.md:40, CLAUDE.md:42) against "Do not run the full test suite for copy changes." (apps/mobile/CLAUDE.md:25).

    Which rule is current in each pair?

    Next: I'd delete the nested Browser testing rules copy first, taking Claude Code's load set to an estimated 1,607 to 2,067 tokens. Nothing changes until you approve each merge.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Rule files only grow. The same paragraph gets pasted into CLAUDE.md, AGENTS.md and a nested copy, and an old rule sits beside the one that replaced it. Every session loads all of that before your first question, and when the agent follows the wrong one of two rules you can't see why.

    What your agent does

    • Asks which folders count: the repo root by default, plus only the user-level files or folders you name.
    • Runs one read-only script: rules_audit.py finds the instruction files of seven agent families (Claude Code, Codex, Gemini CLI, Cursor, GitHub Copilot, Windsurf, Cline) and writes a Markdown report plus JSON.
    • Gives the numbers first: the estimated token range each agent loads from the directory you start sessions in, and the share of it that is duplicated.
    • Walks the duplicate map: each cluster with every location as file:start-end, labelled exact, near, subset or partial, with a diff where the wording drifted.
    • Lists what's broken: dead file references and machine-specific paths with file and line, and contradiction candidates side by side for you to answer.
    • Merges with approval: proposes a slimmer layout, applies one approved merge at a time, then reruns and reports before and after.

    Built-in guard rails

    • Token figures are always an estimated range (characters / 4.5 to characters / 3.5). The report never prints a money amount.
    • A contradiction pair stays a candidate until you say which rule is current.
    • Every edited file is copied to a backup folder you choose first. Safety, credential, account and approval rules aren't removed or moved without a yes for that block.
    • The script has no network code, refuses a home directory or filesystem root as --root, and never opens an import that looks like a secrets file.

    What's inside

    • SKILL.md: nine-step workflow, 10 hard rules, limits.
    • scripts/rules_audit.py and scripts/agents.json: the audit and its editable discovery patterns.
    • 5 reference files: how agents load rules, reading the report, slim layout, contradiction triage, merge playbook.
    • fixtures/sample-repo/: 11 files with planted findings.
    • 105 unit tests in 1 test file.

    The load set is a model built from agents.json, so confirm it with your agent's own tooling.

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Prompt & Skill Engineering.

    Token figures are estimates from character counts, and the load set is a model, so neither is exact for your agent. Contradiction candidates come from word overlap and can miss conflicts. Paths with spaces can be cut. System prompts, memory, skills and MCP text aren't measured.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed today

    Software
    Python 3 (3 point 8 or later)A repo with agent instruction files
    Claude Code
    orCodex
    orCursor
    Optional
    User-level rule files passed with extraA backup folder for approved mergesAn edited agents map file

    Permissions

    Terminal / Shell
    Read Files
    Write Files
    Listedtoday

    What's inside

    Frequently Asked Questions

    No. It's a range from character counts (characters / 4.5 to characters / 3.5). Real tokenisers differ, more so for code, tables and non-English text.

    No. The load set is a model built from `scripts/agents.json`. Agents change between versions and honour settings the script doesn't read, so confirm with the agent's own tooling and edit the JSON when it drifts.

    The script is read-only. Your agent edits a file only after you approve that specific merge, and it copies the file to a backup folder you choose first.

    They're candidates. The script pairs directive sentences with opposite wording and shared subject words without understanding meaning, so some pairs are a rule and its exception. Conflicts phrased in different words, and rules without an always, never or avoid style word (a "prefer" rule, say), can be missed.

    New in Prompt & Skill Engineering