---
title: 'How does Codebuff actually work?'
section: 'advanced'
tags: ['introduction', 'faq']
order: 2
---

# 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.6. It reads your prompt, gathers context, and spawns subagents. The orchestrator is available in several variants:

- [`base2`](/publishers/codebuff/agents/base2) - Default mode orchestrator
- [`base2-free`](/publishers/codebuff/agents/base2-free) - Free mode (faster, no credit cost)
- [`base2-max`](/publishers/codebuff/agents/base2-max) - Max mode (best-of-N selection)
- [`base2-plan`](/publishers/codebuff/agents/base2-plan) - Plan mode (no file writes)

## Subagents

- [**File Picker**](/publishers/codebuff/agents/file-picker) (Gemini 2.0 Flash) - finds relevant files
- [**Code Searcher**](/publishers/codebuff/agents/code-searcher) - grep-style pattern matching
- [**Researcher**](/publishers/codebuff/agents/researcher) (Grok 4 Fast) - web and docs lookup
- [**Thinker**](/publishers/codebuff/agents/thinker) (GPT-5.1, Gemini 2.5 Pro) - works through hard problems
- [**Editor**](/publishers/codebuff/agents/editor) (GPT-5.1, Claude Opus 4.6) - writes and modifies code
- [**Reviewer**](/publishers/codebuff/agents/reviewer) (Claude Opus 4.6, MiniMax M2.5 in Free mode) - catches bugs and style issues
- [**Commander**](/publishers/codebuff/agents/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.
