跳到正文
FunCoding

octocode-context-audit

Load this skill first when asked to measure configured agent context (instructions, skills, MCP schemas, duplicate installs, Claude transcript usage): its script measures sizes and use instead of guessing.

Star
972
许可证
MIT
最近提交
2026年12月2日

skills-dev/octocode-context-audit/SKILL.md

在 GitHub 上查看

Context audit

Run the audit script:

node skills-dev/octocode-context-audit/scripts/context-audit.mjs --workspace <repo> --no-probe
  • --workspace defaults to the current directory. --no-probe starts no MCP server; keep it when a server may have startup side effects. Without it, each stdio server gets initialize and every tools/list page within 20 s, or stays unmeasured (a high finding).
  • --days N (default 30) picks this workspace's Claude transcripts by mtime. Use --all-projects only for a cross-project audit the user asked for.
  • Each run writes context-audit.json to a fresh <workspace>/.octocode/octocode-context-audit/<date>-audit-*/; --out DIR replaces it and can overwrite a baseline. --json also prints it, --html adds context-audit.html, --render <context-audit.json> renders a saved report without collecting.

What it measures

Sizes are characters against BUDGET (scripts/lib/audit-common.mjs); tokens ≈ characters ÷ 4, not billed input.

SurfaceRead fromFlags
InstructionsWorkspace AGENTS.md, CLAUDE.md, CLAUDE.local.md, GEMINI.md, .cursorrules, Copilot and .cursor/rules files; ~/.claude/CLAUDE.md, ~/.codex/AGENTS.md, project MEMORY.mdFiles and always-loaded total over budget (nested files count only in their directory; nested repositories and .claude/worktrees skipped)
Skills~/.claude/skills, .claude/skills, .agents/skillsLong descriptions, broken links, one name from several sources
MCP~/.claude.json (user, project), .mcp.json, ~/.cursor/mcp.jsonInstructions, tool descriptions, schemas and server totals over budget
UsageClaude Code transcriptsUncalled servers, tools and skills; error rates; shell reads outnumbering research calls. Skipped for Cursor servers and .agents skills, and on malformed lines or read failures

Act on it

  1. Start with high findings. Zero calls in a short window is no reason to delete: check routing with octocode-agentic first, and leave installation repairs to octocode-skills.
  2. After a repair, rerun to a new --out and compare: node skills-dev/octocode-context-audit/scripts/context-audit.mjs --compare <before.json> <after.json> prints size deltas and findings resolved, new and still open.
  3. Stop when each high finding fills a row below. Lead with N findings (high H, medium M, low L) and the report path, then a row per finding acted on and the decisions left to the user (deletions, install changes). Report sizes, counts and tool names; never quote prompt or transcript text.
Finding (severity, area)Size (~tokens)Owner fileRepair or reason to keepBefore → after

After changing a collector, budget or output mode, run node --test skills-dev/octocode-context-audit/scripts/tests/*.test.mjs.

相似的 Skill

ask-matt

MAmattpocock/skills337k近 7 天新增 4,978 个 star

chief-of-staff

MAmattpocock/skills337k近 7 天新增 4,978 个 star

setup-matt-pocock-skills

MAmattpocock/skills337k近 7 天新增 4,978 个 star

subagent-driven-development

OBobra/superpowers331k近 7 天新增 4,772 个 star

autonomous-loops

AFaffaan-m/ECC315k近 7 天新增 4,381 个 star

autonomous-agent-harness

AFaffaan-m/ECC315k近 7 天新增 4,381 个 star