Best practices
Follow these guidelines to get the most out of your experience with Bob Shell.
Understanding and using modes
Bob's modes are task-specific personas that shape its behavior. Selecting the appropriate mode helps you get the best results.
Built-in modes
Bob Shell comes with three built-in modes, each designed for specific purposes:
| Mode | Purpose | When to use |
|---|---|---|
| Agent | Writing and modifying code | For implementing features, fixing bugs, or making code improvements |
| Plan | Planning and designing | Before implementation, when you need to plan architecture or create technical specifications |
| Ask | Getting information | When you need explanations or information without modifying files |
Mode selection strategy
For the most effective workflow:
Start with Plan mode for new projects or complex features to create a detailed implementation plan before writing any code. Read the plan carefully to confirm it aligns with your goal.
Switch to Agent mode for most day-to-day development tasks when you are ready to implement.
Use Ask mode when you need explanations or information without modifying files.
Switch between modes in a bob chat session by typing /mode agent, /mode plan, or /mode ask. For more details, see Modes.
Custom modes
You can create specialized modes for specific tasks or workflows:
- Create modes for specialized tasks like security reviews or documentation writing.
- Configure custom modes with specific tool access permissions and role definitions.
- Share modes with your team to standardize workflows.
Learn more about creating and configuring custom modes in the Custom modes documentation.
Workflow optimization
Plan before coding
Always start complex projects or features in Plan mode to:
- Generate a detailed implementation plan.
- Break down complex problems into manageable steps.
- Identify potential challenges before they arise.
- Create a roadmap for implementation.
This approach prevents breaking changes and provides a clear direction for development.
Use git as a safety net
Commit your work frequently so you can recover from undesired changes:
- Create frequent, small commits with clear messages.
- Push changes to remote repositories regularly.
- Use branches for experimental features.
If Bob produces subpar results, reverting to a previous commit is more effective than trying to correct flawed output with new instructions. Start a fresh bob chat session after reverting so the bad output is no longer in context.
Monitor usage and optimize costs
Track your Bobcoin consumption by reviewing your account usage. Be mindful of context window size — large conversations consume more tokens and therefore more Bobcoins.
Integrate with version control
Git provides an essential safety net to prevent accidental, permanent deletion of code. Commit regularly before and after significant AI-assisted changes.
Communication strategies
Write effective prompts
The quality of your prompts directly affects the quality of Bob's responses:
- Be specific and clear: Vague prompts lead to vague outputs. Detail what Bob should and should not do.
- Provide examples: When possible, include examples of the desired output format or style.
Use context mentions
Context mentions let you reference specific elements of your project directly in your conversations with Bob Shell:
- Use
@/path/to/file.jsto include specific file contents. - Use
@/path/to/folderto include all files in a directory.
bob chat
# Reference a specific file
> Explain what @src/utils.js does and how it works
# Reference a directory
> Review the tests in @tests/ and identify any gapsThis approach is more efficient than copying and pasting code or describing file locations.
Manage the context window
Bob has a context window of 270,000 tokens, which includes your conversation history, file contents, and tool output. To use it effectively:
- Start new
bob chatsessions regularly with specific aims. - Avoid giving Bob your entire codebase at once.
- Use direct file references to provide targeted context.
- Break complex tasks into smaller, focused subtasks.
See Context window management for a deeper explanation of how the context window works and strategies for managing it.
Security and control
Configure auto-approval settings
Bob Shell allows you to control which actions require your approval before they run:
- Manual approval: Review and approve every action Bob takes (safest setting).
- Auto-approve: Grant Bob the ability to run specific tasks without interruption.
- Hybrid approach: Auto-approve low-risk actions while requiring confirmation for riskier tasks.
- Auto-approved commands: Define a list of trusted commands that Bob can run without requesting approval each time.
Configure these settings in ~/.bob/settings/settings.json based on your comfort level and the sensitivity of your project.
Learn more about auto-approval settings in the Auto-approving actions documentation.
Use .bobignore
The .bobignore file lets you specify files and directories that Bob should not access or modify:
Create a .bobignore file in your project root.
Add patterns for sensitive files, build artifacts, and large assets.
Use the same syntax as .gitignore.
This helps protect sensitive information and prevent accidental changes to generated files.
Learn more about controlling file access in the Ignoring files documentation.
For more detailed information on security guidelines, see Security guidelines.
Set up rules
Bob allows you to specify rules to control how Bob performs tasks:
- Define rules globally or per project in the
.bobdirectory. - Create mode-specific rules in
.bob/rules-{mode-slug}/directories. - Use rules to enforce coding standards, documentation requirements, or other workflow constraints.
For more information on custom modes and rules, see the Custom modes documentation.
Starting a non-interactive session
Non-interactive sessions provide a method to use Bob Shell directly from the command line without entering an interactive session. Use for automation, scripting, and batch processing tasks.
Usage examples
Practical examples showing how to use Bob Shell for debugging, code improvement, file creation, documentation generation, and learning new concepts.