planning-with-files
Persistent file-based planning for AI coding agents and long-running tasks. Crash-proof markdown plans, session recovery after /clear and compaction, per-turn re-injection against context rot, deterministic completion gate. Manus-style.
Install / Use
npx skills add OthmanAdi/planning-with-filesInstalls into whichever agent you are using.
CLAUDE.md
Claude Code project instructions
Quality Score
Category
AI & Machine LearningSupported Platforms
Skill content
View source on GitHubBefore and after /clear
Every coding agent loses its working memory when the context window resets. The plan does not have to die with it.
Without planning files
<img src="media/terminal-without-plan.svg" alt="Terminal after /clear without planning files: the user types continue, the agent replies that it has no context from an earlier session and asks the user to describe the task and where they left off" width="560">The agent re-reads the repo, asks you to restate the goal, and rediscovers work it already finished.
With planning-with-files
<img src="media/terminal-with-plan.svg" alt="Terminal after /clear with planning-with-files: the hook injects a plan data block showing Phase 2 complete and Phase 3 in progress, and the agent resumes Phase 3 by adding the expiry edge-case tests" width="560">The transcript is illustrative; the ===BEGIN PLAN DATA=== block is the skill's real injection format, written into context by the UserPromptSubmit hook from task_plan.md on disk. In the project's internal recovery benchmark, a fresh session with the files on disk resumed in 5.0 turns on average against 13.3 for a raw agent (internal v1, author-run; method and limits in docs/evals.md).
| At a glance | |
|---|---:|
| Plan files | 3 |
| Agents covered | 60+ |
| Pass rate (with skill) | 96.7% |
| Test suite | 417 green |
| Survives /clear | yes |
The Problem
Claude Code and most AI agents suffer from:
- Volatile memory: the TodoWrite list disappears on context reset
- Goal drift: after 50+ tool calls, the original goals get crowded out
- Hidden errors: failures are not tracked, so the same mistakes repeat
- Context stuffing: everything crammed into the window instead of stored
The Solution: 3-File Pattern
For every complex task, create THREE files:
task_plan.md → Track phases and progress
findings.md → Store research and findings
progress.md → Session log and test results
The Core Principle
Context Window = RAM (volatile, limited)
Filesystem = Disk (persistent, unlimited)
→ Anything important gets written to disk.
In your project, exactly this lands on disk and nothing else:
your-project/
├── task_plan.md ← phases + checkboxes; the resume point after /clear
├── findings.md ← research notes and decisions, appended as you go
└── progress.md ← session log and test results
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 It Works
The agent stops at the first rung that applies:
1. Task needs 3+ steps or 5+ tool calls? → 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)? → session catchup re-reads all three
6. Every phase complete? → only then does the Stop gate release (gated mode)
Hooks make steps 2 to 6 mechanical rather than optional: 5 lifecycle hooks on Claude Code, 7 on Codex, 8 on Pi 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 ==>|"session catchup re-reads the files"| R["fresh session resumes<br/>at the current phase"]
Session Recovery
When your context fills up and you run /clear, the skill recovers the previous session automatically:
- Checks the active IDE's session store for previous session data (
~/.claude/projects/for Claude Code,~/.codex/sessions/for Codex) - Finds when the planning files were last updated
- Extracts the conversation that happened after (potentially lost context)
- Shows a catchup report so you can sync
Pro tip: disable auto-compact to maximize context before clearing:
{ "autoCompact": false }
Maintainer depth (hook architecture, dispatcher layout, parity tooling) lives in AGENTS.md and docs/.
Quick Install
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
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 |
| 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 |
| 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.
🇸🇦 العربية / Arabic
npx skills add OthmanAdi/planning-with-files --skill planning-with-files-ar -g
🇩🇪 Deutsch / German
npx skills add OthmanAdi/planning-with-files --skill planning-with-files-de -g
🇪🇸 Español / Spanish
npx skills add OthmanAdi/planning-with-files --skill planning-with-files-es -g
🇨🇳 中文版 / Chinese (Simplified)
npx skills add OthmanAdi/planning-with-files --skill planning-with-files-zh -g
🇹🇼 正體中文版 / Chinese (Traditional)
npx skills add OthmanAdi/planning-with-files --skill planning-with-files-zht -g
These are real translations, not an English body with a translated description: the SKILL.md prose, the templates, and the user-facing output of check-complete, init-session and session-catchup are all localized. The status tokens stay literal English (**Status:** complete) on purpose, because check-complete.sh matches them with grep -F, so translating them would disable the completion gate.
Since v3.10.0 the variants also ship the full script surface: attestation, the Stop gate, the ledger, phase status and plan-doctor used to be canonical-only, which quietly made every non-English install a subset install. See issue #130 for why they stay separate skills rather than collapsing into one.
</details> <details> <summary><strong>Prefer <code>/planning-with-files</code> with no prefix?</strong></summary>Copy the skill to your local folder:
macOS/Linux:
cp -r ~/.claude/plugins/cache/planning-with-files/planning-with-files/*/skills/planning-with-files ~/.claude/skills/
Windows (PowerShell):
Copy-Item -Recurse -Path "$env:USERPROFILE\.claude\plugins\cache\planning-with-files\planning-with-files\*\skills\planning-with-files" -Destination "$env:USERPROFILE\.claude\skills\"
</details>
All install methods: docs/installation.md.
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-wi
Truncated for display — read the full file on GitHub.
Related Skills
caveman
107.2k🪨 why use many token when few token do trick. Viral skill + proxy for coding agents that cuts 65% of tokens by talking like a caveman.
claude-mem
94.4kPersistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More
Agent-Reach
84.5kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu — one CLI, zero API fees.
Understand-Anything
83.6kGraphs that teach > graphs that impress. Turn any code into an interactive knowledge graph you can explore, search, and ask questions about. Works with Claude Code, Codex, Cursor, Copilot, Gemini CLI, and more.
