explain · superclaude-org — Claude Code command: break down code and concepts
A command to explain code, system architecture, and concepts at the right level of depth. Helps you understand unfamiliar code or teach concepts to others.
MIT ★ 23,950 updated 2026-09-27
.claude/commands/explain.mdWhat explain does
The /sc:explain command breaks down a code snippet or concept in stages: analyzes what you're asking about, assesses your knowledge level, sequences the explanation from fundamentals to details, then validates clarity. It offers three depth modes — basic, intermediate, advanced — and picks a delivery format: plain text, code examples, or interactive exploration.
Three roles handle different angles. An educator structures it for learning, an architect explains system design, a security specialist covers best practices. For intricate topics, Sequential MCP does structured reasoning and Context7 pulls official framework docs. When either server is not installed, the command falls back to native reasoning and web search.
Try explain authentication.js --level basic for a beginner take on auth flows, explain react-hooks --level intermediate --context react to ground it in React's official patterns, or explain microservices-system --level advanced --format interactive to explore architecture design interactively.
What it helps with
- understand legacy code without reading every line
- explain system architecture at the right level of detail
- convert a tricky concept into teachable form
- verify security practices align with framework patterns
Example prompts for the agent
- Explain how middleware works in Express at an intermediate level
- /sc:explain JWT-authentication --level basic --context security
- Break down microservices architecture in interactive mode
How to install explain
Manually: put the files in place
.claude/commands/explain.mdCall it with /explain. For all projects use ~/.claude/commands/
Manually: put the files in place
~/.codex/prompts/explain.mdCall it with /prompts:explain. Codex marks this format deprecated in favour of skills
Manually: put the files in place
.github/prompts/explain.prompt.mdManually: put the files in place
.gemini/commands/explain.tomlGemini stores commands as TOML: the prompt text goes into the prompt field
Questions about explain
How do I install explain in Claude Code?
Place the file at .claude/commands/explain.md in your project root. Claude Code auto-loads it; run /sc:explain with your code or topic and pick your depth.
What does explain do?
It walks through code and architecture concepts step by step, tuning depth (basic, intermediate, advanced) and format (text, examples, interactive). It pulls official framework patterns and documentation where relevant.
Does explain work without MCP servers?
Yes. Sequential and Context7 are preferred but optional. Without them, explain falls back to built-in code analysis and web search for official docs.
Source text
explain.md · MIT
--- name: explain description: "Provide clear explanations of code, concepts, and system behavior with educational clarity" category: workflow complexity: standard mcp-servers: [sequential, context7] personas: [educator, architect, security] --- # /sc:explain - Code and Concept Explanation ## Triggers - Code understanding and documentation requests for complex functionality - System behavior explanation needs for architectural components - Educational content generation for knowledge transfer - Framework-specific concept clarification requirements ## Usage ``` /sc:explain [target] [--level basic|intermediate|advanced] [--format text|examples|interactive] [--context domain] ``` ## Behavioral Flow 1. **Analyze**: Examine target code, concept, or system for comprehensive understanding 2. **Assess**: Determine audience level and appropriate explanation depth and format 3. **Structure**: Plan explanation sequence with progressive complexity and logical flow 4. **Generate**: Create clear explanations with examples, diagrams, and interactive elements 5. **Validate**: Verify explanation accuracy and educational effectiveness Key behaviors: - Multi-persona coordination for domain expertise (educator, architect, security) - Framework-specific explanations via Context7 integration - Systematic analysis via Sequential MCP for complex concept breakdown - Adaptive explanation depth based on audience and complexity ## MCP Integration - **Sequential MCP**: Auto-activated for complex multi-component analysis and structured reasoning - **Context7 MCP**: Framework documentation and official pattern explanations - **Persona Coordination**: Educator (learning), Architect (systems), Security (practices) - **Availability fallback**: The MCP servers named here are preferred tooling, not hard requirements — when one is not installed, degrade gracefully (native reasoning in place of Sequential, official docs via web lookup in place of Context7, native tools otherwise) instead of routing work to absent servers. ## Tool Coordination - **Read/Grep/Glob**: Code analysis and pattern identification for explanation content - **TodoWrite**: Progress tracking for complex multi-part explanations - **Task**: Delegation for comprehensive explanation workflows requiring systematic breakdown ## Key Patterns - **Progressive Learning**: Basic concepts → intermediate details → advanced implementation - **Framework Integration**: Context7 documentation → accurate official patterns and practices - **Multi-Domain Analysis**: Technical accuracy + educational clarity + security awareness - **Interactive Explanation**: Static content → examples → interactive exploration ## Examples ### Basic Code Explanation ``` /sc:explain authentication.js --level basic # Clear explanation with practical examples for beginners # Educator persona provides learning-optimized structure ``` ### Framework Concept Explanation ``` /sc:explain react-hooks --level intermediate --context react # Context7 integration for official React documentation patterns # Structured explanation with progressive complexity ``` ### System Architecture Explanation ``` /sc:explain microservices-system --level advanced --format interactive # Architect persona explains system design and patterns # Interactive exploration with Sequential analysis breakdown ``` ### Security Concept Explanation ``` /sc:explain jwt-authentication --context security --level basic # Security persona explains authentication concepts and best practices # Framework-agnostic security principles with practical examples ``` ## Boundaries **Will:** - Provide clear, comprehensive explanations with educational clarity - Auto-activate relevant personas for domain expertise and accurate analysis - Generate framework-specific explanations with official documentation integration **Will Not:** - Generate explanations without thorough analysis and accuracy verification - Override project-specific documentation standards or reveal sensitive details - Bypass established explanation validation or educational quality requirements
© SuperClaude-Org · MIT · SuperClaude-Org/SuperClaude_Framework
Similar slash commands
All slash commands for Code review and refactoring →explain by other authors comes first.