π€ Fix it Claude
A powerful interactive command-line application that analyzes code snippets and files using Grok-4-fast via OpenRouter to provide comprehensive feedback on code efficiency, readability, and best practices. Completely free to use!
Co-authored by Claude Sonnet 4.5 π€
β¨ Features
- π― Interactive CLI Interface: Beautiful menu-driven interface with easy navigation
- π Interactive Mode: Paste code directly into the terminal for instant analysis
- π File Mode: Drop files into a folder and select them for review
- π€ Smart Code Analysis: Uses Grok-4-fast for intelligent code review (free!)
- π Language Detection: Automatically detects programming language
- π¨ Beautiful Interface: Rich, colorful terminal output with syntax highlighting
- π Comprehensive Feedback: Covers efficiency, readability, best practices, and bug detection
- π Security Analysis: Detects vulnerabilities, security issues, and provides risk assessments
- π‘ Corrected Code Generation: Creates improved versions of your code with detailed explanations
- πΎ Automatic File Management: Saves enhanced code to organized folders
- π Detailed Comments: Explains what was changed, why, and the pros/cons of each approach
- π Return to Menu: Seamless navigation between different review modes
- π Cross-Platform: Works on Windows, macOS, and Linux
π Quick Start
1. Installation
# Clone or download the project
git clone <repository-url>
cd clauder-Hackathon
# Install dependencies
pip install -r requirements.txt
2. Setup API Key
Get your OpenRouter API key from openrouter.ai/keys and create a .env file:
Create .env file:
# Run the helper script
python scripts/create_env.py
# Or manually create .env file with:
OPENROUTER_API_KEY=your-api-key-here
Note: The Grok-4-fast model is completely free to use!
3. Quick Setup
# Run the setup script to create directories and check dependencies
python scripts/setup.py
# Create your .env file with API key
python scripts/create_env.py
4. Usage
π― Interactive CLI App (Recommended)
python main.py
Or use the launcher:
- Windows: Double-click
run_cli.bat - Linux/Mac:
./run_cli.sh
π CLI App Menu Options:
- Interactive Mode - Paste code directly into terminal
- File Mode - Select files from
files_to_review/folder - Browse Reviewed Files - View previously reviewed files
- Exit - Close the application
π How to Use the Interactive CLI App
π― Getting Started
Launch the App:
python main.pyChoose Your Mode:
- Option 1: Interactive Mode (paste code directly)
- Option 2: File Mode (select from folder)
- Option 3: Browse Reviewed Files (view previous reviews)
- Option 4: Exit
π Interactive Mode
- Paste your code directly into the terminal
- Press Enter twice when done (cross-platform compatible)
- Code is automatically analyzed and improved
π File Mode
- Drop files into the
files_to_review/folder - Select the file you want to review from the numbered list
- The app will analyze and save improved code to
reviewed_files/
π Browse Reviewed Files
- View all previously reviewed files
- See the analysis results and corrected code
- Navigate through your review history
π Project Structure
clauder-Hackathon/
βββ π src/ # Source code
β βββ cli_app.py # π― Main Interactive CLI Application
βββ π scripts/ # Utility scripts
β βββ create_env.py # π Environment setup helper
β βββ setup.py # βοΈ Project setup script
β βββ env_template.txt # π Environment template
βββ π examples/ # Example files and demos
β βββ sample_code.py # π Sample Python code
β βββ simple_demo.py # π Demo output example
β βββ test_demo.py # π§ͺ Test demonstration
βββ π tests/ # Test files
β βββ test_api.py # π API connection test
βββ π files_to_review/ # π Drop files here for review
β βββ sample_code.py # π Sample Python code
β βββ example_js.js # π¨ Sample JavaScript code
β βββ test_comments.py # π¬ Comment handling demo
β βββ vulnerable_code.py # π Python security vulnerabilities
β βββ vulnerable_js.js # π JavaScript security vulnerabilities
βββ π reviewed_files/ # πΎ Corrected code saved here
β βββ example_js_improved.js # β
Improved JavaScript code
β βββ pasted_code_improved.python # β
Improved pasted code
β βββ test_comments_improved.py # β
Improved comment handling demo
β βββ vulnerable_js_improved.js # β
Secured JavaScript code
βββ π main.py # π Main entry point
βββ π code_review_bot.py # ποΈ Legacy core logic (kept for reference)
βββ π requirements.txt # π¦ Dependencies
βββ π README.md # π Documentation
βββ π PROJECT_STRUCTURE.md # π Project structure guide
βββ π SECURITY_ANALYSIS.md # π Security analysis guide
βββ π VIDEO_SCRIPT.html # π¬ Video recording script
βββ π .env # π API configuration (not tracked)
βββ π run_cli.bat # Windows launcher
βββ π run_cli.sh # Linux/Mac launcher
π Workflow
Interactive Mode Workflow:
- Launch
python main.py - Choose "1" for Interactive Mode
- Paste your code into the terminal
- Press Enter twice when finished
- View analysis and corrected code
- Press Enter to return to main menu
File Mode Workflow:
- Drop files into
files_to_review/folder - Launch
python main.py - Choose "2" for File Mode
- Select file from numbered list
- View analysis and corrected code
- Find improved code in
reviewed_files/folder - Press Enter to return to main menu
Browse Reviewed Files Workflow:
- Launch
python main.py - Choose "3" for Browse Reviewed Files
- Select a previously reviewed file from the list
- View the original analysis and corrected code
- Press Enter to return to browse menu or main menu
π Security Analysis
The bot now includes comprehensive security analysis capabilities! Try analyzing the example vulnerability files:
vulnerable_code.py- Python security vulnerabilitiesvulnerable_js.js- JavaScript security vulnerabilitiestest_comments.py- Demonstrates comment handling (ignores AI instructions)
Security Features:
- Detects SQL injection, XSS, CSRF, and other critical vulnerabilities
- Provides risk assessments (CRITICAL, HIGH, MEDIUM, LOW, INFO)
- Generates secure code fixes with detailed explanations
- Covers authentication, authorization, and data protection issues
- Smart Comment Handling: Ignores AI instruction comments, analyzes all code regardless
π Read the full guide: SECURITY_ANALYSIS.md
π― What It Analyzes
The bot provides comprehensive feedback in these areas:
- Security Vulnerabilities: SQL injection, XSS, CSRF, buffer overflows, authentication bypasses, etc.
- Code Vulnerabilities: Race conditions, memory leaks, null pointer dereferences, integer overflows
- Input Validation Issues: Missing validation, improper sanitization, injection vulnerabilities
- Authentication & Authorization: Weak passwords, session management, privilege escalation
- Cryptographic Issues: Weak encryption, hardcoded secrets, improper random number generation
- Data Protection: PII exposure, data leakage, improper data handling
- Efficiency: Performance optimizations, algorithmic improvements, resource usage
- Readability: Code clarity, naming conventions, structure, comments
- Best Practices: Language-specific conventions, design patterns, secure coding practices
- Bug Detection: Potential issues, edge cases, error handling
- Security Risk Assessment: CRITICAL, HIGH, MEDIUM, LOW, or INFO risk levels
- Corrected Code: Complete improved version with detailed comments explaining:
- What security vulnerabilities were fixed and why
- What was changed and why
- Cons of the previous approach (especially security-wise)
- Pros of the new approach (especially security-wise)
- Performance improvements
- Security best practices applied
π οΈ Supported Languages
The bot automatically detects and supports most programming languages including:
- Python
- JavaScript/TypeScript
- Java
- C/C++
- Go
- Rust
- PHP
- Ruby
- Swift
- And many more!
π Requirements
- Python 3.7+
- OpenRouter API key (free!)
- Internet connection
π§ Dependencies
requests- HTTP requests for OpenRouter APIpython-dotenv- Environment variable managementclick- Command-line interface frameworkrich- Beautiful terminal outputpygments- Syntax highlightingcolorama- Cross-platform colored terminal text
π¨ Features in Detail
Beautiful CLI Interface
- Syntax-highlighted code display
- Colorful panels and borders
- Progress indicators
- Rich text formatting
Smart Analysis
- Uses the free Grok-4-fast model via OpenRouter
- Context-aware suggestions
- Language-specific best practices
- Performance optimization tips
Flexible Input
- Interactive code pasting
- File analysis
- Automatic language detection
- Support for various file formats
π¨ Troubleshooting
API Key Issues
If you get an API key error:
- Make sure you have a valid OpenRouter API key
- Check that the .env file exists and contains your API key
- Get your free API key from: https://openrouter.ai/keys
Installation Issues
If you encounter dependency issues:
pip install --upgrade pip
pip install -r requirements.txt
Language Detection Issues
The tool automatically detects the programming language, but you can also specify it manually in the interactive mode.
π Example Output
π― Interactive CLI App Interface
+---------------------------------------------+
| Fix it Claude |
| Analyze and improve your code with AI |
| Using free Grok-4-fast model via OpenRouter |
+---------------------------------------------+
Main Menu
1. Interactive Mode - Paste code directly
2. File Mode - Select file from folder
3. Browse Reviewed Files - View previous reviews
4. Exit
Select an option [1/2/3/4] (1):
π Analysis Results
ββ Code Review Analysis ββ
β File: example.py β
β Language: python β
ββββββββββββββββββββββββββ
ββ Analysis Results ββ
β β
β **Efficiency**: β
β - Consider using β
β memoization for β
β recursive calls β
β β
β **Readability**: β
β - Add type hints β
β - Improve variable β
β naming β
β β
β **Best Practices**:β
β - Add docstrings β
β - Handle edge casesβ
β β
ββββββββββββββββββββββ
ββ Corrected Code ββ
β β
β # Improved code β
β # with detailed β
β # comments... β
β β
ββββββββββββββββββββ
β Corrected code saved to: reviewed_files/example_improved.py
Built With
- claude
- openrouter
- python

Log in or sign up for Devpost to join the conversation.