plan
Saves a copy of each plan-mode plan to a searchable project vault, so you can show, archive, or restore the current plan later. Overwrites by slug, redacts credentials, and hides archived plans from search.
Instructions
Keep a copy of each plan of plan mode in planes//.md.
Only this tool writes there (revise and remember refuse it); Claude Code's own plan files are never read or touched. search and read find the copies; archived ones are hidden from search by default. save: write the copy of plan (one note per slug, the basename of plan_path; a save of the same slug overwrites it) and make it the current plan. Credentials are redacted and the text is cut at 200,000 characters. A hook variable left unsubstituted saves nothing. Returns {"path", "saved", "slug", "title", "created"}. With hook_event="PreToolUse" (the ExitPlanMode hook) it always returns "", errors included. show: without slug, {"plans": [...]} active plans of the project, newest first; with slug, that plan with its "content". archive: set status archived on slug, even when a session state links it; never deletes. Returns {"path", "changed"}. Plans more than [plans] archive_days (7) days after their saved_at are archived by the maintenance of the first welcome, except the one an active session state links. restore (SessionStart hook): only with source="clear", a short pointer to the plan of the task (this process's current plan, else the one the session state links, else the newest active plan of the worktree).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"action": "<action>"
},
"name": "plan"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| plan | No | save: the plan text (hooks pass ${tool_input.plan}). | |
| slug | No | show, archive: slug of a plan (show without it lists them). | |
| action | Yes | One of: save, show, archive, restore. | |
| source | No | restore: "compact" or "clear" (${source}) from the hook. | |
| project | No | Project; defaults to --project. | |
| session | No | save: Claude Code session id (${session_id}); metadata. | |
| plan_path | No | save: the plan file path (${tool_input.planFilePath}); gives the slug. | |
| hook_event | No | Only for Claude Code hooks: ${hook_event_name}. Omit otherwise. | |
| project_dir | No | Absolute project directory (hooks pass ${cwd}); picks the worktree. |