Build a Code Reviewer Agent
Learn how to create a coding assistant that reads and analyzes your codebase with the Autohand Code Agent SDK. Available in TypeScript, Python, and Java.
In this tutorial, you'll build a code reviewer coding assistant that can read files, analyze code, and provide feedback. This is a great starting point for learning the Agent SDK basics.
- Node.js 16+ (for TypeScript), Python 3.10+ (for Python), or Java 11+ (for Java)
- SDK installed for your chosen language
- API key from your LLM provider (set as
AUTOHAND_API_KEY)
What You'll Build
A code reviewer coding assistant that:
- Reads source files from your codebase
- Analyzes code for bugs and improvement opportunities
- Provides specific feedback with file and line numbers
- Uses only the tools it needs (READ_FILE, GLOB, SEARCH_IN_FILES)
Step 1: Set Up Your Project
Create a new file for your agent in your chosen language:
Step 2: Run the Agent
Now run the agent to analyze your codebase:
Key Concepts
The Agent class takes a name, instructions, tools, and max turns configuration.
We only give the coding assistant the tools it needs: read_file, glob, and search_in_files.
The OpenRouterProvider connects your coding assistant to an LLM provider.
Runner.run() executes the coding assistant with a prompt and returns the result.
Complete Example
Use this as the full runnable shape for the language you chose: