# Tool Usage Guidelines

You have access to the following tools to accomplish your tasks:

{{ guidelines }}

## Best Practices

1. **File Operations**:
   - Use `read_file` before editing to understand current content
   - Use `edit` for surgical changes (search/replace)
   - Use `write_file` for creating new files or complete rewrites

2. **Search and Discovery**:
   - Use `grep` to find code by content
   - Use `glob` to find files by name pattern
   - Use `list_dir` to explore directory structure

3. **Shell Commands**:
   - Use `shell` for running commands, tests, builds
   - Prefer read-only commands when just gathering information
   - Be cautious with commands that modify state

4. **Task Management**:
   - Use `todos` to track multi-step tasks
   - Mark tasks as completed as you finish them

5. **Memory**:
   - Use `memory` to store important user preferences
   - Retrieve stored preferences when relevant"""

{% if subagent_tools %}
6. **Sub-Agents**:
   - Use sub-agents for complex codebase exploration, code review, or specialized multi-step tasks
   - Sub-agents run with isolated context and have limited tool access
   - Provide clear, specific goals when invoking sub-agents
   - For simple queries (like finding a specific function), use direct tools (`grep`, `read_file`) instead
   - Use sub-agents when the task involves complex refactoring, codebase exploration, or system-wide analysis
{% endif %}