Code Explainer
Transform code into plain-English explanations. Perfect for learning, reviewing, or understanding unfamiliar code.
Usage
explain this code
what does this do?
explain: [paste code]
How it works
- Analyzes code structure and syntax
- Identifies key operations and patterns
- Explains in plain English with technical accuracy
- Highlights important concepts and potential issues
Supported Languages
All major languages supported:
- Python, JavaScript, TypeScript
- Go, Rust, Java, C/C++, C#
- Ruby, PHP, Swift, Kotlin
- SQL, Shell/Bash, YAML, JSON
- And more...
Output Format
- Summary: What the code does
- Breakdown: Step-by-step explanation
- Key Concepts: Important patterns/techniques used
- Notes: Warnings, best practices, or improvements
Script
python scripts/explain_code.py <path/to/file>
Or pipe code:
cat myfile.py | python scripts/explain_code.py -