$curl -o .claude/agents/codebase-searcher.md https://raw.githubusercontent.com/futuregerald/futuregerald-claude-plugin/HEAD/agents/codebase-searcher.mdUse this subagent for comprehensive codebase exploration and search tasks.
| 1 | # Codebase Searcher Subagent |
| 2 | |
| 3 | Use this subagent for comprehensive codebase exploration and search tasks. |
| 4 | |
| 5 | **Purpose:** Find files, patterns, implementations, and gather context across the codebase |
| 6 | |
| 7 | **When to use:** |
| 8 | |
| 9 | - Before implementation to understand existing patterns |
| 10 | - When investigating how something works |
| 11 | - Finding all usages of a function/component/pattern |
| 12 | - Discovering related files for a feature |
| 13 | - Answering architectural questions |
| 14 | |
| 15 | ## Dispatch Configuration |
| 16 | |
| 17 | ``` |
| 18 | Task tool: |
| 19 | subagent_type: Explore |
| 20 | description: "Search: [what you're looking for]" |
| 21 | ``` |
| 22 | |
| 23 | ## Prompt Template |
| 24 | |
| 25 | ``` |
| 26 | Search the codebase for: [SPECIFIC SEARCH GOAL] |
| 27 | |
| 28 | ## Search Context |
| 29 | |
| 30 | [Why you need this information - what task or decision it supports] |
| 31 | |
| 32 | ## Search Scope |
| 33 | |
| 34 | Project: [Project name and stack] |
| 35 | |
| 36 | Key directories to check: |
| 37 | [List relevant directories for your project, e.g.:] |
| 38 | - src/controllers/ - API controllers |
| 39 | - src/models/ - Data models |
| 40 | - src/services/ - Business logic |
| 41 | - src/components/ - UI components |
| 42 | - tests/ - Test files |
| 43 | |
| 44 | ## What I Need |
| 45 | |
| 46 | [Specific questions to answer, patterns to find, or files to locate] |
| 47 | |
| 48 | Examples: |
| 49 | - "Find all places where comments are handled" |
| 50 | - "How does the reaction system work end-to-end?" |
| 51 | - "What components exist for user display?" |
| 52 | - "Find the pattern used for API responses" |
| 53 | |
| 54 | ## Report Format |
| 55 | |
| 56 | Provide: |
| 57 | 1. **Files Found** - Relevant files with brief description of each |
| 58 | 2. **Patterns Discovered** - How the codebase handles similar things |
| 59 | 3. **Key Code Sections** - Important snippets with file:line references |
| 60 | 4. **Gaps/Missing** - What doesn't exist yet that might be needed |
| 61 | 5. **Recommendations** - Suggestions based on findings |
| 62 | ``` |
| 63 | |
| 64 | ## Thoroughness Levels |
| 65 | |
| 66 | Specify in the Task description: |
| 67 | |
| 68 | - **quick** - Basic pattern matching, first few results |
| 69 | - **medium** - Moderate exploration, follows some references |
| 70 | - **very thorough** - Comprehensive analysis, multiple search strategies |
| 71 | |
| 72 | ## Usage Examples |
| 73 | |
| 74 | ### Finding existing patterns |
| 75 | |
| 76 | ```typescript |
| 77 | Task({ |
| 78 | subagent_type: 'Explore', |
| 79 | description: 'Search: comment handling patterns (medium)', |
| 80 | prompt: `Search the codebase for: How comments are currently handled |
| 81 | |
| 82 | ## Search Context |
| 83 | |
| 84 | I need to implement a CommentThread component and want to understand |
| 85 | the existing comment infrastructure. |
| 86 | |
| 87 | ## What I Need |
| 88 | |
| 89 | 1. Where is the Comment model defined? |
| 90 | 2. What API endpoints exist for comments? |
| 91 | 3. Are there any existing comment-related components? |
| 92 | 4. How are comments serialized for the frontend? |
| 93 | 5. What validation exists for comment input? |
| 94 | |
| 95 | [... rest of template ...] |
| 96 | `, |
| 97 | }) |
| 98 | ``` |
| 99 | |
| 100 | ### Finding all usages |
| 101 | |
| 102 | ```typescript |
| 103 | Task({ |
| 104 | subagent_type: 'Explore', |
| 105 | description: 'Search: Button component usages (quick)', |
| 106 | prompt: `Search the codebase for: All usages of the Button component |
| 107 | |
| 108 | ## Search Context |
| 109 | |
| 110 | Planning to update Button variants and need to understand impact. |
| 111 | |
| 112 | ## What I Need |
| 113 | |
| 114 | 1. Which pages/components import Button? |
| 115 | 2. What variants are currently used? |
| 116 | 3. Are there any custom styling overrides? |
| 117 | |
| 118 | [... rest of template ...] |
| 119 | `, |
| 120 | }) |
| 121 | ``` |
| 122 | |
| 123 | ### Architectural investigation |
| 124 | |
| 125 | ```typescript |
| 126 | Task({ |
| 127 | subagent_type: 'Explore', |
| 128 | description: 'Search: notification system architecture (very thorough)', |
| 129 | prompt: `Search the codebase for: Complete notification system implementation |
| 130 | |
| 131 | ## Search Context |
| 132 | |
| 133 | Need to add UI for notifications. Want complete picture of backend. |
| 134 | |
| 135 | ## What I Need |
| 136 | |
| 137 | 1. Notification model and relationships |
| 138 | 2. How notifications are created (triggers) |
| 139 | 3. API endpoints for notifications |
| 140 | 4. Any existing frontend components |
| 141 | 5. Email notification integration |
| 142 | 6. Preference management |
| 143 | |
| 144 | [... rest of template ...] |
| 145 | `, |
| 146 | }) |
| 147 | ``` |
| 148 | |
| 149 | ## Best Practices |
| 150 | |
| 151 | 1. **Be specific** - "Find comment components" vs "Find files" |
| 152 | 2. **Provide context** - Why you need this helps focus the search |
| 153 | 3. **Set thoroughness** - Don't over-search for simple lookups |
| 154 | 4. **Use for unknowns** - Don't guess, search first |
| 155 | 5. **Follow up** - If initial search is incomplete, refine and search again |