// Plan & Build

Plan first. Then build to the plan.

pasclaw plan runs the agent in a dedicated planning mode with a plan_write tool that emits workspace/PLAN.md. pasclaw build then auto-loads the plan as system-prompt context, optionally drives the Ralph judge loop with --goal, and archives consumed plans so a build is always traceable back to a plan.

pmPlan modePLAN.md--goal seedPlan archive
01

Plan in its own mode

pasclaw plan -d "<task>" runs the agent in pmPlan with a dedicated plan_write tool. The output lands at workspace/PLAN.md with stable headings: Goal, Files, Steps, Open questions, Risks.

02

Build loads the plan

pasclaw build auto-loads PLAN.md as a Project Plan section in the system prompt. A stale-check warns when the plan looks out of date, and --no-plan opts out for ad-hoc runs.

03

Goal-seeded Ralph

build --goal parses the ## Goal heading and seeds the Ralph judge loop with it, so the build keeps iterating until the judge marks the goal MET or FAILED.

04

Replicate cog mode switch

cog-build/predict.py exposes a 4-choice mode input (build, plan, plan build, plan build goal), so the same Replicate predictor can plan, build, or do both in one invocation.

From the documentation

Technical details

Implementation notes drawn from the PasClaw repository documentation.

Plan mode writes PLAN.md

pasclaw plan -d "<task>" runs the agent in pmPlan with a dedicated plan_write tool. The output uses stable headings so pasclaw build can parse them reliably.

  • Headings: ## Goal / ## Files / ## Steps / ## Open questions / ## Risks.
  • Consumed plans are archived to workspace/memory/plans/<ts>.md.
  • --no-plan opts a build run out of auto-loading PLAN.md.

Replicate cog mode switch

cog-build/predict.py exposes a 4-choice mode input so a single Replicate invocation can plan, build, or do both.

mode: build | plan | plan build | plan build goal

Common questions

Frequently asked questions

Keep exploring

See how the rest of PasClaw fits together.

Ralph judge loop