explain-code

A guide for explaining unfamiliar code at several levels, from its overall purpose to a detailed walkthrough of its logic and data flow.

In plain words
What is it for?
Onboarding to a codebase, understanding a file or function, tracing how data moves through a module, and examining recent changes.
Why use it?
It helps developers understand complicated code by connecting what the code does, what it depends on, who uses it, and why it was designed that way.

Skill for Claude CodeCodex

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 skills/viknesh20-20/claude-code-tool-kit/explain-code
Any agent
npx skills add viknesh20-20/claude-code-tool-kit --skill explain-code
Clone the repo
git clone --depth 1 https://github.com/viknesh20-20/claude-code-tool-kit

Made for: Claude Code, Codex.

Per session 43 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 529 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.00043 $0.00529
Opus 5 $0.00022 $0.00264
Sonnet 5 $0.00009 $0.00106
Haiku 4.5 $0.00004 $0.00053

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

Security

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 2d 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.

.claude/skills/explain-code/SKILL.md · 61 lines

What it actually says

Code Explanation

Instructions

Step 1: Identify the Target

Read the specified file, function, or module completely. Also read:

  • Any imports/dependencies it uses
  • Any files that import/call it (to understand usage context)
  • Recent git history for the file: git log --oneline -10 <file>

Step 2: Provide Multi-Level Explanation

Level 1 — One-Sentence Summary

What does this code do in plain English? A non-technical person should understand this.

Level 2 — High-Level Overview
  • Purpose: What problem does it solve?
  • Inputs: What goes in? (parameters, config, env vars, external data)
  • Outputs: What comes out? (return values, side effects, events emitted)
  • Dependencies: What does it rely on?
  • Callers: Who uses this? In what context?
Level 3 — Detailed Walkthrough

Walk through the code section by section:

  • Explain the logic flow with numbered steps
  • Highlight non-obvious decisions ("this uses X instead of Y because...")
  • Note any error handling and what triggers each path
  • Explain any performance-sensitive sections
Level 4 — Data Flow Diagram

Create an ASCII diagram showing:

[Input] → [Processing Step 1] → [Processing Step 2] → [Output]
                ↓                       ↓
         [Side Effect 1]         [Side Effect 2]

Step 3: Highlight Key Details

  • Tricky Parts: Code that might confuse a new reader
  • Assumptions: Implicit assumptions the code makes
  • Edge Cases: How are boundary conditions handled?
  • History: Why was it written this way? (use git blame for context)

Step 4: Related Code

List the most important related files/functions that someone exploring this code should read next.


Output Style

  • Use clear section headers
  • Include code snippets with line references
  • Use analogies where helpful
  • Adjust technical depth based on the complexity of the code
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. 2d ago First seen · 61 lines · 43 tokens per session scan A 312ef1c0944d

Subscribe to this mod's changes

explain-code is a skill published in the GitHub repository viknesh20-20/claude-code-tool-kit (7 stars, last pushed 4mo ago), licensed MIT. It adds 43 tokens to every session and 529 once invoked, about $0.0002 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.

Related

Other skills, from other repositories

kungfu-agent-onboarding

Use when a user asks to understand, start, inspect, extend, or safely operate installed Kungfu; verify the installed pack, select one intent route, personalize the explanation, and propose one smallest safe next action.

kungfu-systems/kungfu · 49 tokens

learn

Knowledge compiler. Extracts patterns, decisions, and anti-patterns from completed campaigns and evolve cycles, then compiles them into structured wiki pages that integrate with existing knowledge rather than appending isolated files. Implements flush→compile→lint pipeline. Auto-triggered by /postmortem and /evolve…

SethGammon/Citadel · 66 tokens

llmtornado-tutorial-generator

Generates comprehensive code tutorials on LlmTornado API formatted for Medium publication with examples, explanations, and best practices.

lofcz/LLMTornado · 31 tokens

add-example-agent

Add a new self-contained example agent under examples/. Use when asked to "create an example for ", "add a tutorial agent", "demo integration with ", or when showcasing a new pattern users should copy.

GetBindu/Bindu · 51 tokens

quiz-generation

Educational assessment expert that generates high-quality multiple-choice quizzes from any provided text. Creates exactly 10 MCQs with 4 options each, correct answer identification, and concise explanations.

GetBindu/Bindu · 2 tokens

daily-dev-agentic

You're a learning machine. This skill lets you maintain your own feed on daily.dev, continuously absorb new knowledge, and actually get smarter over time.

OpenCoven/coven · 65 tokens