Does Plan Mode + Context Clearing beat direct execution in Claude Code?
A benchmarking framework that compares three execution modes in Claude Code to find when planning helps, when it hurts, and whether clearing context makes a difference.
| Mode | How it works |
|---|---|
| Normal | Single session. Claude reads, edits, tests -- all in one go. |
| Plan + Resume | Phase 1: plan (read-only). Phase 2: resume same session to execute. Full context preserved. |
| Plan + Clear | Phase 1: plan (read-only), save plan to file. Phase 2: fresh session reads plan and executes. Context cleared. |
- Normal vs Plan+Resume -- Does planning alone improve quality?
- Plan+Resume vs Plan+Clear -- Does clearing context improve quality?
- Normal vs Plan+Clear -- Does the full workflow (plan + clear) improve quality?
# Install dependencies
pnpm install
# Build all packages
pnpm build
# Validate a task
pnpm cli validate tasks/bug-fix/off-by-one-loop
# Run benchmarks (requires Claude Code SDK / API key)
pnpm cli run --tasks all --modes normal,plan-resume,plan-clear --runs 3
# View results
pnpm cli report
# Start website dev server
pnpm dev:websiteplanmode-bench/
├── packages/
│ ├── schema/ # Zod schemas for tasks, results, config
│ ├── runner/ # Benchmark execution engine (3 modes)
│ ├── evaluator/ # Result scoring (test-suite, build, file-check, regex, custom)
│ ├── cli/ # Developer CLI (validate, run, scaffold, report)
│ └── website/ # Next.js dashboard with Recharts
├── tasks/ # Benchmark task definitions
│ ├── bug-fix/off-by-one-loop/ (easy)
│ ├── feature-addition/add-pagination/ (medium)
│ └── refactoring/extract-service-layer/ (hard)
├── results/ # Benchmark results (JSON)
└── config/ # Runner configuration
# Scaffold a new task
pnpm cli scaffold bug-fix/my-new-task
# Edit the generated files:
# - tasks/bug-fix/my-new-task/task.yaml (task definition)
# - tasks/bug-fix/my-new-task/scaffold/ (starting code)
# Validate
pnpm cli validate tasks/bug-fix/my-new-taskid: "bug-fix/my-new-task"
name: "Fix My Bug"
version: 1
category: "bug-fix" # bug-fix | feature-addition | refactoring | algorithm | multi-file | test-writing | performance | api-integration
difficulty: "medium" # easy | medium | hard | expert
estimated_time_minutes: 10
tags: ["typescript"]
author: "your-github-username"
created_at: "2026-04-03"
prompt: |
Describe what Claude should do.
setup:
install_command: "npm install"
timeout_minutes: 10
max_budget_usd: 2.00
evaluation:
- type: "test-suite"
command: "npx vitest run"
weight: 0.7
- type: "build"
command: "npx tsc --noEmit"
weight: 0.3- Runner copies a task's
scaffold/into a temp directory - Runs the task in the specified mode via the Claude Agent SDK
- Evaluator scores the result using weighted strategies
- Results are saved as JSON and aggregated into summaries
- Website renders the comparison dashboard
- Fork the repo
- Create a new task:
pnpm cli scaffold <category>/<name> - Fill in
task.yamland scaffold code - Validate:
pnpm cli validate tasks/<category>/<name> - Submit a PR
MIT