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 commands/benkapner/claude-code-basecamp/explain-codegit clone --depth 1 https://github.com/Benkapner/claude-code-basecampWhat 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.00026 | $0.00563 |
| Opus 5 | $0.00013 | $0.00282 |
| Sonnet 5 | $0.00005 | $0.00113 |
| Haiku 4.5 | $0.00003 | $0.00056 |
Grade A, and why
explain-code 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 yesterday.
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 — 80 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Explain Code
Analyze and explain code functionality at multiple levels of detail.
Instructions
Explain the code specified by $ARGUMENTS (a file path, function name, or module). If no argument given, ask what to explain.
Step 1: Context
- Identify the file's role in the project
- Review imports and dependencies
- Check how it's called (grep for usage)
Step 2: High-Level Overview
- What does this code do? (1-2 sentences)
- What problem does it solve?
- How does it fit into the larger system?
Step 3: Structure Breakdown
- Break into logical sections
- Map data flow and control flow
- Identify key classes, functions, and their responsibilities
Step 4: Detailed Analysis
For complex or non-obvious sections:
- Explain the algorithm or approach
- Clarify data transformations and processing steps
- Describe error handling and edge cases
- Explain Python-specific patterns (decorators, generators, context managers, comprehensions)
Step 5: Practical Notes
- Performance — bottlenecks, complexity, scalability concerns
- Dependencies — external services, APIs, database operations
- Testing — how to test this code, what scenarios matter
- Gotchas — non-obvious behavior, implicit assumptions, known limitations
Output Format
FILE: [path]
PURPOSE: [one sentence]
OVERVIEW:
[2-3 sentence summary]
STRUCTURE:
[section breakdown with line ranges]
DETAILED ANALYSIS:
[section-by-section explanation, focused on non-obvious parts]
PRACTICAL NOTES:
[performance, dependencies, testing, gotchas]
Important
- Scale depth to complexity. A 10-line utility gets a short explanation. A 200-line pipeline stage gets a thorough one.
- Focus on the "why" not just the "what". Don't just describe what each line does — explain why it's done that way.
- Use parallel agents (Explore) to check how the code is used across the project.
- Skip the obvious. Don't explain
import osorx = 5. Focus on logic that requires understanding.
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.
- yesterday First seen · 80 lines · 26 tokens per session scan A 30b8269e3918
explain-code is a command published in the GitHub repository Benkapner/claude-code-basecamp (16 stars, last pushed 12d ago), licensed MIT. It adds 26 tokens to every session and 563 once invoked, about $0.0001 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-30.
Other commands, from other repositories
spec-forge
Use when generating software specifications — full chain (Idea→Decompose→Tech Design + Feature Specs) or individual documents.
propagate
Use after editing an upstream doc (PRD/SRS/tech-design/feature-spec) to propagate changes downstream and keep the entire doc chain consistent.
review
Use when reviewing spec-forge generated documents for quality, completeness, and consistency — auto-fixes issues if found.
analyze
Use when analyzing a document collection to map themes, find conflicts, gaps, and redundancies — generates landscape analysis report.
audit
Use when auditing existing project docs for quality, completeness, and code alignment — generates findings report with fix recommendations.
test-cases
Use when writing test cases, generating tests, supplementing test coverage, or improving test completeness — auto-scans project, designs multi-dimensional test cases with coverage matrix.