← All skills
Prompt · Slash command✓ Verified

Explain Code

Explain what the selected code does in plain English.

What happens when you install it

1

You run the install command

mcp install-skill explain-code

MCPHub CLI downloads this prompt from the registry.

2

Saved as a file in Claude Code

~/.claude/commands/explain-code.md

Claude Code reads all .md files in this folder as slash commands.

3

Use it in any conversation

/explain-codein Claude Code (after restart)

Claude runs the prompt against your current file or selection — no copy-paste needed.

Content

Explain Code

Explain the selected code to someone who knows the language but is new to this codebase.

Structure

What it does

1-2 sentences in plain English. What problem does this solve?

How it works

Walk through the key steps. Describe the data flow. Use concrete examples where helpful.

Why it's written this way

Design decisions and trade-offs. Why this approach over the alternatives?

Gotchas and non-obvious behavior

Anything that would surprise a developer reading this for the first time. Side effects, edge cases, performance characteristics.

Tone

  • Clear and direct — no jargon unless the reader would know it
  • Concrete — use variable names and line references from the actual code
  • Honest — if the code is complex or poorly written, say so and explain why