planning-with-files README

The project's README from github.com/OthmanAdi/planning-with-files. As one markdown file: README.md.

planning-with-files: task_plan.md, findings.md, and progress.md as three stone tablets

Planning with Files   Trendshift: #1 Repository of the Day across all languages

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, Pi and Hermes Agent.

Stars Latest release Skills Playground installs Downloads

Benchmark: 96.7 percent assertion pass rate with skill Blind A/B: 3 of 3 wins MIT license

See it survive /clear · Install · Long-running tasks · Hermes Agent · Multi-agent · The numbers

Proof, comparisons and the repository reference are further down · Full install guide


Before 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

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

The agent re-reads the repo, asks you to restate the goal, and rediscovers work it already finished.


With planning-with-files

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

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). That benchmark used the earlier default transcript-catchup behavior. Current automatic recovery uses project files only, so the figure is historical evidence rather than a fresh measurement of the current default.

At a glance
Plan files 3
Agents covered 60+
Pass rate (with skill) 96.7%
Test suite 706 tests
Survives /clear yes

Built for long-running agent tasks

[!IMPORTANT] Most harnesses ship a to-do list that lives inside the context window. planning-with-files ships a plan that lives on disk, is re-injected every turn, is hash-attested, and can hold the agent's stop until the plan reports complete.

That is the difference between an agent that forgets after /clear, compaction or a crash and one that resumes at the current phase. In the project's own measurements the plan on disk turned a 13.3-turn re-orientation into 5.0 turns, and the skill won 3 of 3 blind A/B comparisons (numbers and limits). Every mechanism below is a file on disk plus a hook, so it works the same on hour ten as on turn one.

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.

The Problem

Claude Code and most AI agents suffer from:

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.

Why This Skill?

On December 29, 2025, Meta acquired Manus for $2 billion. In just 8 months, Manus went from launch to $100M+ revenue. Their secret? Context engineering.

"Markdown is my 'working memory' on disk. Since I process information iteratively and my active context has limits, Markdown files serve as scratch pads for notes, checkpoints for progress, building blocks for final deliverables." — Manus AI

This skill packages that exact pattern for your coding agent.

The Manus Principles

Principle Implementation
Filesystem as memory Store in files, not context
Plan recitation Re-read plan before decisions (hooks)
Error persistence Log failures in plan file
Goal tracking Checkboxes show progress
Completion verification Stop hook checks all phases

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

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-files

OpenCode, 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.

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
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
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.

🌐 Available in 5 other languages

🇸🇦 العربية / 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. Full details, including what changed on the plugin route in v3.11.0, are in docs/languages.md.

