Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsBlogPro
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges
  • Chrome Extension
  • Skill Manager

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Context Audit

ASecurity

Audits everything that enters an agent's context — skills, agent definitions, CLAUDE.md/AGENTS.md, rules files, MCP servers, tool surfaces — and reports what to cut, merge, or migrate off MCP. Measures the context budget and judges how files relate across repo and user-global scope. Use when reviewing a diff that touches agent-facing text or MCP config, when context feels bloated, when a stated rule is being ignored, or when asked to census or shrink agent configuration. Don't use for prose q...

3 stars
0 votes
0 copies
0 views
Added 10/2/2026
ai-agentsgoshellgitapi

Works with

claude codecliapimcp

Security Analysis

A100/100

Pro scans all 4 files and shows the line behind each finding

Scanned 10/2/2026

$npx -y skills add ashugaev/spur --skill context-audit --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Context Audit?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Context Audit
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ashugaev-context-audit/badge)](https://www.skillsdirectory.com/skills/ashugaev-context-audit)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
Files
SKILL.md
---
name: context-audit
description: Audits everything that enters an agent's context — skills, agent definitions, CLAUDE.md/AGENTS.md, rules files, MCP servers, tool surfaces — and reports what to cut, merge, or migrate off MCP. Measures the context budget and judges how files relate across repo and user-global scope. Use when reviewing a diff that touches agent-facing text or MCP config, when context feels bloated, when a stated rule is being ignored, or when asked to census or shrink agent configuration. Don't use for prose quality inside a single file (skill-writer), code simplification (code-simplifier), or published docs (docs).
---

CONTEXT AUDIT

<skill dir> means the directory holding this file: .claude/skills/context-audit
for Claude, .agents/skills/context-audit for Codex.


MODES

  SCOPED      one diff        check only surfaces the diff touches
  SWEEP       everything      <skill dir>/scripts/census.sh [repo_root]
                              <skill dir>/scripts/mcp-scope.sh [repo_root]
  NEGOTIATE   one surface     see NEGOTIATE below

  Diff -> SCOPED. First run, or "audit my context config" -> SWEEP.
  Contested cut -> NEGOTIATE.


MCP PROTOCOL

Keep MCP only when a CLI cannot do the job. Default is migrate.

  Order   migrate anything with a CLI
          demote every user-scope server owned by one project
          disable never-called tools on what remains, re-measure

  Scope   one repo, shareable       project, .mcp.json, committed
          one repo, private creds   local
          every session, no CLI     user

Mapping and keep-list live in <skill dir>/scripts/mcp-scope.sh, functions
cli_for and verdict_for. They are what runs.

Keep MCP when the mapping has no entry:

  live stateful loop, driving a browser across turns
  harness with no shell
  per-user OAuth with tenant isolation and audit trail
  push or streaming channel that originates events, which a CLI cannot

Traps:

  Prove the replacement CLI before removing the server. Run one real read,
  show the output. cli_status=found means on PATH, not authenticated.
  Untested CLI, server stays.
  Back up any surface outside the repo before editing it. Manual copy into
  `~/.spur/agent-backups/<UTC>--<label>/`, no script. Repo-tracked file
  needs none, git already holds it.
  Per-tool disable is unproven. Re-measure /context after, remove the whole
  server if the schema persists.
  Never cut on INERT alone. Absence from claude mcp list first, cut second.


CHECKLIST

Ranked by yield.

  1   MCP server with a CLI equivalent        mcp-scope.sh, cli_status=found
  2   User-scope server owned by one project  scope=user, name matches one repo
  3   Tool search off                         /context vs ENABLE_TOOL_SEARCH=false
  4   Two surfaces answer one question twice  grep the directive noun everywhere
  5   Same rule stated twice                  same grep, identical intent
  6   Always-loaded over budget               SUBTOTAL always <vendor> for this
                                              session's vendor, CLAUDE.md under 200 lines
  7   Over 50 imperative lines in one surface count verb-initial lines
  8   Content derivable from the codebase     dir trees, dep lists, architecture prose
  9   Instructions the model already follows  persona, verify-your-work, if-in-doubt-use-X
  10  Two descriptions match one trigger      read every description side by side
  11  Prohibition that must be a guarantee    move it to a PreToolUse hook
  12  Dangling path reference                 extract backticked paths, test -e each

Excluded on purpose: mirror drift, repo-shaped not portable. Instruction
position within a file, vendor-measured and unreplicated. Politeness and
filler, skill-writer owns it.


NEGOTIATE

Cuts settled by two opposed subagents, spawned in parallel through the
runtime's own native mechanism: Claude's built-in parallel subagents,
Codex's multi_agent. Never a Spur session. Neither role is a separate
agent definition file.

  1  Input is the surface text plus the candidate cut list from CHECKLIST.
  2  Spawn CUT and KEEP in parallel. Neither sees the other's output.
       CUT    propose the maximal cut. One line per cut naming why it is
              derivable, duplicated, stale, or already model-default.
       KEEP   for each candidate name the concrete failure that follows the
              cut, a specific wrong action the agent would then take.
              A defense naming no failure is not a defense.
  3  Merge deterministically in the caller, not a third agent:
       proposed, undefended                        cut
       defended, failure already prevented elsewhere  cut, cite the preventer
       defended with a live failure                one rebuttal round for CUT
                                                   only: concede or refute
  4  Still unresolved, report CONTESTED with both one-line arguments.
     Never auto-cut a contested line.


MEASURE

claude -p "/context" prints a category table plus per-item tables for MCP
tools, skills, memory files, custom agents. One real API turn, run on
request only.

  Ground truth total:
  claude -p "hi" --output-format json | jq '.usage | .input_tokens + .cache_creation_input_tokens + .cache_read_input_tokens'

Traps:

  ~/.claude/settings.json mcpServers is not read by Claude Code 2.1.220.
  Effective config comes only from claude mcp list.
  codex debug prompt-input excludes tool schemas, so it undercounts exactly
  what the MCP protocol cares about. Never source MCP findings from it.
  bytes/4 is prose-calibrated and wrong for JSON tool schemas. MCP token
  figures come only from the measured /context table.


REPORT

  Columns   finding, surface, est_tokens, verdict, evidence
  Order     tokens saved x adherence recovered, highest first
  Verdict   migrate | cut | keep | CONTESTED
  Write to  $SPUR_SESSION_ARTIFACTS_DIR/context-audit/findings.txt, plain text


BOUNDARIES

Prose form and prose quality inside one surface: skill-writer.
Command and config field semantics: docs/commands.md, docs/configuration.md,
docs/daemon-api.md, plus the spur skill.


EVIDENCE

Every number traces to references/evidence.md. No URLs here.

Attribution

ashugaevashugaev
View sourceSee grades on GitHubMore from ashugaev →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Caveman

Terse caveman voice: answer first, fluff gone, every technical fact kept. Use for /caveman, "caveman mode", "talk like caveman", "be brief", "less tokens". Stays on until "stop caveman" or "normal mode".

1100021 votes

Hyperplan

Adversarial multi-agent planning skill. Self-orchestrates 5 hostile category members (unspecified-low, unspecified-high, deep, ultrabrain, artistry) via team-mode for ruthless cross-critique debate, distills only the defensible insights, then MANDATORILY hands the distilled insight bundle to the `plan` agent for executable plan formalization. Use when planning needs maximum rigor and surfacing of weak assumptions, blind spots, and over-engineering. Triggers: 'hyperplan', 'hpp', '/hyperplan', ...

698461 votes

Writing Skills

Create and manage Claude Code skills in HASH repository following Anthropic best practices. Use when creating new skills, modifying skill-rules.json, understanding trigger patterns, working with hooks, debugging skill activation, or implementing progressive disclosure. Covers skill structure, YAML frontmatter, trigger types (keywords, intent patterns), UserPromptSubmit hook, and the 500-line rule. Includes validation and debugging with SKILL_DEBUG. Examples include rust-error-stack, cargo-dep...

3931 votes

Mcp Code Execution

Routes multi-tool workflows through MCP servers for large datasets and pipelines. Use when Bash tool overhead is limiting throughput on data-heavy tasks.

3421 votes

catchup

Recovers the conversation and failed tool calls of a previous Codex, Amp, Claude Code, Antigravity, Cline, Copilot CLI, Cursor, DeepSeek Harness, Grok Build, Kimi, OpenCode, Pi Agent, or ZCode session. Use when the user says "catch up", "what did the last session do", "get me up to speed", "I switched agents", asks to recover/summarize a previous session before continuing, or asks to diagnose or report a catchup failure. Do NOT use for the current conversation, git history, or any non-agent log.

741 votes
View all in ai-agents →