find-code
Find Code
Rule: Never scan the repo with AI. Run a tool, read the results, go directly to the file or refine the search and run again.
Quick Start
# Find anything by pattern
bash <skill-dir>/scripts/find.sh "createUser"
# Find a file by name
bash <skill-dir>/scripts/find.sh --file "userService"
# Find where a symbol is defined
bash <skill-dir>/scripts/find.sh --def "createUser"
# Find all callers of a function
bash <skill-dir>/scripts/find.sh --callers "createUser"
Output is always file:line: content — use the file path and line number to jump directly.
Workflow
1. Choose a search mode
| Goal | Command |
|---|---|
| Find text / regex anywhere | find.sh "pattern" |
| Find a file by name | find.sh --file "name" |
| Find where symbol is defined | find.sh --def "SymbolName" |
| Find all callers / usages | find.sh --callers "SymbolName" |
| Find all imports of a module | find.sh --imports "moduleName" |
| Find by file type | find.sh "pattern" --ext ts |
| Find in a specific folder | find.sh "pattern" --in src/services |
2. Read results — never re-scan
Results come back as:
src/services/userService.ts:14:export async function createUser(
src/handlers/users.ts:31: const user = await createUser(body);
Each line tells you: which file, which line, what's there. Navigate directly — do not open other files to double-check.
3. Refine if needed
If results are too broad, narrow the search:
# Too many results → scope to a folder
bash <skill-dir>/scripts/find.sh "create" --in src/services
# Still too broad → add file type filter
bash <skill-dir>/scripts/find.sh "create" --in src/services --ext ts
# Looking for exact function signature
bash <skill-dir>/scripts/find.sh --def "createUser" --ext ts
If results are empty, broaden:
# Try case-insensitive
bash <skill-dir>/scripts/find.sh "createuser" --flags "-i"
# Try filename only
bash <skill-dir>/scripts/find.sh --file "user"
4. Jump to the file
Once you have file:line, read only that file starting at that line:
# Agent reads file at the exact line — no re-scanning
Guardrails
- Never use AI to guess file locations — always run
find.shfirst. - Never open a file to search inside it — run another
find.shinstead. - Results cap at 50 lines by default. If truncated, narrow the search rather than raising the limit.
- Do not chain more than 3 refinements without reporting back to the user.
References
- REFERENCE.md — grep recipes, regex patterns by language, common search scenarios.
More from rockclaver/systemcraft
code-graph
Builds and maintains a `.claude/codegraph.md` index of a codebase — a structured map of every module with purpose, key exports, and dependencies — so the agent can navigate any repo by reading one file instead of scanning dozens. Use when starting work on an unfamiliar codebase, when asked to index a repo, when context costs are high from repeated scans, or at the start of any task that will touch multiple files.
14grill-me
Interview the user relentlessly about a plan or design until reaching shared understanding, resolving each branch of the decision tree. Use when user wants to stress-test a plan, get grilled on their design, or mentions "grill me".
13prd-to-plan
Turn a PRD into a multi-phase implementation plan using tracer-bullet vertical slices, saved as a local Markdown file in ./plans/. Use when user wants to break down a PRD, create an implementation plan, plan phases from a PRD, or mentions "tracer bullets".
13write-a-prd
Create a PRD through user interview, codebase exploration, and module design, then submit as a GitHub issue. Use when user wants to write a PRD, create a product requirements document, or plan a new feature.
13design-api
Design and implement consistent, DRY REST API endpoints for database models — handlers, routing, validation, error responses, and shared utilities — then generate test coverage for every endpoint. Use when the user asks to write an API, add endpoints for a model, build a REST layer, or create CRUD routes.
13write-tests
Write high-value automated tests and improve practical code coverage by inspecting the repository, inferring the active stack, and targeting risky untested behavior first. Use when the user wants stronger tests, broader test coverage, missing test identification, coverage-driven test writing, or regression tests for an existing codebase.
13