Skip to content
Back to skills

Octocode Context Audit

ASecurity

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.

  • 971 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added December 1, 2026
ai-agentsshellbashnode

Works with

  • claude code
  • cursor
  • mcp

Security analysis

A100/100

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

Scanned December 1, 2026

npx -y skills add bgauryy/octocode --skill octocode-context-audit --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Octocode Context Audit?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Octocode Context Audit
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/bgauryy-octocode-context-audit/badge)](https://www.skillsdirectory.com/skills/bgauryy-octocode-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
SKILL.md
---
name: octocode-context-audit
description: "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."
---

# Context audit

Run the [audit script](scripts/context-audit.mjs):

```bash
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.

| Surface | Read from | Flags |
|---|---|---|
| Instructions | Workspace `AGENTS.md`, `CLAUDE.md`, `CLAUDE.local.md`, `GEMINI.md`, `.cursorrules`, Copilot and `.cursor/rules` files; `~/.claude/CLAUDE.md`, `~/.codex/AGENTS.md`, project `MEMORY.md` | Files 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/skills` | Long descriptions, broken links, one name from several sources |
| MCP | `~/.claude.json` (user, project), `.mcp.json`, `~/.cursor/mcp.json` | Instructions, tool descriptions, schemas and server totals over budget |
| Usage | Claude Code transcripts | Uncalled 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 file | Repair or reason to keep | Before → after |
|---|---|---|---|---|

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

Files in this skill

  • SKILL.md3.1 KB
  • scripts/context-audit.mjs6.9 KB
  • scripts/lib/audit-common.mjs1000 B
  • scripts/lib/collect-local.mjs6.5 KB
  • scripts/lib/collect-mcp.mjs8.1 KB
  • scripts/lib/report-html.mjs7.3 KB
  • scripts/lib/usage.mjs8.6 KB
  • scripts/tests/collectors.test.mjs10.1 KB
  • scripts/tests/output.test.mjs5.5 KB

Attribution

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

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.