They live under skills/i18n/, one directory deeper than the canonical skill. The install commands above are unchanged, because npx skills add resolves --skill by skill name across the whole repository. The Claude Code plugin scan reads skills/*/SKILL.md without recursing, so the plugin route registers the canonical skill alone and no longer carries five extra descriptions in every session's system prompt. On that route the /plan-ar, /plan-de, /plan-es, /plan-zh and /plan-zht commands read the translated skill from disk instead of invoking it by name.

Prefer /planning-with-files with no prefix?

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\"
Enhanced Support: per-IDE setup guides
IDE Installation Guide Integration
Claude Code Installation Plugin + SKILL.md + Hooks
Cursor Cursor Setup Skills + hooks.json
GitHub Copilot Copilot Setup Hooks (incl. errorOccurred)
Mastra Code Mastra Setup Skills + Hooks
Gemini CLI Gemini Setup Skills + Hooks
Kiro Kiro Setup Agent Skills
Codex Codex Setup Skills + Hooks
Hermes Agent Hermes Setup Skill + native plugin (tools, /pwf, pre_llm_call, post_tool_call, pre_verify gate), CLI and Desktop
CodeBuddy CodeBuddy Setup Skills + Hooks
FactoryAI Droid Factory Setup Skills + Hooks
OpenCode OpenCode Setup Native plugin opencode-planning-with-files (chat.message injection, write reminders, compaction flush, session.idle gate, pwf_* tools, /pwf commands) + skill
Standard Agent Skills: discovery paths
IDE Installation Guide Skill Discovery Path
Continue Continue Setup .continue/skills/ + .prompt files
Pi Agent Pi Agent Setup .pi/skills/ (npm package)
OpenClaw OpenClaw Setup .openclaw/skills/ (docs)
Autohand Code Autohand Code Setup ~/.autohand/skills/ or .autohand/skills/
Antigravity Antigravity Setup .agent/skills/ (docs)
Kilocode Kilocode Setup .kilocode/skills/ (docs)
AdaL CLI (Sylph AI) AdaL Setup .adal/skills/ (docs)

Note: If your IDE uses the legacy Rules system instead of Skills, see the legacy-rules-support branch.

Sandbox runtimes
Runtime Status Guide Notes
BoxLite ✅ Documented BoxLite Setup Run Claude Code + planning-with-files inside hardware-isolated micro-VMs

BoxLite is a sandbox runtime, not an IDE. Skills load via ClaudeBox, BoxLite's official Claude Code integration layer.

❓ FAQ

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 ou

planning-with-files (OthmanAdi/planning-with-files)

Searching Database…

这是什么?一个面向 AI 编程智能体的技能(skill),把计划保存在磁盘上的三个 markdown 文件中——taskplan.md、findings.md 和 progress.md——并在每一轮对话时重新注入,因此计划在 /clear、崩溃和上下文压缩后依然保留。
这是我要运行的应用,还是装在我的编程智能体里的东西?它不是独立应用:它是一个技能加生命周期钩子(hooks),安装在你的编程智能体内部,并为 Claude Code、Codex CLI、Pi、Hermes Agent 和 OpenCode 提供原生插件。
我怎么把它装进我的智能体?在 Claude Code 里从 marketplace 安装插件(包含技能、钩子、斜杠命令);其他环境用一行 npx skills add 命令,或用 npm 锁定版本。装好后从 /plan 开始,或直接让智能体为一个任务做计划。
它支持哪些编程智能体?它运行在你现有的智能体里,不需要额外托管任何东西——通过 Agent Skills 标准支持 60 多个智能体,并为 Cursor、GitHub Copilot、Gemini CLI、Kiro、CodeBuddy 和 FactoryAI Droid 提供各自的 IDE 指南。
安装时有什么坑需要我注意的吗?通过技能方式安装(npx skills、npm、手动复制)可能最终没有装上钩子却不报任何错,而钩子正是整个方案的核心——建议优先走插件方式安装,然后运行 /plan-doctor 来验证注入和签名确认是否正常。
它恢复会话的时候,会不会翻查我智能体的对话记录?不会。自动恢复只读取磁盘上的项目文件;要扫描同一项目下的智能体会话记录,必须使用需要你主动开启的 catchup 模式。
它在我项目里保存的三个文件是干什么的?taskplan.md 存计划本身,findings.md 记录发现的问题和失败记录,progress.md 是持续更新的日志。并行任务会使用相互隔离的 .planning/YYYY-MM-DD-slug/ 文件夹,通过 .activeplan 文件来选择——都是纯 markdown,默认已被 gitignore。
它能防止我的智能体过早宣布完成,或者偷偷改计划吗?可以,两者都是按计划选择性开启的。门控模式(gated mode)会在还有未完成的阶段时拦住智能体的停止操作,同时设有拦截次数上限和停滞检测,所以你不会被卡死。计划还会做 SHA-256 哈希签名验证:如果内容与已批准的哈希不匹配,注入时会被拒绝并显示 [PLAN TAMPERED]。
为什么说它仿照 Manus 的做法?据报道 Manus 靠上下文工程做到了 1 亿美元以上的营收——把磁盘上的 markdown 文件当作工作记忆,而不是把所有东西都塞进上下文。这个技能打包的正是这套模式:通过钩子反复重申计划、持久化错误记录、跟踪目标以及完成后的核验。
有没有证据表明它确实有效?仓库报告在 3 次盲测 A/B 对比中 3 次全部胜出,并且在一个内部基准测试中,磁盘上有计划文件的新会话用 5.0 轮就恢复了进度,而原始智能体需要 13.3 轮——这是作者自己运行、且基于较旧的 transcript-catchup 行为测得的数据。测试套件共有 706 个测试,一览表显示启用该技能后的通过率为 96.7%。
Creator
OthmanAdi
Size
26 MB
Stars
27.5K
Age
9mo
Commits · 90 Days