Answer in brief
Agree on goals, boundaries, acceptance evidence, and rollback before the Agent edits files.
Many complex tasks fail before code is written: the user and Agent never established the same finish line. Plan Mode encourages investigation and design before execution, while a task contract makes the plan reviewable.
What Plan Mode Does
DeepSeek Harness records Plan Mode as per-Agent collaboration state. The Agent investigates and submits a plan through exit_plan_mode; the user can approve or continue planning with feedback.
It is soft guidance, not a security boundary. Pair it with read-only sandbox and approval policy when writes must be impossible.
The Four-Part Contract
Goal: add rate limiting to the login endpoint.
Scope: src/auth and matching tests; preserve the public response shape.
Acceptance: threshold and window-reset tests pass; existing tests pass;
report every changed file.
Rollback: do not migrate the database. Stop if a schema change is required.
- The goal describes the end state.
- Scope lists allowed and forbidden surfaces.
- Acceptance names observable evidence.
- Rollback defines high-risk stop conditions.
Planning Prompt
Enter Plan Mode. Read only the minimum necessary files and identify:
1. current entry points, configuration, and tests;
2. the smallest viable change and alternatives;
3. file-level steps and verification;
4. unverified assumptions and approvals.
Do not edit. Submit the plan and wait.
Review evidence, coverage, step size, scope, and stop conditions. Ask to continue planning when the proposal introduces unrelated refactors or treats an assumption as fact.
Execute in Checkpoints
After approval, require each step to report:
Completed:
Evidence:
Deviation from plan:
Next:
If investigation invalidates the plan, update it instead of silently changing the objective.
Exercise
Plan one documentation or test-only Issue twice: first from a one-line request, then from the four-part contract. Compare file reads, explicit evidence, and out-of-scope steps. Approve only the first independently verifiable step.
Next: Feedback Loops and Independent Review.