Codebuff

How does Codebuff actually work?

Codebuff runs multiple agents, each tuned for a specific task.

The Orchestrator

The main agent ("Buffy") runs on Claude Opus 4.5. It reads your prompt, gathers context, and spawns subagents. The orchestrator is available in several variants:

Subagents

  • File Picker (Gemini 2.0 Flash) - finds relevant files
  • Code Searcher - grep-style pattern matching
  • Researcher (Grok 4 Fast) - web and docs lookup
  • Thinker (GPT-5.1, Gemini 2.5 Pro) - works through hard problems
  • Editor (GPT-5.1, Claude Opus 4.5) - writes and modifies code
  • Reviewer (Claude Sonnet 4.5) - catches bugs and style issues
  • Commander (Grok 4 Fast or Claude Sonnet 4.5) - runs terminal commands

Best-of-N Selection (Max Mode)

In Max mode, Codebuff spawns multiple editors with different strategies. A selector compares the outputs and picks the best one.

The Pipeline

  1. Tree-sitter scans your repo and builds a code map
  2. File pickers and searchers find relevant code
  3. Thinkers analyze the problem if needed
  4. Editors generate changes
  5. Reviewers check for issues; commanders run tests

The server is stateless. It streams requests to model providers (Anthropic, OpenAI, Google, xAI) over websockets. Your code stays local; only relevant context is sent.