Interactive Coding Sessions
Starting a New Feature
When beginning work on a new feature, follow this workflow:Debugging Issues
When you encounter a bug:Let the agent investigate
The agent will:
- Read relevant files
- Identify the root cause
- Propose a fix
- Make the necessary changes
Refactoring Code
For large refactoring tasks, use MAX mode:- Start with a clear description of what you want to change and why
- Let the agent analyze the current structure first
- Request tests before making changes to ensure behavior preservation
- Review changes incrementally rather than accepting everything at once
Creating and Testing Custom Agents
Initial Setup
Initialize project
Create the agent directory structure:This creates:
knowledge.md- Project context.agents/- Agent directory.agents/types/- TypeScript types
Testing Custom Agents
Test agents without publishing:Debugging Agent Issues
Common issues and solutions:Agent not appearing
Agent not appearing
Symptoms: Your agent doesn’t show up when typing
@Checklist:- Is the file in
.agents/directory? - Does it export
defaultor named exportagent? - Is the
idfield unique? - Did you restart the CLI after creating it?
Agent errors during execution
Agent errors during execution
Symptoms: Agent starts but fails with errorsCommon causes:
- Invalid tool calls in the agent definition
- Incorrect instructions format
- Missing required fields
- Check the error message in the chat
- Review agent definition against the TypeScript types
- Simplify the agent to isolate the issue
Agent behavior not as expected
Agent behavior not as expected
Symptoms: Agent runs but doesn’t do what you wantSolutions:
- Make instructions more specific and detailed
- Add examples of desired behavior
- Use
<think>blocks to see agent reasoning - Adjust the system prompt
- Try a different model (switch to MAX mode)
Publishing Agents to the Store
Share your agents with the community:Publisher Setup
Before you can publish, you need a publisher account:- Visit https://codebuff.com/publishers
- Create a new publisher profile
- Copy your publisher ID
- Add it to your agent’s
publisherfield
Best Practices
Communication
Be Specific
Provide clear, specific instructions:Good:Less effective:
Provide Context
Help the agent understand your project:
- Fill out
knowledge.mdwith project details - Mention relevant files or modules
- Describe architectural constraints
- Share coding conventions
Iterate Incrementally
Break large tasks into steps:
- “First, create the database schema”
- “Now add the API endpoints”
- “Add input validation”
- “Add error handling”
- “Finally, add tests”
Organization
Use Agent Modes Strategically
Choose the right mode for the task:
- FREE: Quick questions, simple edits, documentation
- DEFAULT: Most coding tasks, bug fixes, features
- MAX: Complex refactoring, architecture changes, thorough reviews
- PLAN: Strategic planning, design decisions, breaking down large projects
Keep Conversations Focused
Start a new conversation when switching contexts:This helps the agent:
- Focus on the current task
- Avoid confusion from unrelated history
- Load relevant context more efficiently
Leverage Bash Integration
Run tests and checks during development:This keeps you in the flow without switching windows.
Code Quality
Request Tests
Always ask for tests with new functionality:
Review Before Accepting
Use the review feature for important changes:
Use Knowledge Files
Maintain
knowledge.md with:- Architectural decisions
- Coding standards
- Common patterns
- Things to avoid
Advanced Workflows
Multi-File Refactoring
For changes across many files:Working with Images
For UI implementation:Automating Repetitive Tasks
Create agents for common tasks:Continuous Learning
Build a knowledge base:Common Pitfalls
Next Steps
Agent Development
Deep dive into creating custom agents
SDK Guide
Integrate Codebuff into your applications
Commands Reference
Complete list of all CLI commands
Examples
See real-world usage examples

