We primarily use Claude 3.5 Sonnet for the coding, and Gemini Flash to find relevant files, and o3-mini for deep thinking.
Codebuff also uses for fast file rewrites.
We have two new modes, which slightly changes the above set-up, mainly to achieve higher performance (in max
) or lower cost (in lite
):
--max
: uses o3-mini for thinking through hard problems, and does so more frequently. It also uses Claude 3.5 Sonnet for editing and pulls more files, meaning it often gets better context on your codebase.
--lite
: uses Claude 3.5 Haiku for editing instead of Sonnet (~1/3 the cost). It also pulls fewer files, meaning that the context cost will be much smaller.
You can use codebuff --max
or codebuff --lite
to set the mode at startup time!
Codebuff starts by running through the source files in that directory and subdirectories and parsing out all the function and class names (or equivalents in 11 languages) with the tree-sitter library.
Then, it fires off a request to Claude Haiku 3.5 to cache this codebase context so user inputs can be responded to with lower latency (Prompt caching is OP!).
We have a stateless server that passes messages along to Anthropic or OpenAI and websockets to ferry data back and forth to clients. It effectively acts as a proxy between the client and our LLM providers.
Claude 3.5 Haiku picks the relevant files, and we load them into context and Claude 3.5 Sonnet responds with the right edit.
We also use a combination of Claude 3.5 Sonnet and GPT-4o-mini to rewrite files with an intended edit – combining Sonnet's and GPT-4o-mini's lets us efficiently patch the code changes through.
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 (--lite tends to have a smaller context window)
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
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
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.