Skip to content

yethikrishna/levelcode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

83 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

LevelCode - The Open-Source AI Coding Agent

The Open-Source AI Coding Agent That Outperforms Claude Code

CI Status License npm version GitHub stars GitHub forks

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


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.

Agent Success Rate Token Efficiency Speed
LevelCode 61% 45k avg 32s avg
Claude Code 53% 62k avg 45s avg
Aider 48% 38k avg 28s avg
Continue 42% 51k avg 38s 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';

const client = new LevelCodeClient({
  apiKey: process.env.OPENROUTER_API_KEY, // or ANTHROPIC_API_KEY
  cwd: '/path/to/project',
});

const result = await client.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:

export default {
  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:

Capability Details
24 Specialized Roles From intern to CTO -- each with calibrated autonomy, tools, and review requirements
6 Development Phases Requirements, Design, Implementation, Testing, Review, Deployment -- with automatic phase gating
Real-Time TUI Panel Live dashboard showing agent status, messages, tasks, and phase progress
Structured Messaging Agents communicate via a typed protocol with inbox polling and message routing
Task Assignment Hierarchical task breakdown with dependency tracking and automatic delegation
File Locking Prevents 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 project
cd 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 key
const client = new LevelCodeClient({
  apiKey: process.env.OPENROUTER_API_KEY, // or ANTHROPIC_API_KEY
  cwd: process.cwd(),
});

// Run a coding task
const result = await client.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';

const codeReviewer: 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.`,
};

const client = new LevelCodeClient({ apiKey: '...' });

const review = await client.run({
  agent: 'code-reviewer',
  agentDefinitions: [codeReviewer],
  prompt: 'Review the recent changes in src/auth/',
  handleEvent: console.log,
});

CI/CD Integration

# .github/workflows/levelcode-review.yml
name: AI Code Review

on: [pull_request]

jobs:
  review:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Setup Bun
        uses: oven-sh/setup-bun@v1

      - name: Install LevelCode
        run: bun install -g @levelcode/cli

      - name: Run AI Review
        env:
          OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
        run: levelcode "Review changes and suggest improvements" --output review.md

      - name: Post Review
        uses: actions/github-script@v7
        with:
          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';

export default defineConfig({
  // Default model
  model: 'anthropic/claude-3.5-sonnet',

  // Per-agent model overrides
  agents: {
    editor: {
      model: 'anthropic/claude-3-opus',
      maxTokens: 8000,
    },
    filePicker: {
      model: 'anthropic/claude-3-haiku',
    },
  },

  // Files to ignore
  ignore: [
    'node_modules/**',
    '*.lock',
    'dist/**',
    '.git/**',
  ],

  // Custom tools (optional)
  tools: [],
});

Environment Variables

Variable Description Required
OPENROUTER_API_KEY OpenRouter API key (200+ models) One of these
ANTHROPIC_API_KEY Anthropic API key (Claude direct) is required
LEVELCODE_MODEL Default model to use No
LEVELCODE_DEBUG Enable debug logging No

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

Document Description
Installation Guide Detailed installation instructions
Configuration All configuration options
SDK Reference Complete SDK API documentation
Custom Agents Creating custom agents
Custom Tools Building custom tools
Agent Swarms Multi-agent team coordination and swarm workflows
Architecture How 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 - An open-source AI coding agent better than Claude Code. Multi-agent architecture for precise codebase editing.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Sponsor this project

Packages

 
 
 

Contributors