Codebuff

What models do you use?

We use multiple models to get better results: Claude Sonnet for most of the coding, Gemini Flash for quick tasks, and we also use a speculative decoding model from Relace AI for fast file rewrites. We use o3-mini as a file editing fallback, and gpt-4o-mini for some trivial tasks.

We have several modes which change the model setup to achieve different goals:

  • --lite: Uses Gemini 2.5 Flash Thinking instead of Sonnet (~1/5 the cost). It also pulls fewer files, meaning that the context cost will be smaller.
  • --max: Uses a hybrid approach with Gemini 2.5 Pro + Sonnet to better handle complex problems and pulls more files on your codebase.
  • --experimental: Uses cutting-edge experimental features and the most advanced models available (like Gemini 2.5 Pro Experimental). This mode is for users who want to try the latest AI capabilities, though it may be less stable.

How does Codebuff actually work?

Codebuff starts by running through the source files in all subdirectories and parsing them with tree-sitter. We use this information to help find relevant files to you requests.

We have a stateless server that passes messages along to Anthropic, OpenAI, or Gemini and websockets to ferry data back and forth to clients. It effectively acts as a proxy between the client and our LLM providers.

We use a fast model to pick the relevant files, and we load them into context Claude Sonnet responds with the right edit. This main agent can also delegate to other agents, as when it does its planning step, or when searching for files.

Working with Large Projects

In general, Codebuff works quite well in larger projects. For example, we've pulled Codebuff into the VSCode repo (millions of lines of code) and have had no issues in our testing. That said, if you're noticing Codebuff getting stuck/forgetting context too soon or using a ton of credits, here are some tips to help you mitigate those issues.

Directory-Based Approach

When working with large codebases, you can start Codebuff from specific directories to maintain focus:

This helps Codebuff concentrate on relevant files and provide more targeted assistance.

Knowledge Organization

For large projects:

  • Create separate knowledge.md files in key directories, like so:

    services/
    auth-service/
        knowledge.md
        src/
    user-service/
        knowledge.md
        src/
    api-gateway/
        knowledge.md
        src/
    
  • Focus each knowledge file on its directory's specific concerns

  • Link related concepts across knowledge files

  • Keep root knowledge.md for project-wide concepts

Effective Communication

When working with large codebases:

  • Be specific about file locations
  • Reference related files explicitly
  • Break large changes into smaller, focused requests
  • Use the --max mode for better context understanding by loading more files

Performance Tips

  • Leverage your .codebuffignore and .gitignore files to exclude irrelevant directories
  • Start in subdirectories when possible
  • Break large refactoring tasks into smaller chunks
  • Let Codebuff handle file discovery instead of listing all files

Troubleshooting

Install failed

If npm install -g codebuff gave you an error, try using sudo. Otherwise, try reinstalling node with . Then run the codebuff install command again.

Accessing Your Chat History

Your conversation history with Codebuff is stored locally (and nowhere else) at ~/.config/manicode/projects/<your-project-name>/chats.

If you need help, we'd love if you include a copy of your recent chats for us to help you troubleshoot!

Common Issues

Connection Issues

If you see a message like this:

it means you're having connection issues. In that case, try:

  1. Check your internet connection.
  2. Try logging out and back in with logout followed by login.

Command Not Found

If you see "command not found" when trying to run Codebuff:

  1. Ensure Codebuff is installed globally: npm install -g codebuff
  2. Check that your PATH includes npm's global bin directory
  3. Try running which codebuff to verify the installation location

Directory Not Empty

If you see an error like this:

It means you have a directory named .codebuff-SOMEHASH in your node_modules directory. This is a temporary directory created by npm when installing packages. You can safely delete this directory and try again:

Need More Help?

If you're still experiencing issues:

  1. Join our for real-time help from other users!
  2. Contact us at – please note we prioritize subscribers, but we'll likely reply within a week.

Codebuff vs Claude Code

Anthropic recently released Claude Code, their own AI coding assistant.

Both Codebuff and Claude Code:

  • Run in your terminal for a seamless coding experience
  • Understand your entire codebase context
  • Can edit files and execute terminal commands
  • Use Claude Sonnet as their primary model

When to Choose Codebuff

Codebuff might be a better choice if you value:

  • Speed: Codebuff is
  • Cost: Codebuff is one third the cost of Claude Code for equivalent tasks and even less for back-and-forth conversation
  • Codebase Analysis: Codebuff pulls more context from scanning your entire codebase, rather than file-by-file. Codebuff also based on their strengths to provide more accurate results.
  • Staying in Flow: Codebuff requires fewer confirmation prompts for file edits and command execution.
  • Focused changes: Codebuff does just what you asked for, while Claude Code will often get carried away editing more and more files.

When to Choose Claude Code

Claude Code might be a better choice if you:

  • Can't use an intermediary provider, need to use the API directly from Anthropic
  • Prefer usage-based pricing for occasional use (although this is coming soon to Codebuff!)

Feature Comparison

Summary

Both Codebuff and Claude Code are powerful AI coding assistants that can significantly boost your productivity. Codebuff offers more flexible pricing and performance options, while Claude Code provides direct integration with Anthropic's ecosystem.

Configuration

Codebuff can be configured using a codebuff.json file in your project root. This file allows you to customize various aspects of how codebuff operates in your project.

Why configure codebuff?

Configuring codebuff helps you create a seamless development environment where codebuff becomes your central development hub. Instead of juggling multiple terminal windows and manually starting various services, you can let codebuff manage your entire development workflow.

Startup Processes

You can configure startup processes, which will run in the background every time codebuff starts! When you use this feature, codebuff will automatically:

  1. Start your development processes:
    • Servers (frontend, backend, etc.)
    • Launch your database
    • Run any other necessary background services
  2. Manage all these processes for you
  3. Read the logs and outputs and automatically handle any errors that arise

This means you can start your day with a single codebuff command, write code with codebuff's assistance, and when you're done, closing codebuff will cleanly shut down all your development processes. No more scattered terminal windows or forgotten running processes!

Configuration Schema

The configuration file follows this structure:

Example Configuration

Here's an example configuration file that starts a development server and database:

Best Practices

  1. Process Names: Use descriptive names that clearly indicate what each process does.
  2. Working Directories: Use relative paths for cwd to maintain portability.
  3. Logging: Consider using stdoutFile and stderrFile for important processes to help with debugging.
  4. Process Management: Use the enabled flag to temporarily disable processes without removing them from the configuration.

Troubleshooting

If your startup processes aren't working as expected:

  1. Check that the commands work when run manually from the specified working directory
  2. Verify that any referenced paths (for logs or cwd) exist and are writable
  3. Check the process output in the specified log files if you've configured them
  4. Make sure the JSON syntax in your configuration file is valid

Need more help? Check out our guide or join our .

Advanced