Use Git Worktrees for Parallel Tasks
When Claude spawns subagents for complex tasks, you can give each agent its own isolated copy of the repository using git worktrees. The agent works on a separate branch while your working directory stays completely untouched.
"In a worktree, refactor the auth middleware to use a policy pattern"
This is useful when you want Claude to:
- Prototype an approach without affecting your current work
- Run multiple experiments in parallel
- Make changes that might conflict with what you're doing
The worktree is automatically cleaned up if the agent makes no changes. If changes are made, the worktree path and branch are returned so you can review and merge.
You can also launch multiple worktree agents at once:
"In parallel worktrees:
1. Refactor the notification system to use events
2. Add caching to the tip listing query"
No configuration needed — just ask Claude to work in isolation and it handles the rest.
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.