Skip to content

Latest commit

History

86 Commits

Folders and files

NameName
Last commit message
Last commit date

LevelCode - The Open-Source AI Coding Agent

The Open-Source AI Coding Agent That Outperforms Claude Code

CI StatusLicensenpm versionGitHub starsGitHub forks

Features | Swarms | Installation | Quick Start | SDK | Docs | Contributing

Note (2026-08-20): Remote master was backed up to branch backup-2026-08-20 before this push.


What is LevelCode?

LevelCode is an open-source AI coding assistant that edits your codebase through natural language instructions. Unlike single-model tools, LevelCode coordinates specialized agents that work together to understand your project and make precise changes.

LevelCode Demo

Benchmark Results

LevelCode beats Claude Code at 61% vs 53% on our evaluations across 175+ coding tasks over multiple open-source repos that simulate real-world tasks.

AgentSuccess RateToken EfficiencySpeed
LevelCode61%45k avg32s avg
Claude Code53%62k avg45s avg
Aider48%38k avg28s avg
Continue42%51k avg38s avg

Features

Multi-Agent Architecture

When you ask LevelCode to "add authentication to my API," it coordinates:

  1. File Picker Agent - Scans your codebase to understand the architecture and find relevant files
  2. Planner Agent - Plans which files need changes and in what order
  3. Editor Agent - Makes precise, contextual edits
  4. Reviewer Agent - Validates changes before applying
LevelCode Multi-Agents

This multi-agent approach delivers:

  • Better context understanding
  • More accurate edits
  • Fewer errors compared to single-model tools

Use Any Model via OpenRouter

Unlike Claude Code which locks you into Anthropic's models, LevelCode supports any model on OpenRouter:

  • Claude (Opus, Sonnet, Haiku)
  • GPT-4o, GPT-5
  • DeepSeek (V3, Coder)
  • Qwen (Coder, 2.5)
  • Gemini (Pro, Flash)
  • Llama 3.3, Mistral
  • And 200+ more models...

TypeScript SDK

Build LevelCode into your applications with our production-ready SDK:

