The planning skill your agent cannot ignore.
Not a prompt it might follow. A hook that fires every turn, a plan on disk that survives /clear, and 3 out of 3 blind A/B wins to show it works.
Your agent's context window dies. The plan does not.
Persistent file-based planning for AI coding agents and long-running agent tasks: the skill keeps task_plan.md, findings.md, and progress.md on disk. Activated lifecycle hooks inject selected project planning context, so the plan survives context loss, /clear, crashes, and compaction. Automatic recovery reads project files only. Reading same-project local agent session records for aggregate counts or bounded replay requires an explicit catchup mode. Installs across 60+ agents via the Agent Skills standard, with native plugins for Claude Code, Codex CLI, Qoder CLI, Pi, Hermes Agent, OpenCode and DeepSeek Harness.
Open the Commands, Multi-agent runs, Benchmarks & more section below for the reference ยท Full install guide
Every coding agent loses its working memory when the context window resets. The plan does not have to die with it.
Parallel tasks get isolated directories instead: .planning/YYYY-MM-DD-slug/ with the same three files, selected via .active_plan (v2.36.0+). Plain markdown, gitignored by default, no runtime state anywhere else.
How do I stop my coding agent from losing its plan after /clear or a crash?
The plan lives on disk in task_plan.md, findings.md, and progress.md, not only in the context window. At the start of each turn the UserPromptSubmit hook re-injects selected active-plan context, and after a /clear or a new session the skill re-reads project files from disk. This automatic path does not inspect agent transcript stores.
What is the difference between planning-with-files and an agent memory tool?
Agent memory tools (vector stores, knowledge graphs) help an agent recall facts from past sessions. planning-with-files manages active execution state: the phases, status, dependencies, and completion check for the task the agent is working on right now. The problem it solves is planning continuity, not retrieval, and the two are complementary.
How does this prevent context rot?
Context rot is the drift that sets in as the context window fills and earlier instructions get crowded out. Because the plan is re-injected at the start of each turn from disk, the goals and phase status stay in the model's attention window as the conversation grows. This is an implementation of what Anthropic calls structured note-taking: write durable state to files outside the window, then read it back in when needed.
Which coding agents does this work with?
Claude Code, OpenAI Codex CLI, Cursor, GitHub Copilot, Kiro, OpenCode, Continue, Pi, Hermes Agent, CodeBuddy, Factory, Mastra, and 70+ others via the SKILL.md open standard (the npx skills installer alone targets 71 agents). Since v3.7.0 the repo also ships the cross-tool .agents/skills/planning-with-files/ layout in-tree, so tools that read the Agent Skills standard path natively (Zed, Amp, Warp, Devin, Antigravity, Gemini CLI, Cursor) discover the current skill from a plain git clone with no per-tool setup. Installation is one command; see Quick Install above.
How does this work with Claude Code's plan mode?
They are complementary stages, not alternatives. Plan mode is where you design and approve the approach before execution. planning-with-files persists the live execution state (phase status, findings, errors, progress) on disk while the work runs and re-injects it every turn. The handoff is one step: after accepting a plan-mode plan, tell the agent to write it into task_plan.md as phases (or invoke /plan and let the skill create the files from it), then execute in normal mode. From that point the hooks keep the phases in the attention window, and the files survive /clear, compaction, and session death.
What happens to the plan files after a task is complete?
They are working memory, not a tracked deliverable. task_plan.md, findings.md, progress.md, and the .planning/ directory are gitignored by default and are not archived automatically: the next task overwrites the root plan, and a slug directory just stops being active. Anything worth keeping should be promoted into code, a commit, or a doc. See After Completion: What Happens to the Plan Files for the full lifecycle and how to retain a completed plan. This is a deliberate default, not a missing feature; a completion-triggered archive step is a welcome opt-in extension.
How fast are the hooks?
One hook fire measures 289ms wall-clock since the v3.6.0 optimization, down from 2.0 to 2.4 seconds before it, and the injected plan block is KV-cache stable by construction. The plan stays in the attention window every turn, and /clear stops being fatal.
[15 sections]Long-run safeguards
| What breaks long agent runs | What the skill does about it |
|---|---|
The context window is wiped by /clear, compaction, or a crash |
The plan is re-read from disk on the next turn; SessionStart, UserPromptSubmit and PreCompact hooks carry the current phase back in |
| Goal drift after 50+ tool calls | The plan head is re-injected every turn; PWF_INJECT=smart keeps the goal, the next step and the active phase in the window late in a long plan |
| The agent declares "done" early | Gated mode: the Stop gate holds the stop only while an in_progress phase remains, with a block cap and stall detection so an incomplete plan alone never traps a session |
| The plan is silently rewritten by a tool result, a collaborator, or a bug | SHA-256 attestation: a plan body that no longer matches the approved hash is refused at injection with [PLAN TAMPERED] |
| Two sessions overwrite each other's phases | The parallel-write guard reports when checked items or completed phases go down between turns |
| Autonomous loops burn tokens on recitation | Autonomous mode drops the per-tool-call recitation and replaces the raw progress tail with a fixed-shape ledger summary; injection is KV-cache stable and one hook fire costs about 289 ms |
| Hooks that quietly stop firing | /plan-doctor self-checks resolution, injection, attestation, install surfaces and per-fire latency |
Everything in that table is opt-in per plan and byte-identical to the previous behavior when no mode marker is set. Details: v3 Long-Running Agent Features and docs/long-running-agent-tasks.md.
Installation routes
Claude Code, plugin route (ships everything: skill, hooks, slash commands):
/plugin marketplace add OthmanAdi/planning-with-files
/plugin install planning-with-files@planning-with-files
Every other agent, one line, 60+ agents via the Agent Skills standard:
npx skills add OthmanAdi/planning-with-files --skill planning-with-files -g
npm, to pin an exact version into a project or vendor it:
npm install planning-with-files
The package carries SKILL.md, scripts/ and templates/, so this is the route for locking a version into a repo's dependencies or copying the skill in yourself. It does not register hooks on its own.
Pi Coding Agent, same npm package, wired up for you (skill, extension, status bar):
pi install npm:planning-with-files
Hermes Agent (Nous Research), native plugin plus skill bundle, CLI and Desktop:
hermes skills install OthmanAdi/planning-with-files/.hermes/skills/planning-with-files --yes
hermes plugins install OthmanAdi/planning-with-files/.hermes/plugins/planning-with-files
hermes plugins enable planning-with-filesOpenCode, native plugin plus the skill (the npx skills add command above lands in ~/.agents/skills/, which OpenCode reads):
{ "plugin": ["opencode-planning-with-files"] }in opencode.json or ~/.config/opencode/opencode.json; OpenCode installs it on the next start.
DeepSeek Harness (DSH), native plugin plus the skill (the npx skills add command above lands in ~/.agents/skills/, which DSH reads):
dsh plugin --profile web add dsh-planning-with-files
then restart dsh web; the same command works for the headless, sdk and acp profiles.
Under a minute. Safe to re-run. Trigger it by typing /plan (plugin) or asking the agent to "plan this task"; the skill also self-triggers on multi-step tasks.
What each route actually ships:
| Route | Skill + scripts + templates | Slash commands | Hooks |
|---|---|---|---|
| Claude Code plugin | yes | yes | yes |
| Qoder CLI plugin | yes | no, Claude-specific prompts excluded | yes, seven lifecycle hooks; IDE behavior unverified |
npx skills add |
yes | no | frontmatter hooks, see note |
npm install |
yes, under node_modules/ |
no | no, copy the skill in yourself |
pi install npm: |
yes | yes, Pi commands | yes, via the Pi extension |
hermes plugins install |
yes, with the skill bundle | yes, /pwf, /pwf-status |
yes, plugin hooks incl. the gate |
OpenCode opencode.json plugin |
yes, with the skill | yes, /pwf, /pwf-status (two copied command files) |
yes, plugin hooks incl. the gate |
DeepSeek Harness dsh plugin add |
yes, with the skill | yes, /pwf, /pwf-status |
yes, plugin hooks incl. the gate |
| ClawHub / manual copy | yes | no | frontmatter hooks, see note |
Skill-route installs can end up silently hook-less (project trust not accepted, or frontmatter hooks not registering on project-level installs). The hooks are the differentiating mechanism, so if they matter to you, use the plugin route, then verify with /plan-doctor. Full matrix and the two silent killers: docs/installation.md.
Install acting up? Open your agent and say: "Read docs/installation.md and docs/troubleshooting.md from OthmanAdi/planning-with-files and fix my install." Then run /plan-doctor.
Hermes needs its skill bundle from .hermes/skills/planning-with-files (hermes skills install OthmanAdi/planning-with-files/.hermes/skills/planning-with-files --yes); OpenCode and DeepSeek Harness read the skill that npx skills add ... -g places in ~/.agents/skills/. Each host's own /plan command is never shadowed.
Works across 19+ platforms
One skill, three integration tiers. Know what your agent gets before you install:
| Tier | Platforms | What you get |
|---|---|---|
| Enhanced (hooks + lifecycle automation) | Claude Code, Qoder CLI, Cursor, GitHub Copilot, Mastra Code, Gemini CLI, Kiro, Codex, Hermes Agent, CodeBuddy, Factory Droid, OpenCode, DeepSeek Harness | Plan injection every turn (Cursor: at session start), progress reminders, completion check |
| Standard Agent Skills | Continue, Pi, OpenClaw, Autohand Code, Antigravity, Kilocode, AdaL CLI | SKILL.md discovery via npx skills add; the pattern without lifecycle hooks |
| Agent Skills standard path (in-tree since v3.7.0) | Zed, Amp, Warp, Devin, Antigravity, Gemini CLI, Cursor | .agents/skills/planning-with-files/ discovered from a plain git clone, no per-tool setup |
Per-platform setup guides, discovery paths and sandbox runtimes are in the collapsible sections below First-class hosts: native plugins.
Multi-agent runs: orchestrators, workers and subagents
NOTE Markdown on disk is the shared state between agents. One orchestrator owns
task_plan.mdand the shared summaries; every worker appends to its own ledger or assigned file. Pin each independent task withPLAN_IDbefore starting its host, or use separate worktrees.
- Run ledger per agent. Workers append one JSON line per event to
.planning/<id>/ledger-<agent>.jsonl(ledger-append.sh);ledger-summary.shsynthesizes a fixed-shape, KV-cache-stable block from all ledgers that replaces the rawprogress.mdtail in autonomous and gated mode. No free text from disk reaches the model through that block. - Plan isolation per task.
init-session.sh "<name>"gives each parallel task its own.planning/YYYY-MM-DD-<slug>/directory;PLAN_IDpins a terminal to one of them,set-active-plan.sh --listshows available plans and phase counts, andset-active-plan.sh <id>switches the shared pointer. - Threads whose cwd is a shared parent.
PWF_PLAN_ROOT=<absolute path>binds an agent thread to the project that owns the plan; an ambiguous cwd, where a nested project carries its own planning state, injects nothing rather than guessing. - Session attachment. An
.attachedmarker authorizes context but does not select a task. In the Codex, Hermes, Pi, and standalone hook routes, armed isolation with multiple plans requiresPLAN_ID; otherwise context is refused. A project-root pin alone cannot distinguish tasks within that root. - Parallel-write guard. The next turn warns if checked items or completed phases decrease. This is an advisory check after the write, not a lock or merge mechanism. It does not detect every overwritten plan,
progress.md, orfindings.md. - Stall-aware gate. The completion gate reads the ledger, not
progress.mdmtime, so a worker that stopped producing events releases the stop instead of looping. - One plan, many hosts. Claude Code, Codex, Pi, Hermes and OpenCode read the same files, the same
.attestationand the same gate counters, so a plan can be handed from one agent to another mid-run.
The contract and the .mode tokens are specified in the skill itself (SKILL.md, Autonomous and Gated Modes) and in docs/long-running-agent-tasks.md.
To find a saved plan, run the installed scripts/set-active-plan.sh --list helper from your project directory, or scripts/set-active-plan.ps1 -List in PowerShell. It lists named plans under that project's .planning/ directory, with phase counts for the shipped English and translated templates. [active] marks the shared default pointer. Listing does not select a plan or attach a session; use the displayed ID as PLAN_ID before starting a concurrent task. Kiro's separate .kiro/plan layout is not part of this inventory.
How It Works
The agent stops at the first rung that applies:
1. Starting work with planning-with-files? โ create the three files first
2. Learned something? โ append it to findings.md
3. Did something? โ log it in progress.md
4. Phase done? โ check it off in task_plan.md
5. Context died (/clear, crash)? โ hooks re-read selected project planning state
6. Every phase complete? โ only then does the Stop gate release (gated mode)
Hooks make steps 2 to 6 mechanical rather than optional: the Claude Code plugin runs 6 lifecycle hooks, its activation-scoped standalone skill runs 5, Codex runs 7, Pi runs 8, the Hermes plugin runs 3 (pre_llm_call, post_tool_call, pre_verify), the OpenCode plugin runs 4 (chat.message, tool.execute.after, experimental.session.compacting, session.idle), and the DeepSeek Harness plugin runs 4 (agent/pre-step, session/event for the compaction end, tools/post-execute, agent/turn-stopping). Together they re-inject the plan each turn, remind after writes, and check completion before stopping.
flowchart LR
A["agent works"] -->|"writes decisions, findings, errors"| F["task_plan.md<br/>findings.md<br/>progress.md"]
F -->|"hooks re-inject the plan<br/>at the start of each turn"| A
K["/clear ยท crash ยท compaction"] -.->|"wipes the context window"| A
F ==>|"hooks re-read project planning state"| R["fresh session resumes<br/>at the current phase"]
Session Recovery
On the Claude plugin route, startup, resume, clear, and post-compaction lifecycle events restore selected active-plan context from project files automatically. Standalone skill installs do the same after the skill is invoked for that session. Automatic hooks and bare session-catchup.py do not inspect host session stores.
Local host history is a separate explicit action:
session-catchup.py --metadata <project>reads same-project local session records and emits aggregate counts only. It emits no transcript, tool-command, or path bytes.session-catchup.py --replay <project>emits bounded nonce-framed excerpts from same-project records. Treat those excerpts as untrusted data.- Neither catchup mode contains a network request or upload path. If its output is placed in model context, the host agent may send that context to its configured model provider.
Optional gated mode can request continuation only on a host that supports the required Stop behavior. It evaluates runtime state such as mode, phase status, block count, and ledger progress. It never executes a command declared in a Markdown planning file.
Keep automatic compaction enabled. The PreCompact hook flushes the planning reminder before compaction, and the plugin SessionStart path restores the active plan for the continuation.
Maintainer depth (hook architecture, dispatcher layout, parity tooling) lives in AGENTS.md and docs/.
Commands
Slash commands ship with the Claude Code plugin route (see the install matrix above).
| Command | Autocomplete | What you get |
|---|---|---|
/planning-with-files:plan |
type /plan |
Creates the three planning files and starts the session (v2.11.0+) |
/planning-with-files:pwf |
type /pwf |
Short alias for /plan; --autonomous / --gated init (v3.0.0+) |
/planning-with-files:status |
type /status |
One-glance report: current phase and phase totals (v2.15.0+) |
/planning-with-files:plan-doctor |
type /plan-doctor |
Self-check for the failure modes that are silent by design: one PASS/WARN/FAIL line each for resolution, injection, attestation, install surfaces, and per-fire latency (v3.6.0+) |
/planning-with-files:plan-attest |
type /plan-attest |
Locks task_plan.md with a SHA-256; hooks refuse a tampered plan body; --show / --clear (v2.37.0+) |
/planning-with-files:plan-goal |
type /plan-goal |
Runs until the plan reports complete, composing with Claude Code /goal (v2.38.0+) |
/planning-with-files:plan-loop |
type /plan-loop |
Planning-aware cadence on /loop, default 10 minute tick (v2.38.0+) |
/planning-with-files:plan-de |
type /plan-de |
Start planning in German; also -ar, -es, -zh, -zht (v2.33.0+) |
/planning-with-files:start |
type /planning |
Original start command |
Typing /plan prefix-matches every plan* command in autocomplete; /planning-with-files:status autocompletes as /status (the older /plan:status label predates the rename).
Pi, OpenCode, Hermes and DeepSeek Harness commands, and command names per host
Pi extension commands
Install the Pi extension with pi install npm:planning-with-files; it registers these commands, typed with no /planning-with-files: prefix.
| Command | What it does | Version |
|---|---|---|
/plan-execute |
Pi only. Approve the active plan to ACTIVATE all Pi hooks; hooks stay passive until you run this; reset returns to passive review |
v3.3.0+ |
/plan-status |
Active plan path, scope, and phase totals | v2.39.0+ |
/plan-goal <text|default|clear> |
Set or clear the goal string appended to auto-continue prompts | v2.39.0+ |
/plan-loop [interval] [prompt|stop] |
Start or stop a planning tick (default 10m) that re-reads the plan and nudges progress | v2.39.0+ |
/plan-attest [--show|--clear] |
Run the attest-plan helper; shares the .attestation file with Claude Code |
v2.39.0+ |
On Pi there is no /plan command to create the files; the skill creates them, then /plan-execute approves and activates the hooks. Pi plan-goal/plan-loop run their own logic, while the Claude Code commands of the same name forward to native /goal and /loop. The doctor ships as a script in every mirror since v3.7.0: run sh scripts/plan-doctor.sh directly on platforms without the command.
OpenCode plugin commands
The OpenCode plugin ships two Markdown commands (.opencode/commands/), copied to ~/.config/opencode/commands/ or a project's .opencode/commands/.
| Command | What it does | Version |
|---|---|---|
/pwf [--gated|--autonomous] [--template analytics] [plan name] |
Tells the agent to call pwf_init (root plan or .planning/YYYY-MM-DD-<slug>/, v3 markers and attestation with the flags) and fill in the plan |
v3.14.0+ |
/pwf-status |
Calls pwf_status: plan id, mode, attestation, current phase, phase counts |
v3.14.0+ |
Hermes plugin commands
The Hermes plugin registers these in-session commands (CLI, gateway and Desktop), typed with no prefix.
| Command | What it does | Version |
|---|---|---|
/pwf [--autonomous|--gated] [--template analytics] [plan name] |
Create the planning files; a name creates and activates .planning/YYYY-MM-DD-<slug>/; the v3 flags write .mode, .nonce, reset the gate counter and attest the plan |
v3.13.0+ |
/pwf-status, /plan-status |
Active plan id, mode, attestation, current phase, phase counts, logged errors | v3.13.0+ |
/plan on Hermes is Hermes' own bundled software-development plan skill and is left untouched.
DeepSeek Harness plugin commands
The DSH plugin registers these in-session commands, typed with no prefix. /plan is DSH's own plan mode and is left untouched.
| Command | What it does | Version |
|---|---|---|
/pwf [--autonomous|--gated] [--template analytics] [plan name] |
Create the planning files; a name creates and activates .planning/YYYY-MM-DD-<slug>/; the v3 flags write the mode marker and attest the plan |
v3.20.0+ |
/pwf-status |
Active plan id, mode, attestation, current phase, phase counts | v3.20.0+ |
Command names vs skill names
| Platform | You type | Examples |
|---|---|---|
| Claude Code | /planning-with-files:<verb>, autocompletes from the short form |
/plan, /pwf, /plan-attest, /plan-de |
| Pi | bare form, no prefix | /plan-status, /plan-execute, /plan-goal |
| Hermes Agent | bare form, no prefix | /pwf, /pwf-status, /plan-status |
| OpenCode | bare form, no prefix | /pwf, /pwf-status |
| DeepSeek Harness | bare form, no prefix | /pwf, /pwf-status |
| Continue.dev | /planning-with-files |
On the plugin route the model-invocable SKILL is planning-with-files:planning-with-files; the doubled form is the skill id, not a command you type. The five language variants live under skills/i18n/, which the plugin scan does not reach, so there is no planning-with-files:planning-with-files-de to invoke by name โ reach a translation through its /plan-ar, /plan-de, /plan-es, /plan-zh or /plan-zht command, or install it as its own skill with npx skills add OthmanAdi/planning-with-files --skill planning-with-files-de -g, which registers it under its own name. There is no /pwf-de and no /planning-with-files:planning-with-files-goal; /pwf is just a short alias for /plan.
v3 Long-Running Agent Features
The v3 line adds features aimed at long-running agentic runs. Each one is listed with the command or flag that turns it on. Without a mode marker, hooks retain the legacy content format. Since v3.24.0, Claude Code suppresses repeated unchanged PreToolUse views when session identity and private cache storage are available.
- Autonomous mode (
/pwf --autonomous, orinit-session.sh --autonomous): drops the per-tool-call plan recitation, keeps the turn-start injection, and turns attestation on by default. - Gated mode (
--gated): adds a Stop completion gate that blocks only when all completion conditions hold at once, so an incomplete plan alone never traps a session. - Auto-continue on Pi (
agent_endhandler): re-prompts the agent up to a limit of 3 to keep an unfinished plan moving, plus an optional/plan-goalstring appended to the prompt. - Pi approval gate (
/plan-execute): Pi hooks stay passive with a status line until you approve the active plan for the current session. - Session-catchup: automatic recovery uses project planning files only. Explicit
--metadatareads same-project local session records and emits aggregate counts only; explicit--replaymay emit bounded nonce-framed excerpts. - PreCompact progress flush (
PreCompacthook): surfaces a reminder to flush progress before compaction completes, and prints the active Plan-SHA256 when attested. - SHA-256 plan attestation (
/plan-attest): lockstask_plan.md; a tampered plan body is refused at injection. - Run ledger: an append-only JSONL record of phase transitions that replaces the raw
progress.mdtail in v3 modes with a fixed-shape summary. - Host capability tiers: hard block on Claude Code, Codex, and Continue; follow-up injection on Cursor, Pi, Kiro, Hermes Agent, and OpenCode; notify-only elsewhere.
- Per-invocation opt-out (
PLANNING_DISABLED=1, v3.4.0): a one-shot session that merely shares a cwd with an incomplete plan skips all plan reading at every hook entry point. Covers the Copilot and Cursor routes since v3.10.2 and the Hermes plugin since v3.13.0;.geminiis deliberately behind and does not honour it. - Absolute plan-root pin (
PWF_PLAN_ROOT, v3.9.0): binds a thread to a project root by absolute path, for agent threads whose cwd is a shared parent of the project they are actually working in. Ambiguous cwds refuse to inject rather than guessing.
Environment variables
| Variable | Since | What it does |
|---|---|---|
PLANNING_DISABLED=1 |
v3.4.0 | Skips all plan reading for this invocation. For one-shot or CI sessions that share a cwd with a plan they never opted into. |
PLAN_ID=<slug> |
v2.36.0 | Pins the terminal to one plan under $(pwd)/.planning. Slug only, resolved against the current directory. |
PWF_PLAN_ROOT=<abs path> |
v3.9.0 | Pins the thread to a project root by absolute path, which PLAN_ID cannot express. Use it when the agent's cwd is a shared parent such as /workspace while the work lives in /workspace/project. A pin that does not resolve stops injection instead of falling back. |
PWF_SESSION_ID=<id> |
v2.36.0 | Identifies the session for hook state and plan attachment. When .planning/sessions/ exists, a session sees plan context only if .planning/sessions/<id>.attached exists. Claude Code uses its native event identity for repeated-view suppression. |
PWF_INJECT=smart |
v3.8.0 | Replaces the fixed head -50 injection window with the goal, next step, current phase, the full in-progress phase, and the last three decisions. |
PWF_PRETOOL=always |
v3.24.0 | Repeats the selected PreToolUse view on every matched Claude Code tool call. By default an unchanged view is suppressed after successful prompt injection; a changed view refreshes once. Missing session identity or an unavailable cache keeps repeated injection. Selection and attestation checks still run. |
PWF_FAST_PATH=0 |
v3.17.0 | Forces the Claude Code plugin and standalone skill hooks through the reference shell chain instead of scripts/inject-plan.py, the single-process twin that runs whenever a CPython 3 is on PATH. Both produce identical output; the twin is what keeps a hook fire under a second on Windows. |
PWF_PLAN_GUARD=0 |
v3.10.0 | Turns off the parallel-write guard, which is on by default. The guard compares checked items and completed phases against the previous hook fire and prints one advisory line when they go DOWN, meaning a second session overwrote work. A plan-guard-off token in .mode does the same. |
PWF_MODE |
v2.39.0 | Pi extension runtime mode: auto, parity, cache-safe, notify. Also settable in .pi/settings.json under planningWithFiles.mode. |
PWF_GATE_CAP |
v3.0.0 | Maximum consecutive Stop-gate blocks in gated mode. Default 20. |
Hooks and modes reference
| Platform | Lifecycle hooks | Where registered |
|---|---|---|
| Claude Code | 6: SessionStart, UserPromptSubmit, PreToolUse, PostToolUse, PreCompact, Stop | Plugin installs use hooks/hooks.json with cache-safe ${CLAUDE_PLUGIN_ROOT} paths. Standalone skill hooks are activation-scoped and have no SessionStart. |
| Codex CLI | 7: SessionStart, UserPromptSubmit, PreToolUse, PermissionRequest, PostToolUse, PreCompact, Stop | Workspace installs use .codex/hooks.json; the Codex plugin selects hooks/codex-hooks.json and resolves through ${PLUGIN_ROOT}. Both routes use commandWindows on Windows. |
| Qoder CLI | 7: SessionStart, UserPromptSubmit, PreToolUse, PermissionRequest, PostToolUse, PreCompact, Stop | .qoder-plugin/plugin.json selects hooks/qoder-hooks.json; Bash launches isolated Python through ${QODER_PLUGIN_ROOT}. The adapter maps gated Stop to the CLI's exit-code-2 contract. |
| Pi | 8 lifecycle handlers in the bundled extension | The injection and recitation handlers stay passive until /plan-execute |
| Hermes Agent | 3: pre_llm_call, post_tool_call, pre_verify |
Native plugin under <HERMES_HOME>/plugins/planning-with-files/, opt-in through plugins.enabled; the gate answers pre_verify in gated mode only |
| OpenCode | 4: chat.message, tool.execute.after, experimental.session.compacting, event on session.idle |
npm plugin opencode-planning-with-files listed in opencode.json; commands from .opencode/commands/; the gate re-prompts the session in gated mode only |
Pi runtime modes:
| Pi mode | Behavior |
|---|---|
auto |
Detects the model and picks parity or cache-safe |
parity |
Full plan injection, mirrors the Claude Code skill |
cache-safe |
A stable reminder instead of full injection, for KV-cache-sensitive models like DeepSeek |
notify |
Status-line only, no model injection |
Key Rules
- Create Plan First โ Never start without
task_plan.md - The 2-Action Rule โ Save findings after every 2 view/browser operations
- Log ALL Errors โ They help avoid repetition
- Never Repeat Failures โ Track attempts, mutate approach
Acknowledgments
- Manus AI, for pioneering the context-engineering pattern this skill implements
- Anthropic, for Claude Code, Agent Skills, and the Plugin system
- Nous Research, for Hermes Agent and a plugin API that made native support possible
- Lance Martin, for the detailed Manus architecture analysis
- Based on Context Engineering for AI Agents
A note from the author: this project blew up in less than 24 hours, and everyone who starred, forked, shared, and shipped fixes is the reason it kept going. If the skill helps you work smarter, that is all I wanted. Thank you.
Reference
Everything below is the proof and the reference half: the benchmarks and their limits, what lands in your project and what the repository ships, and every guide in docs/. Release history and community projects sit in the collapsible sections below First-class hosts: native plugins.
| Benchmark Results | The eval run, the blind A/B, the recovery benchmark, and their disclosed limits |
| File Structure | What lands in your project, and the repository layout |
| Documentation | Every guide in docs/ |
Benchmark Results
Methodology note: the 96.7% figure comes from the v2.21.0 evaluation run on
claude-sonnet-4-6(2026-03-06). It measures file-pattern fidelity (does the agent create and maintain the 3-file structure), not goal-drift over long autonomous runs. Newer models and the autonomous-mode work are not yet covered by this number. Full methodology, dataset, and assertion list: docs/evals.md.
Evaluated with Anthropic's skill-creator framework: skill v2.21.0, model claude-sonnet-4-6, 2026-03-06. 10 parallel subagents, 5 task types, 30 objectively verifiable assertions, 3 blind A/B comparisons.
| Test | with_skill | without_skill |
|---|---|---|
| Pass rate (30 assertions) | 96.7% (29/30) | 6.7% (2/30) |
| 3-file pattern followed | 5/5 evals | 0/5 evals |
| Blind A/B wins | 3/3 (100%) | 0/3 |
| Avg rubric score | 10.0/10 | 6.8/10 |
Recovery after a context wipe
Internal benchmark, v1 (2026-07-06). Author-run against v3.4.0, harness-authored tasks, deterministic grading, no LLM grades anything. Treat it as the project's own measurement, not an independent comparison. Full method, arms, disclosed limits, and grader validation: docs/evals.md.
Protocol: the session is hard-stopped at roughly half done, and a fresh session is told only "Continue the work in this directory." Every graded run across every arm ended pytest-green (77/77), so the difference is re-orientation cost, not correctness.
With the planning files on disk, a resume took 5.0 turns on average; a raw agent took 13.3. Planning-file recovery plus hook injection put phase state in front of the model before its first tool call, and the same run found no correctness penalty anywhere. This internal v1 used the earlier default transcript catchup; current automatic recovery is file-only and has not been re-benchmarked under the same protocol. Contributors can run that current protocol from examples/file-only-recovery/. Running the fixture is not a new measurement of the 5.0 or 13.3 figures. An animated summary lives at docs/benchmark/index.html (rendered view).
Full methodology and results ยท Technical write-up
File Structure
What the skill writes into your project is three markdown files (see the 3-file pattern). What the repository ships:
Repository layout
planning-with-files/
โโโ skills/planning-with-files/ # canonical skill: SKILL.md, scripts/, templates/, reference.md, examples.md
โโโ skills/i18n/ # 5 translated variants: -ar / -de / -es / -zh / -zht
โโโ .agents/skills/planning-with-files/ # Agent Skills standard path, full surface (v3.7.0+)
โโโ commands/ # 13 slash commands (plugin route only)
โโโ scripts/ ยท templates/ # root-level copies for CLAUDE_PLUGIN_ROOT
โโโ .claude-plugin/ # plugin + marketplace manifests
โโโ .codex/ .cursor/ .github/ .gemini/ .kiro/ .continue/ .pi/
โโโ .codebuddy/ .factory/ .hermes/ .mastracode/ .opencode/ # per-IDE mirrors, parity-locked
โโโ .hermes/plugins/planning-with-files/ # native Hermes Agent plugin (tools, /pwf, hooks, gate)
โโโ .opencode/packages/opencode-planning-with-files/ # native OpenCode plugin (npm)
โโโ .dsh/packages/dsh-planning-with-files/ # native DeepSeek Harness plugin (npm)
โโโ docs/ # 25+ guides incl. per-platform setup, evals.md, benchmark/
โโโ tests/ # cross-platform pytest suite, green on Windows, Linux, and macOS CI
โโโ CHANGELOG.md ยท MIGRATION.md ยท SECURITY.md ยท CONTRIBUTING.md ยท CONTRIBUTORS.md
โโโ CITATION.cff ยท llms.txt ยท LICENSE
โโโ README.md
Every release maintains 20 tracked parity targets plus the gitignored ClawHub upload stage when it is present. scripts/bump-version.py updates every available target, and CI fails if a tracked variant lags. The npm package's SKILL.md is byte-identical to the canonical skill.
Documentation
| Doc | What it covers |
|---|---|
| docs/installation.md | Every install route, the route matrix, the trust prerequisite |
| docs/quickstart.md | Your first planning session in 5 steps |
| docs/workflow.md | Day-to-day usage, plan lifecycle, topic handoffs |
| docs/hermes.md | Hermes Agent CLI and Desktop: install, /pwf, the pre_verify gate, Windows, migration from Claude Code |
| docs/opencode.md | OpenCode: the native plugin, /pwf, the session.idle gate, pwf_* tools |
| docs/deepseek-harness.md | DeepSeek Harness: the native plugin, profiles, /pwf, the turn-boundary gate, what DSH does not expose |
| docs/evals.md | Full benchmark methodology, raw numbers, disclosed limits |
| docs/troubleshooting.md | When hooks are quiet, plus /plan-doctor |
| docs/claude-code-lost-context-after-compaction.md | Recovering and preventing context loss from compaction |
| docs/agent-forgets-plan-after-clear.md | The file-based fix when an agent forgets its plan after /clear |
| docs/long-running-agent-tasks.md | Keeping a coding agent on track for hours: modes, gate, ledger |
| MIGRATION.md | v2 to v3 migration and host capability tiers |
| SECURITY.md | Vulnerability reporting and hardening history |
| CONTRIBUTING.md | How to contribute; authorship is preserved on merge |
| Per-platform guides | 19+ setup docs in docs/, linked from the platform tables |
Contributing
Contributions welcome. Start with CONTRIBUTING.md. Every shipped contribution is credited: commit authorship is preserved on merge, and contributors are listed in CONTRIBUTORS.md, the CHANGELOG Thanks section, and the release notes.
License
MIT License โ feel free to use, modify, and distribute.
Author: Ahmad Othman Ammar Adi
Code, documentation, and issue contributors. Select a portrait to open a GitHub profile or archived credit. Full credits.