Skip to main content
ClaudeWave
Slash Command828 repo starsupdated 13d ago

explain

The explain command breaks down code or programming concepts into beginner-friendly language using a structured teaching approach. Use this when you need code clarified through step-by-step logic, everyday analogies, and highlighted key parts rather than technical jargon, making it ideal for learning new programming patterns or understanding unfamiliar code sections.

Install in Claude Code
Copy
mkdir -p ~/.claude/commands && curl -fsSL https://raw.githubusercontent.com/huangjia2019/claude-code-engineering/HEAD/05-Commands/projects/01-basic-commands/.claude/commands/explain.md -o ~/.claude/commands/explain.md
Then start a new Claude Code session; the slash command loads automatically.

explain.md

Explain the following code or concept: $ARGUMENTS

## Explanation Style

Use the "teach a friend" approach:

1. **Start Simple**: One sentence summary of what it does
2. **Break It Down**: Step through the logic
3. **Use Analogies**: Compare to everyday concepts when helpful
4. **Highlight Key Parts**: Point out the important bits

## Output Format

```markdown
## What It Does
[One sentence summary]

## How It Works

### Step by Step
1. First, [what happens first]
2. Then, [what happens next]
...

### Key Concepts
- **[concept]**: [explanation]

## Example
[Simple example if helpful]

## Remember
[The one thing to take away]
```

## Guidelines

- Assume the reader is learning
- Avoid jargon, or define it when used
- Use code examples when they clarify
- Keep it concise but complete
- If explaining a file, focus on the most important parts