ak plan
ak plan close
Close one indexed plan with a whole-store recovery snapshot while leaving its plan files untouched.
Use ak plan close when work should leave the active plan listing but is not
yet being moved into long-term archived retention.
Usage
ak plan close <id-or-folder>Supply one full plan-store ID or a plan folder name of the current project:
<folder>, plans/<folder>, or <project>/<folder>. The command has no
command-specific flags.
Close one plan
ak plan close my-project/260722-1200
ak plan close 260722-1200-my-hand-authored-planA hand-authored plan folder that was never indexed is indexed on demand, the
same way ak plan reindex --apply would index it, and a notice on stderr names
the store ID it received:
Indexed plans/<folder> as plan <id> before updating it.The command directly changes the store row's lifecycle state to closed and
updates its timestamp. A plan's workflow status and lifecycle state are
separate: recording a completed status does not close it, and closing it does
not rewrite plan.md.
There is no preview, prompt, stdin read, or --yes gate. Repository plan files
are not edited, moved, or deleted. Closed rows remain indexed and can be listed
with ak plan list --include-closed.
Before the transition, AgentKit creates a SQLite-consistent snapshot of the
whole plan store under $AGENTKIT_HOME/plans/plans-recovery/. It is retained
after success, is separate from ak backups, and does not contain repository
plan files. The command does not print the snapshot path.
Output and privacy
Human success is written to stdout. JSON success uses kind=plan.close and a
plan summary under data, including id, status, state, and updated_at.
Optional fields can include the repository URL and absolute project/worktree
paths, so redact captured output before sharing it.
Errors use stderr. JSON execution errors use the structured error envelope.
With --json enabled, unknown or invalid flags use the shared JSON stderr error
envelope (error_code: validation_failed, exit 2). Human mode, including
--json=false, prints Usage. The command does not emit NDJSON.
Exit behavior
| Exit | Meaning | Safe next step |
|---|---|---|
0 | The store row is closed and a recovery database was retained. | Verify with ak plan list --all --include-closed. |
1 | The ID or folder was not found, the store was unavailable, or snapshot/state I/O failed. | Confirm the ID or folder and preserve recovery data before retrying. |
2 | Arguments or flags were invalid. | Supply exactly one plan ID or plan folder name. |
There is no public ak plan restore command. Treat a retained recovery file as
whole-store material and do not manually replace the live database while other
AgentKit processes are using it.