Skip to content

Plan and Execute

Use plan mode when the work is bigger than one obvious edit. Anode can inspect, draft a phased plan, name risks, propose checks, and then execute with tracked state.

Start planning in the TUI with the /plan command. Describe your goal and Anode builds a structured plan artifact.

CommandDescription
/plan <goal>Draft a new plan for a larger change.
/plan revise <instructions>Revise the active plan with specific instructions. Requires an active plan.
/plan discardDiscard the active plan, execution state, and pending plan decision.

Every plan contains:

FieldTypeDescription
idstringUnique plan identifier
versionintIncremented on each revision
titlestringHuman-readable plan name
statusstringCurrent plan state
phasesarrayOrdered list of execution phases
risksarrayIdentified risks and mitigations
validationarrayQuality checks to run post-execution
rollbackarrayRollback notes and metadata for undo
confidencestringAgent confidence label such as low, medium, or high
estimated_scopestringSize estimate (small, medium, large)

Each phase is a discrete unit of work:

FieldTypeDescription
idstringPhase identifier
titlestringPhase name
goalstringWhat this phase accomplishes
stepsarrayOrdered steps within the phase
filesarrayFiles this phase touches
toolsarrayTools this phase uses
riskstringRisk level (low, medium, high)
validationarrayPhase-specific validation commands

Validation commands verify that changes work. Each check has:

FieldTypeDescription
namestringCheck name (e.g., “unit tests”)
commandstringShell command to run
expectedstringWhat success looks like

Example:

{
"name": "unit tests",
"command": "go test ./...",
"expected": "all tests pass"
}

When the plan has alternatives, Anode presents options:

FieldTypeDescription
idstringOption identifier
labelstringShort option name
descriptionstringWhat this option does

You pick one. Anode revises the plan accordingly.

Plans move through a strict state machine:

StateDescription
idleNo active plan.
collecting_requestUser request is being captured and normalized.
inspecting_contextPlan run has started and is reading repository context.
drafting_planInitial structured plan is being drafted.
awaiting_clarificationPlan needs more input.
awaiting_plan_decisionPlan is ready for a decision.
approved_full_autonomyUser selected full autonomy.
approved_medium_autonomyUser selected medium autonomy.
chatting_about_planUser chose to discuss before executing.
revising_planPlan is being revised.
discardedPlan was discarded.
executingExecution mode is active.
completed, failed, canceledTerminal states.

The typical flow is inspecting_context -> drafting_plan -> awaiting_plan_decision -> one of the approval/chat/revise/discard states.

Control how much Anode asks before acting:

OptionInternal valueBehavior
Start with full autonomyfull_autonomyExecute the approved plan with minimal phase interruption while preserving normal tool permission gates.
Start with medium autonomymedium_autonomyPause at the start of each phase. This is the default execution path.
Chat about the planchatDiscuss before execution.
Revise the planreviseAsk Anode to improve or change the plan before execution.
Discard the plandiscardExit plan mode without executing.

Tool permissions still apply during execution. For example, file writes and shell commands can still ask even in full autonomy unless policy or approval mode allows them.

Execute an approved plan with the /execute command. Variants:

CommandDescription
/executeStart execution with medium autonomy
/execute fullRun all phases with full autonomy
/execute mediumRun with phase-start checkpoints
/execute statusShow current execution progress
/execute validateRun validation checks without continuing
/execute reviewTrigger self-review of changes so far
/execute stopStop execution at the next safe point

Each phase and step tracks its own status:

StatusDescription
queuedWaiting to run
runningCurrently executing
blockedWaiting on a dependency or issue
waiting_for_userPaused at a checkpoint for your input
completeFinished successfully
failedFailed with an error
skippedSkipped by user or policy
canceledCanceled by user

Checkpoints pause execution and ask for your decision. They fire at:

CheckpointWhen it fires
phase_startBefore a new phase begins
before_writeBefore writing to a file
before_bashBefore running a shell command
before_risky_actionBefore a high-risk operation
plan_deviationWhen execution diverges from the plan
validation_failureWhen a validation check fails
execution_completeWhen all phases finish

Which checkpoints fire depends on the autonomy profile. medium_autonomy pauses before each phase; full_autonomy skips phase-start checkpoints but does not bypass normal tool permission prompts.

At each checkpoint, you choose:

ActionEffect
continueProceed as planned
modifyAdjust the current step
skipSkip this step or phase
stopStop execution entirely
chatOpen a conversation before deciding
allowAllow a blocked action
revise_planGo back to Plan Mode and revise

After validation, Anode builds a self-review summary from changed files, validation results, warnings, and remaining work. It does not replace anode review; use the review command for an independent read-only model pass.

Anode tracks what it can undo. Every file modification records the before-state. If execution fails or you stop midway, the rollback metadata shows which changes are reversible.

Validation commands run through the configured plan validation list when present. If no plan validation commands are available, Anode derives defaults from the changed files: gofmt -w for changed Go files, then go test ./..., go vet ./..., and go run ./cmd/anode --help.

# Example: validation runs go tests after a refactoring phase
go test ./internal/...

Every file modification Anode makes is recorded in the change ledger. Use /changes to view them.

FieldTypeDescription
kindstringOperation type (create_file, edit_file, etc.)
pathstringFile path relative to workspace
statusstringapplied, reverted, or committed
ownershipstringWho made the change (anode, user, pre_existing)
riskstringRisk classification
diffstringUnified diff of the change

Files are classified by risk:

RiskFile patterns
High.sh, .bash, .env, .pem, .key, Dockerfiles, CI configs, lockfiles, migrations, auth files, deletions
MediumAll other files (default)
Low.md, .txt, .rst, test files, README, CHANGELOG

Use /commit to prepare a git commit from tracked changes. Anode:

  1. Validates tracked files against the workspace.
  2. Generates a commit message from the change entries.
  3. Runs git add for each changed file.
  4. Runs git commit with the generated message.

A commit is ready when Anode-owned changes exist, no validation failures remain, and no high-risk changes are unreviewed.

  • Code Review — review diffs without modifying code
  • Profiles — customize the agent profile for plan and execute modes
  • Interactive Mode — all TUI slash commands and shortcuts
  • Permissions — control which tools require confirmation