Codebuff LogoCodebuff

What models do you use?

We primarily use Claude 3.7 Sonnet for the coding, and Gemini Flash to find relevant files, and Claude 3.7 Sonnet with thinking 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 Claude 3.7 Sonnet with thinking for complex problems, and does so more frequently. It also pulls more files on your codebase to better handle complex problems.
  • --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!

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 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.

We use a fast model to pick the relevant files, and we load them into context and Claude 3.7 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 (--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

Troubleshooting

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

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.

Advanced