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.
npx agentmods add skills/benmarte/codemunch/staleness-gatenpx skills add benmarte/codemunch --skill staleness-gategit clone --depth 1 https://github.com/benmarte/codemunchWrote 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.
[](https://agentmods.dev/skills/benmarte/codemunch/staleness-gate)<a href="https://agentmods.dev/skills/benmarte/codemunch/staleness-gate"><img src="https://agentmods.dev/badge/skills/benmarte/codemunch/staleness-gate.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00054 | $0.01310 |
| Opus 5 | $0.00027 | $0.00655 |
| Sonnet 5 | $0.00011 | $0.00262 |
| Haiku 4.5 | $0.00005 | $0.00131 |
Grade A, and why
staleness-gate scanned grade A with 0 findings 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 3d 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.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 161 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Staleness Gate Skill
Ensures the codemunch index is fresh before any query runs. This skill is called automatically — users never invoke it directly.
Decision flow
1. Does .claude/codemunch/index.json exist?
NO → First-run: run detect-lsp skill, then full index skill → done
YES → Continue to step 2
2. Get index timestamp from index.json "generated" field
3. Find files changed since index was built:
git diff --name-only --diff-filter=ACMRD $(git log -1 --format=%H --before="$GENERATED_TIMESTAMP") HEAD
Also check for untracked source files:
git ls-files --others --exclude-standard
4. Filter to source files only (exclude non-code files like .md, .txt, images, etc.)
5. Are there changed source files?
NO → Index is fresh, proceed with query
YES → Run incremental re-index (step 6)
6. Incremental re-index:
- For each changed/added file: re-extract symbols using the best available engine
- For each deleted file: remove its symbols from the index
- Update the "generated" timestamp
- Update the "file_hashes" manifest
- Report: "Auto-updated index: +N symbols, -M symbols, K files re-indexed"
Step 1 — Check index exists
# Check for index
if [ -f .claude/codemunch/index.json ]; then
echo "INDEX_EXISTS"
else
echo "NO_INDEX"
fi
If NO_INDEX:
- Check if
.claude/codemunch/config.jsonexists — if not, run the detect-lsp skill first - Run the index skill with full mode
- Report: "First-run: auto-built codemunch index (N symbols across M files)"
- Continue with the original query
Step 2 — Get index timestamp
# Extract the generated timestamp from index
python3 -c "
import json
with open('.claude/codemunch/index.json') as f:
idx = json.load(f)
print(idx.get('generated', ''))
" 2>/dev/null || jq -r '.generated' .claude/codemunch/index.json
Step 3 — Find changed files since index was built
GENERATED="2026-03-11T02:14:00Z"
# Find the commit closest to when the index was built
BASE_COMMIT=$(git log -1 --format=%H --before="$GENERATED" 2>/dev/null)
if [ -z "$BASE_COMMIT" ]; then
# No commit found before timestamp — index predates all commits, do full re-index
echo "FULL_REINDEX_NEEDED"
else
# Get changed files since that commit
git diff --name-only --diff-filter=ACMRD "$BASE_COMMIT" HEAD 2>/dev/null
fi
# Also check untracked files (new files not yet committed)
git ls-files --others --exclude-standard 2>/dev/null
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.
- 3d ago First seen · 161 lines · 54 tokens per session scan A 896c903dfaff
staleness-gate is a skill published in the GitHub repository benmarte/codemunch (7 stars, last pushed 5mo ago), licensed MIT. It adds 54 tokens to every session and 1,310 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
glossary-init
USE WHEN setting up a repo for AI-first work, when an agent hallucinates domain term meaning, or when user asks to bootstrap / extend the repo's domain glossary. Surfaces candidate terms by identifier frequency, asks the user for 1-sentence definitions, writes GLOSSARY.md at repo root. Idempotent — re-running adds new…
codex-pair-resume
Resume codex-pair for this project after a previous pause. Removes .codex-pair/state/paused and clears failure state. Review resumes on the next supported file edit; missing state is a no-op.
conventions-init
USE WHEN setting up a repo for AI-first work (after /init-repo), or when the context-surface hook should start feeding repo conventions to agents before edits. Drafts conventions.yml at repo root: per-kind casing (inferred from the code), a vague-name denylist seed, directory roles, and a hand-filled house-rules…
opik
This skill should be used when the user needs to add Opik tracing or integrations to their code, instrument an LLM application, or needs reference for Opik SDK usage (Python, TypeScript, REST API). Use for tasks like "add tracing", "instrument my code", "use trackopenai", "add OpikTracer", "what span types are…
codex-review
Get a second opinion from OpenAI Codex on your current code changes. Analyzes staged/unstaged diffs and returns prioritized findings. Use when user asks to "review with Codex", "Codex code review", or "ask Codex to check my code".
ollama-review
Get a second opinion from a local Ollama LLM on your current code changes. Analyzes staged/unstaged diffs and returns prioritized findings. No API keys needed. Use when user asks to "review with Ollama", "local code review", or "review offline".