Kilo Code: The Open Source AI Coding Tool (2026)
A deep dive into the open source Cline fork gaining traction
Start Building with Hypereal
Access Kling, Flux, Sora, Veo & more through a single API. Free credits to start, scale to millions.
No credit card required • 100k+ developers • Enterprise ready
Kilo Code: The Open Source AI Coding Tool (2026)
Kilo Code is an open source AI coding assistant that runs as a VS Code extension. It is a fork of Cline (itself originally called Claude Dev) with a focus on improved UX, lower token usage, and better support for multiple AI providers. If you have been looking for a free, open source alternative to Cursor's AI features that works inside VS Code, Kilo Code is worth evaluating.
What Is Kilo Code?
Kilo Code is a VS Code extension that gives you an AI coding agent directly in your editor. It can:
- Read and write files in your project
- Execute terminal commands
- Browse the web for documentation
- Create and edit multiple files in a single task
- Use any AI model via API (Claude, GPT, Gemini, local models)
- Show you exactly what it plans to do before executing
It differs from basic code completion tools (like Copilot) because it is an agent -- it can perform multi-step tasks autonomously, like "create a new REST API endpoint with tests and documentation."
Kilo Code vs Cline vs Cursor
| Feature | Kilo Code | Cline | Cursor |
|---|---|---|---|
| Open source | Yes (Apache 2.0) | Yes (Apache 2.0) | No |
| Runs in VS Code | Yes | Yes | Separate editor (VS Code fork) |
| Model support | Any API (Claude, GPT, Gemini, Ollama) | Any API | Claude, GPT (built-in) |
| File editing | Yes (with approval) | Yes (with approval) | Yes (inline + chat) |
| Terminal access | Yes | Yes | Yes |
| Web browsing | Yes | Yes | No |
| Token optimization | Improved over Cline | Baseline | Proprietary |
| Price | Free (bring your API key) | Free (bring your API key) | $20/month + API costs |
| Custom modes | Yes | Limited | No |
Installation
From VS Code Marketplace
1. Open VS Code
2. Go to Extensions (Ctrl+Shift+X / Cmd+Shift+X)
3. Search for "Kilo Code"
4. Click Install
5. Reload VS Code if prompted
From the Command Line
code --install-extension kilocode.kilo-code
From Source (for contributors)
git clone https://github.com/kilocode/kilo-code.git
cd kilo-code
npm install
npm run build
# Package the extension
npx vsce package
# Install the .vsix file
code --install-extension kilo-code-*.vsix
Configuration
After installing, configure your AI provider.
Step 1: Open Kilo Code Settings
Press Ctrl+Shift+P (or Cmd+Shift+P on macOS) and type "Kilo Code: Open Settings".
Step 2: Configure an AI Provider
Kilo Code supports multiple providers. Here are the most common:
Anthropic (Claude):
{
"kilocode.provider": "anthropic",
"kilocode.apiKey": "sk-ant-xxxxx",
"kilocode.model": "claude-sonnet-4-20250514"
}
OpenAI (GPT):
{
"kilocode.provider": "openai",
"kilocode.apiKey": "sk-xxxxx",
"kilocode.model": "gpt-4o"
}
Google (Gemini):
{
"kilocode.provider": "google",
"kilocode.apiKey": "AIzaSyxxxxx",
"kilocode.model": "gemini-2.0-flash"
}
Local models (Ollama):
{
"kilocode.provider": "ollama",
"kilocode.baseUrl": "http://localhost:11434",
"kilocode.model": "qwen2.5-coder:32b"
}
OpenRouter (access all models):
{
"kilocode.provider": "openrouter",
"kilocode.apiKey": "sk-or-xxxxx",
"kilocode.model": "anthropic/claude-sonnet-4-20250514"
}
Using Kilo Code
Basic Usage
Open the Kilo Code panel from the activity bar (the Kilo icon on the left sidebar) or press the keyboard shortcut. Then type your request in natural language:
Create a Node.js Express server with a /health endpoint
that returns the current timestamp and uptime.
Kilo Code will:
- Plan the file changes
- Show you exactly what it will create or modify
- Wait for your approval
- Execute the changes
- Optionally run commands (like
npm install express)
Multi-File Tasks
Kilo Code excels at tasks that span multiple files:
Add user authentication to this Express app:
- Create a User model with email and hashed password
- Add /register and /login endpoints
- Create JWT middleware for protected routes
- Add tests for the auth endpoints
Terminal Commands
Kilo Code can run terminal commands with your approval:
Install the required dependencies and run the test suite
It will show you the exact commands before running them:
# Kilo Code proposes:
npm install bcryptjs jsonwebtoken
npm test
You can approve, modify, or reject each command.
Web Browsing
Kilo Code can fetch documentation from the web to inform its work:
Look up the latest Prisma ORM migration syntax and create a
migration for adding a "comments" table with foreign keys to
the "users" and "posts" tables.
Custom Modes
One of Kilo Code's standout features is custom modes. Modes let you configure the AI's behavior for different types of work:
Built-in Modes
| Mode | Description | Tool Access |
|---|---|---|
| Code | Default coding mode | Full file, terminal, browser access |
| Architect | Planning mode | Read-only file access, no terminal |
| Ask | Q&A mode | Read-only, informational responses |
| Debug | Debugging mode | Full access with diagnostic focus |
Creating a Custom Mode
Create a .kilo/modes.json file in your project root:
{
"modes": [
{
"slug": "reviewer",
"name": "Code Reviewer",
"roleDefinition": "You are a senior code reviewer. Analyze code for bugs, security issues, and best practices. Never modify files directly.",
"groups": ["read"],
"customInstructions": "Focus on: error handling, input validation, SQL injection, XSS, and race conditions. Be specific about line numbers."
},
{
"slug": "docs",
"name": "Documentation Writer",
"roleDefinition": "You are a technical writer. Generate clear, concise documentation.",
"groups": ["read", "edit"],
"customInstructions": "Write JSDoc comments for functions, README sections, and inline comments for complex logic."
}
]
}
Switch modes using the dropdown in the Kilo Code panel or by typing /mode reviewer.
Token Usage Optimization
Kilo Code includes several features to reduce token consumption:
Context Management
# Kilo Code automatically:
- Sends only relevant files to the AI (not the entire project)
- Truncates large files to relevant sections
- Caches file reads within a conversation
- Uses diff-based editing to minimize output tokens
Manual Context Control
You can explicitly control what context is sent:
@file:src/auth/middleware.ts @file:src/models/user.ts
Fix the JWT verification in the auth middleware - it should
check token expiration properly.
The @file: prefix tells Kilo Code to include specific files in the context.
Cost Tracking
Kilo Code shows real-time token usage and cost estimates in the panel:
Task: Add user authentication
Tokens used: 12,450 input / 3,200 output
Estimated cost: $0.08 (Claude Sonnet 4)
Configuration File Reference
Global settings in VS Code settings.json:
{
"kilocode.provider": "anthropic",
"kilocode.model": "claude-sonnet-4-20250514",
"kilocode.apiKey": "sk-ant-xxxxx",
"kilocode.maxTokens": 8192,
"kilocode.temperature": 0,
"kilocode.autoApprove": {
"readFiles": true,
"listFiles": true,
"writeFiles": false,
"executeCommands": false
},
"kilocode.customInstructions": "Always use TypeScript. Prefer functional components in React. Use Tailwind CSS for styling."
}
Per-Project Instructions
Create a .kilo/instructions.md file in your project root for project-specific instructions:
# Project Instructions
- This is a Next.js 15 app with the App Router
- Use Prisma for database access
- All API routes should validate input with Zod
- Tests use Vitest
- Use pnpm, not npm or yarn
Troubleshooting
| Issue | Cause | Solution |
|---|---|---|
| "API key invalid" | Wrong key or expired | Regenerate key from provider dashboard |
| Extension not loading | VS Code version too old | Update VS Code to latest version |
| Slow responses | Large context or slow model | Use a faster model; reduce context with @file: |
| File edits not applied | Permission issue | Check workspace trust settings in VS Code |
| Terminal commands fail | Shell not detected | Set kilocode.shell in settings |
| High token usage | Sending too much context | Use @file: to limit context; close irrelevant files |
Conclusion
Kilo Code brings autonomous AI coding agent capabilities to VS Code without requiring a subscription or a separate editor. Its support for multiple AI providers, custom modes, and token optimization makes it a strong open source alternative to proprietary tools. The key advantage is flexibility: you choose your AI provider, control your costs, and customize the agent's behavior for your workflow.
For developers using Kilo Code to build applications that involve AI-generated media -- video creation, avatar generation, or image processing -- Hypereal AI provides a simple, affordable API for integrating these capabilities into your projects without managing GPU infrastructure.
Related Articles
Start Building Today
Get 35 free credits on signup. No credit card required. Generate your first image in under 5 minutes.
