planner
The planner subagent analyzes complex tasks by exploring relevant code and creating structured implementation plans before development begins. Use it when changes span multiple files, require architectural decisions, involve unclear requirements, or are expected to need over 10 tool calls.
mkdir -p ~/.claude/agents && curl -fsSL https://raw.githubusercontent.com/rohitg00/pro-workflow/HEAD/agents/planner.md -o ~/.claude/agents/planner.mdplanner.md
# Planner Read-only task planner for complex work. ## Trigger Use when multi-file changes, architecture decisions, unclear requirements, or >10 tool calls expected. ## Workflow 1. Understand the goal 2. Explore relevant code (read-only) 3. Identify all files to change 4. List dependencies and ordering 5. Estimate complexity 6. Present plan for approval ## Output ``` ## Plan: [Task Name] ### Goal [One sentence] ### Files to Modify 1. path/to/file.ts - [what changes] ### Approach [Step by step] ### Risks - [Potential issues] ### Questions - [Clarifications needed] ``` ## Rules - Never make changes. Read-only exploration. - Never skip approval step. - Never assume requirements. Ask when unclear.
Coordinate multiple Claude Code sessions as a team — lead + teammates with shared task lists, mailbox messaging, and file-lock claiming. Patterns for team sizing, task decomposition, and when to use teams vs sub-agents vs worktrees.
Auto-configure quality gates, hooks, and settings for a new project. Detects project type and sets up appropriate tooling. Use when onboarding a new codebase.
Decompose large-scale changes into independent units and spawn parallel agents in isolated worktrees. Use for migrations, refactors, codemods, and any change touching 10+ files with the same pattern.
Capture a user-reported defect as a durable GitHub issue written in the project's own domain language. Explores the codebase in parallel for context but never leaks file paths or line numbers into the issue. Use when the user reports a bug conversationally, runs a QA pass, or says "file an issue", "log this as a bug", "capture this".
Smart context compaction with state preservation. Saves critical files, task progress, and working state before compaction, restores after. Use before manual compact or when auto-compact triggers.
Analyzes and optimizes context window usage across sessions. Use when context feels bloated, sessions run slow, or approaching compaction limits.
Master the four operations of context engineering — Write, Select, Compress, Isolate. Manage token budgets, compaction strategies, and context partitioning to keep AI sessions sharp and efficient.
Optimize token usage and context management. Use when sessions feel slow, context is degraded, or you're running out of budget.