import{LevelCodeClient}from'@levelcode/sdk';constclient=newLevelCodeClient({apiKey: process.env.OPENROUTER_API_KEY,// or ANTHROPIC_API_KEYcwd: '/path/to/project',});constresult=awaitclient.run({agent: 'base',prompt: 'Add error handling to all API endpoints',handleEvent: (event)=>console.log(event),});

Custom Agent Workflows

Create your own specialized agents with TypeScript generators:

exportdefault{id: 'git-committer',displayName: 'Git Committer',model: 'openai/gpt-4o',toolNames: ['read_files','run_terminal_command','end_turn'],instructionsPrompt:
'Create meaningful git commits by analyzing changes and crafting clear commit messages.',async*handleSteps(){yield{tool: 'run_terminal_command',command: 'git diff'};yield{tool: 'run_terminal_command',command: 'git log --oneline -5'};yield'STEP_ALL';},};

Agent Swarms

Scale beyond a single agent. LevelCode's Agent Swarm system lets you spin up an entire coordinated development team that works together on complex tasks -- each agent with a specialized role, communicating through a structured message protocol.

# Enable swarms
levelcode
> /team:enable
# Create a team with a project brief> /team:create name="auth-team" brief="Build OAuth2 login with Google and GitHub providers"# Monitor your swarm in real time> /team:status

The swarm system automatically assigns agents to the right development phase and coordinates handoffs between them:

CapabilityDetails
24 Specialized RolesFrom intern to CTO -- each with calibrated autonomy, tools, and review requirements
6 Development PhasesRequirements, Design, Implementation, Testing, Review, Deployment -- with automatic phase gating
Real-Time TUI PanelLive dashboard showing agent status, messages, tasks, and phase progress
Structured MessagingAgents communicate via a typed protocol with inbox polling and message routing
Task AssignmentHierarchical task breakdown with dependency tracking and automatic delegation
File LockingPrevents conflicts when multiple agents edit the same files concurrently

See the full Agent Swarms Guide for configuration, role definitions, custom team templates, and advanced workflows.


Installation

CLI Installation

# Using npm (recommended)
npm install -g @levelcode/cli
# Using npx (no install needed)
npx @levelcode/cli
# Using bun
bun install -g @levelcode/cli

SDK Installation

# Using npm
npm install @levelcode/sdk
# Using bun
bun add @levelcode/sdk

From Source

# Clone the repository
git clone https://github.com/yethikrishna/levelcode.git
cd levelcode
# Install dependencies
bun install
# Run in development mode
bun dev

System Requirements

  • Node.js 18+ or Bun 1.3.5+
  • Git (optional, for version control features)
  • Terminal with ANSI color support

Quick Start

LevelCode works fully standalone — no backend server, no account, no login required. Just set your API key and start coding.

1. Set Your API Key

Choose one of the following:

# Option A: OpenRouter (200+ models including Claude, GPT, Gemini, DeepSeek, etc.)export OPENROUTER_API_KEY="sk-or-v1-..."# Option B: Anthropic (Claude models directly)export ANTHROPIC_API_KEY="sk-ant-..."

Get your key from OpenRouter or Anthropic.

2. Run LevelCode

# Navigate to your projectcd your-project
# Start LevelCode
levelcode

That's it. No sign-up, no backend, no configuration needed.

3. Start Coding with AI

Just tell LevelCode what you want:

  • "Fix the SQL injection vulnerability in user registration"
  • "Add rate limiting to all API endpoints"
  • "Refactor the database connection code for better performance"
  • "Add unit tests for the authentication module"

LevelCode will find the right files, make changes across your codebase, and validate everything works.

CLI Options

# Use FREE mode (lightweight, lower cost)
levelcode --free
# Use MAX mode (most capable)
levelcode --max
# Run in a specific directory
levelcode --cwd /path/to/project
# Continue a previous conversation
levelcode --continue
# Show all options
levelcode --help

SDK Usage

Basic Usage

import{LevelCodeClient}from'@levelcode/sdk';// Works standalone — just provide your API keyconstclient=newLevelCodeClient({apiKey: process.env.OPENROUTER_API_KEY,// or ANTHROPIC_API_KEYcwd: process.cwd(),});// Run a coding taskconstresult=awaitclient.run({agent: 'base',prompt: 'Add TypeScript types to all function parameters',handleEvent: (event)=>{if(event.type==='file_edit'){console.log(`Edited: ${event.filePath}`);}},});console.log('Output:',result.output);

Custom Agents

import{LevelCodeClient,AgentDefinition}from'@levelcode/sdk';constcodeReviewer: AgentDefinition={id: 'code-reviewer',displayName: 'Code Reviewer',model: 'anthropic/claude-3-opus',toolNames: ['read_files','grep','end_turn'],instructionsPrompt: `You are a senior code reviewer. Focus on security, performance, and maintainability. Provide actionable feedback with code examples.`,};constclient=newLevelCodeClient({apiKey: '...'});constreview=awaitclient.run({agent: 'code-reviewer',agentDefinitions: [codeReviewer],prompt: 'Review the recent changes in src/auth/',handleEvent: console.log,});

CI/CD Integration

# .github/workflows/levelcode-review.ymlname: AI Code Reviewon: [pull_request]jobs:
review:
runs-on: ubuntu-lateststeps:
- uses: actions/checkout@v4
- name: Setup Bunuses: oven-sh/setup-bun@v1
- name: Install LevelCoderun: bun install -g @levelcode/cli
- name: Run AI Reviewenv:
OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}run: levelcode "Review changes and suggest improvements" --output review.md
- name: Post Reviewuses: actions/github-script@v7with:
script: | const review = require('fs').readFileSync('review.md', 'utf8'); github.rest.issues.createComment({ issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, body: review });

Project Structure

levelcode/
├── cli/ # Terminal UI application
│ ├── src/ # CLI source code
│ ├── bin/ # CLI binaries
│ └── scripts/ # Build scripts
├── sdk/ # TypeScript SDK
│ ├── src/ # SDK source code
│ └── e2e/ # End-to-end tests
├── agents/ # Multi-agent system
│ ├── base2/ # Base agent configurations
│ ├── editor/ # Code editing agents
│ ├── file-explorer/ # File discovery agents
│ ├── researcher/ # Documentation research
│ ├── reviewer/ # Code review agents
│ └── thinker/ # Planning agents
├── common/ # Shared utilities
├── packages/ # Internal packages
│ ├── agent-runtime/ # Agent execution runtime
│ └── internal/ # Internal utilities
├── web/ # Web dashboard (optional)
├── evals/ # Evaluation benchmarks
└── docs/ # Documentation

Configuration

Create a levelcode.config.ts in your project root:

import{defineConfig}from'@levelcode/sdk';exportdefaultdefineConfig({// Default modelmodel: 'anthropic/claude-3.5-sonnet',// Per-agent model overridesagents: {editor: {model: 'anthropic/claude-3-opus',maxTokens: 8000,},filePicker: {model: 'anthropic/claude-3-haiku',},},// Files to ignoreignore: ['node_modules/**','*.lock','dist/**','.git/**',],// Custom tools (optional)tools: [],});

Environment Variables

VariableDescriptionRequired
OPENROUTER_API_KEYOpenRouter API key (200+ models)One of these
ANTHROPIC_API_KEYAnthropic API key (Claude direct)is required
LEVELCODE_MODELDefault model to useNo
LEVELCODE_DEBUGEnable debug loggingNo

Standalone Mode: LevelCode runs fully standalone by default. No backend server, database, or account is needed. Just set one API key above and you're ready to go.

Hosted Mode: For team features, billing, and the agent marketplace, visit levelcode.ai.


Documentation

DocumentDescription
Installation GuideDetailed installation instructions
ConfigurationAll configuration options
SDK ReferenceComplete SDK API documentation
Custom AgentsCreating custom agents
Custom ToolsBuilding custom tools
Agent SwarmsMulti-agent team coordination and swarm workflows
ArchitectureHow LevelCode works

Contributing

We love contributions from the community! Whether you're fixing bugs, creating agents, or improving docs.

Development Setup

# Clone the repo
git clone https://github.com/yethikrishna/levelcode.git
cd levelcode
# Install dependencies
bun install
# Run in development mode
bun dev
# Run tests
bun test# Type check
bun typecheck

Ways to Contribute

  • Bug Fixes - Help us squash bugs
  • New Agents - Create specialized agents for specific tasks
  • Model Support - Add new model provider integrations
  • Documentation - Improve guides and examples
  • Benchmarks - Add new evaluation tasks

See CONTRIBUTING.md for detailed guidelines.


Roadmap

  • Standalone Mode (no backend required)
  • Direct OpenRouter/Anthropic API support
  • VS Code Extension
  • JetBrains Plugin
  • Web Interface
  • Team Collaboration
  • Self-Hosted Server Mode
  • Plugin Marketplace

Support


License

LevelCode is open-source software licensed under the Apache License 2.0.


Acknowledgments


Created by Yethikrishna R

If you find LevelCode useful, please consider giving it a star!

Star on GitHub

About

Levelcode — Open-source AI coding agent with multi-agent architecture for precise codebase editing. CLI + web UI + eval harness, built with TypeScript and Bun.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

4 stars

Watchers

0 watching

Forks

Releases

Sponsor this project

Packages

Contributors

Languages