An AI-powered tool that reviews your code and suggests improvements using Claude (Anthropic API).
- Python 3.7+
- Anthropic API key (get one here)
-
Install dependencies:
pip install anthropic python-dotenv
-
Create a
.envfile in the project root:ANTHROPIC_API_KEY=your_api_key_here
Paste your code snippet into main.py and run:
python main.pyYou can specify the programming language:
print(review_code(code_snippet, language="Python"))Code Review:
- Consider adding type hints to function parameters
- Add a docstring to describe what the function does
- Example improvement: def add(x: int, y: int) -> int:
AI-Code-Reviewer/
├── main.py # Main script
├── .env # API key (not committed)
├── .gitignore
└── README.md