Refactor with Confidence Using Agents
For large refactors, Claude Code can spawn specialised agents that explore different parts of the codebase in parallel:
"I want to rename the Post model to Tip everywhere.
Explore the codebase first to find all references."
Claude will launch Explore agents that search for:
- Model references in controllers, views, tests
- Database table names in migrations
- Route model bindings
- Factory and seeder references
- Config and relationship references
Once exploration is complete, Claude presents a comprehensive plan before making any changes.
You can also be explicit about using agents:
"Use 3 explore agents in parallel to find:
1. All Eloquent queries that reference the posts table
2. All Blade views that use the Post model
3. All test files that create Post instances"
This parallel exploration is much faster than Claude reading files one at a time, and ensures nothing gets missed before a single line of code changes.
Explore first, refactor second — agents make sure Claude knows the full blast radius before it touches anything.
Log in to leave a comment.
The /security-review command scans your uncommitted changes for injection vectors, auth gaps, hardcoded secrets, and other common vulnerabilities.
The SessionStart hook fires when any session begins or resumes, making it ideal for loading environment variables and running one-time setup scripts.
Ask Claude to write property-based tests for your functions using fast-check — it identifies the mathematical invariants in your code and generates tests that cover inputs you'd never enumerate by hand.