Slash command

/explain

Explains how a file, function, or feature works — traces the real call path instead of guessing from names.

understandingonboardingcodebase
Install to
~/.claude/commands/explain.md
descriptionExplain how a piece of the codebase works, grounded in the actual code.
argument-hint[file, function, or feature to explain]

Explain how $ARGUMENTS works.

  1. Find it: grep/glob for the symbol or file. Read it.
  2. Trace one level out — who calls it, what it calls, what data flows through. Read those too; don’t infer behavior from names.
  3. Explain in this shape:
    • What it does — one sentence.
    • How it works — the real steps, in order, citing file:line.
    • Why it’s built this way — any non-obvious constraint or tradeoff you can see in the code or comments.
    • Gotchas — edge cases, surprising behavior, anything a newcomer would trip on.

Keep it concrete. Quote small snippets. If something is genuinely unclear from the code, say so rather than inventing an explanation.

How to install

  1. Copy the code and save it to ~/.claude/commands/explain.md (user) or .claude/commands/explain.md (project).
  2. Commands hot-reload — it's available in the current session immediately.
  3. Run it by typing /explain in the prompt.
  4. Verify: type / and look for it in the command list.

← More slash commands