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.
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.
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
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:
- Check your internet connection.
- 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:
- Ensure Codebuff is installed globally:
npm install -g codebuff
- Check that your PATH includes npm's global bin directory
- 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:
- Join our for real-time help from other users!
- Contact us at – please note we prioritize subscribers, but we'll likely reply within a week.
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.
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:
- Start your development processes:
- Servers (frontend, backend, etc.)
- Launch your database
- Run any other necessary background services
- Manage all these processes for you
- 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
- Process Names: Use descriptive names that clearly indicate what each process does.
- Working Directories: Use relative paths for
cwd
to maintain portability.
- Logging: Consider using
stdoutFile
and stderrFile
for important processes to help with debugging.
- 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:
- Check that the commands work when run manually from the specified working directory
- Verify that any referenced paths (for logs or cwd) exist and are writable
- Check the process output in the specified log files if you've configured them
- Make sure the JSON syntax in your configuration file is valid
Need more help? Check out our guide or join our .