code-explain

code-explain is a command for coding agents from joaquimscosta/arkhe-claude-plugins. It costs 9 tokens per session (424 once invoked), scanned A, original, MIT.

A command that explains source code, algorithms, design patterns, or system architecture using plain explanations and diagrams.

In plain words
What is it for?
Use it with a file path or code topic, such as explaining a caching strategy, sorting algorithm, or event-handler design.
Why use it?
It helps developers understand unfamiliar code and see how its parts work together, including edge cases and non-obvious behavior.

Command

Part of the doc plugin — 3 skills, 4 commands, 2 agents shipped together

Install

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.

agentmods
npx agentmods add commands/joaquimscosta/arkhe-claude-plugins/code-explain
Clone the repo
git clone --depth 1 https://github.com/joaquimscosta/arkhe-claude-plugins

Or install doc, the plugin that ships this one along with the rest of its 3 skills, 4 commands, 2 agents.

Wrote 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.

agentmods badge for code-explain

README.md
[![agentmods](https://agentmods.dev/badge/commands/joaquimscosta/arkhe-claude-plugins/code-explain.svg)](https://agentmods.dev/commands/joaquimscosta/arkhe-claude-plugins/code-explain)
Your own site
<a href="https://agentmods.dev/commands/joaquimscosta/arkhe-claude-plugins/code-explain"><img src="https://agentmods.dev/badge/commands/joaquimscosta/arkhe-claude-plugins/code-explain.svg" alt="Measured on agentmods" height="20"></a>
Per session 9 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 424 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5 $0.00009 $0.00424
Opus 5 $0.00005 $0.00212
Sonnet 5 $0.00002 $0.00085
Haiku 4.5 $0.00001 $0.00042

Measured 3d ago against content hash a81a92a47bc6, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

code-explain 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.

plugins/doc/commands/code-explain.md · 69 lines

What it actually says

Code Explanation

Explain complex code sections, algorithms, design patterns, or system architectures with visual aids and step-by-step breakdowns.

Usage

/code-explain <file path or code description>

Examples

Explain a specific file:

/code-explain src/utils/data-transformer.ts

Explain a concept in context:

/code-explain the caching strategy in api/cache-manager.js

Explain an algorithm:

/code-explain the sorting algorithm in utils/sort.py

Explain a design pattern:

/code-explain how the observer pattern is used in event-handler.ts

What You Get

  1. Overview - What the code does (1-2 sentences)
  2. Key Concepts - Programming concepts identified
  3. Visual Diagrams - Mermaid flowcharts, class diagrams, or sequence diagrams
  4. Step-by-Step Breakdown - Logic explained with line references
  5. Common Questions - Anticipated "why" and "what if" answers
  6. Gotchas - Non-obvious behavior and edge cases

Explanation Depth

The explanation depth adapts to code complexity:

Complexity Approach
Simple Quick overview, key points
Moderate Diagrams, step-by-step breakdown
Complex Full analysis with patterns, pitfalls, alternatives

Tips

  • Be specific - Point to exact files or functions
  • Provide context - Mention your experience level if you want simpler/deeper explanations
  • Ask follow-ups - Request deeper dives into specific parts

Integration

Invoke the Skill tool with skill name "doc:code-explanation" and arguments: $ARGUMENTS

For comprehensive examples and detailed methodology, see:

Changes

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.

  1. 3d ago First seen · 69 lines · 9 tokens per session scan A a81a92a47bc6

Subscribe to this mod's changes

code-explain is a command published in the GitHub repository joaquimscosta/arkhe-claude-plugins (21 stars, last pushed 20d ago), licensed MIT. It adds 9 tokens to every session and 424 once invoked, about $0.0000 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.