Overview
Pro Workflow is the master skill containing all core patterns for AI-assisted development. It includes the self-correction loop, parallel sessions, context management, learning capture, and multi-phase orchestration.Works with: Claude Code, Cursor, Codex, Gemini CLI, and 32+ AI coding agents via SkillKit. Sections marked (Claude Code) use features specific to Claude Code — Cursor users can skip those or use noted alternatives.
The Core Insight
“80% of my code is written by AI, 20% is spent reviewing and correcting it.” — KarpathyPro Workflow optimizes for that ratio. Every pattern here reduces correction cycles.
1. The Self-Correction Loop
The single most powerful pattern. Your CLAUDE.md trains itself through corrections.How It Works
When you correct Claude:- Claude acknowledges the mistake
- Proposes a rule to prevent it
- You approve → rule goes into memory
- Future sessions avoid the same mistake
Add to CLAUDE.md
Trigger Phrases
- “Add that to your rules”
- “Remember this”
- “Don’t do that again”
Example Flow
Learn Rule Skill
See the dedicated learn-rule skill for the full workflow
2. Parallel Sessions with Worktrees
Zero dead time. While one Claude thinks, work on something else.Setup
Background Agent Management (Claude Code)
Ctrl+F— Kill all background agents (two-press confirmation)Ctrl+B— Send task to background- Subagents support
isolation: worktreein agent frontmatter
When to Parallelize
| Scenario | Action |
|---|---|
| Waiting on tests | Start new feature in worktree |
| Long build | Debug issue in parallel |
| Exploring approaches | Try 2-3 simultaneously |
Parallel Worktrees Skill
See the dedicated skill for complete worktree management
3. The Wrap-Up Ritual
End sessions with intention. Capture learnings, verify state./wrap-up Checklist
- Changes Audit - List modified files, uncommitted changes
- State Check - Run
git status, tests, lint - Learning Capture - What mistakes? What worked?
- Next Session - What’s next? Any blockers?
- Summary - One paragraph of what was accomplished
Create Command
~/.claude/commands/wrap-up.md:
Wrap-Up Skill
See the dedicated wrap-up skill for the complete ritual
4. Split Memory Architecture
For complex projects, modularize Claude memory.Structure
AGENTS.md
SOUL.md
5. The 80/20 Review Pattern
Batch reviews at checkpoints, not every change.Review Points
- After plan approval
- After each milestone
- Before destructive operations
- At /wrap-up
Add to CLAUDE.md
6. Model Selection
Opus 4.6 and Sonnet 4.6 both support adaptive thinking and 1M-token context (as of 2025-08). The 1M context is available as a beta option (via thecontext-1m-2025-08-07 beta header); the default context window remains 200K. Sonnet 4.5 (200K context) has been retired from the Max plan in favor of Sonnet 4.6.
| Task | Model |
|---|---|
| Quick fixes, exploration | Haiku 4.5 |
| Features, balanced work | Sonnet 4.6 |
| Refactors, architecture | Opus 4.6 |
| Hard bugs, multi-system | Opus 4.6 |
Adaptive Thinking
Opus 4.6 and Sonnet 4.6 automatically calibrate reasoning depth per task — lightweight for simple operations, deep analysis for complex problems. No configuration needed. Extended thinking is built-in.See Models overview for current capabilities.
7. Context Discipline
200k tokens is precious. Manage it.Rules
- Read before edit
- Compact at task boundaries
- Disable unused MCPs (<10 enabled, <80 tools)
- Summarize explorations
- Use subagents to isolate high-volume output (tests, logs, docs)
Context Compaction
- Auto-compacts at ~95% capacity (keeps long-running agents alive)
- Configure earlier compaction:
CLAUDE_AUTOCOMPACT_PCT_OVERRIDE=50 - Use PreCompact hooks to save state before compaction
- Subagents auto-compact independently from the main session
Good Compact Points
- After planning, before execution
- After completing a feature
- When context >70%
- Before switching task domains
Context Optimizer Skill
See the dedicated skill for advanced token management
8. Learning Log
Auto-document insights from sessions.Add to CLAUDE.md
Learn Claude Code
Run/learn for a topic-by-topic guide covering sessions, context, CLAUDE.md, subagents, hooks, and more. Official docs: https://code.claude.com/docs/
Quick Setup
Minimal
Add to your CLAUDE.md:Full Setup
Hooks (Claude Code)
Pro-workflow includes automated hooks to enforce the patterns. Cursor users get equivalent enforcement through.mdc rules in the rules/ directory.
PreToolUse Hooks
| Trigger | Action |
|---|---|
| Edit/Write | Track edit count, remind at 5/10 edits |
| git commit | Remind to run quality gates |
| git push | Remind about /wrap-up |
PostToolUse Hooks
| Trigger | Action |
|---|---|
| Code edit (.ts/.js/.py/.go) | Check for console.log, TODOs, secrets |
| Test commands | Suggest [LEARN] from failures |
Session Hooks
| Hook | Action |
|---|---|
| SessionStart | Load LEARNED patterns, show worktree count |
| Stop | Context-aware reminders using last_assistant_message |
| SessionEnd | Check uncommitted changes, prompt for learnings |
| ConfigChange | Detect when quality gates or hooks are modified mid-session |
Install Hooks
Hook Philosophy
Based on production insights:- Non-blocking - Hooks remind, don’t block (except dangerous ops)
- Checkpoint-based - Quality gates at intervals, not every edit
- Learning-focused - Always prompt for pattern capture
Contexts
Switch modes based on what you’re doing.| Context | Trigger | Behavior |
|---|---|---|
| dev | ”Let’s build” | Code first, iterate fast |
| review | ”Review this” | Read-only, security focus |
| research | ”Help me understand” | Explore, summarize, plan |
Agents
Specialized subagents for focused tasks.| Agent | Purpose | Tools |
|---|---|---|
| planner | Break down complex tasks | Read-only |
| reviewer | Code review, security audit | Read + test |
| scout | Confidence-gated exploration | Background, worktree |
| orchestrator | Multi-phase feature development | Full tools, memory |
| debugger | Systematic bug investigation | Full tools, memory |
When to Delegate
Use planner agent when:- Task touches >5 files
- Architecture decision needed
- Requirements unclear
- Before committing
- PR reviews
- Security concerns
Custom Subagents (Claude Code)
Create project-specific subagents in.claude/agents/ or user-wide in ~/.claude/agents/:
- Define with YAML frontmatter + markdown system prompt
- Control tools, model, permission mode, hooks, and persistent memory
- Use
/agentsto create, edit, and manage interactively - Preload skills into subagents for domain knowledge
Agent Teams (Claude Code, Experimental)
Coordinate multiple Claude Code sessions as a team:- Enable:
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 - Lead session coordinates, teammates work independently
- Teammates message each other directly (not just report back)
- Shared task list with dependency management
- Display: in-process (
Shift+Downto navigate, wraps around) or split panes (tmux/iTerm2) - Delegate mode (Shift+Tab): lead coordinates only, no code edits
- Best for: parallel reviews, competing hypotheses, cross-layer changes
- Docs: https://code.claude.com/docs/agent-teams
9. Orchestration: Command > Agent > Skill
The most powerful pattern for complex features. Three layers, each with a single job.The Architecture
Multi-Phase Development (/develop)
For features touching >5 files or needing architecture decisions:- Research → orchestrator agent explores codebase, scores confidence (0-100)
- Plan → presents approach, files to change, risks. Waits for approval.
- Implement → executes plan step by step with quality gates every 5 edits
- Review → reviewer agent checks for security, logic, quality
Agent Skills (Preloaded)
On-Demand Skills (Invoked)
Skills withuser-invocable: true are called via /skill-name. Use context: fork for isolated execution that doesn’t pollute main context.
When to Orchestrate
| Scenario | Pattern | |----------|---------|| | Feature > 5 files |/develop with orchestrator |
| Bug investigation | debugger agent |
| Quick exploration | scout agent (background) |
| Code review | reviewer agent |
| Simple task | Just do it directly |
Orchestrate Skill
See the dedicated skill for multi-phase development patterns
10. Daily Habits
Every Session
- Run
/doctorif things feel off - Manual
/compactat 50% — don’t wait for auto-compact ultrathinkin prompts for maximum reasoning- Name sessions with
/renamefor easy/resume - End with
/wrap-upto capture learnings
Context Management
- CLAUDE.md: < 60 lines root, < 150 max
- Use
CLAUDE_AUTOCOMPACT_PCT_OVERRIDE=50for proactive compaction - Delegate heavy exploration to subagents
- Keep <10 MCPs, <80 tools
Cross-Agent Tips
- Use Cursor for tab completions + Claude Code in terminal for hard problems
- Same MCP servers work across both (share
.mcp.jsonat project root) - SkillKit translates skills to any agent:
npx skillkit translate pro-workflow --agent cursor
MCP Config (Claude Code)
Start with 3 MCPs. Add only for concrete needs. Essential:context7— Live documentation lookupplaywright— Browser automation (most token-efficient)github— PRs, issues, code search
mcp-config.example.json for setup and curated recommendations.
Commands (Claude Code)
| Command | Purpose | Cursor Equivalent |
|---|---|---|
/wrap-up | End-of-session ritual | wrap-up skill |
/learn-rule | Extract correction to memory | learn-rule skill |
/develop | Multi-phase feature build | orchestrate skill |
/doctor | Health check | — |
/commit | Smart commit with quality gates | smart-commit skill |
/insights | Session analytics and patterns | insights skill |
/replay | Surface past learnings | replay-learnings skill |
/handoff | Session handoff document | session-handoff skill |
/search | Search learnings by keyword | — |
/list | List all stored learnings | — |
/learn | Topic-by-topic Claude Code guide | — |
Reference Guides
Deep dives on configuration and features:| Guide | Topics |
|---|---|
docs/settings-guide.md | All settings keys, permission modes, hierarchy, sandbox, env vars |
docs/cli-cheatsheet.md | Every CLI flag, keyboard shortcut, slash command |
docs/orchestration-patterns.md | Command > Agent > Skill architecture, frontmatter reference |
docs/context-loading.md | CLAUDE.md monorepo loading, agent memory, skills discovery |
docs/cross-agent-workflows.md | Claude Code + Cursor config mapping, background agents |
docs/new-features.md | Voice mode, agent teams, checkpointing, new hook events |
docs/daily-habits.md | Session habits, debugging tips, terminal setup, anti-patterns |
Philosophy
Next Steps
Smart Commit
Add quality gates to your commit process
Wrap-Up Ritual
End sessions with intention and learning capture
Learn Rule
Turn mistakes into permanent memory
Orchestrate
Build features through structured phases