mirror of
https://github.com/OthmanAdi/planning-with-files.git
synced 2026-04-25 16:06:02 +03:00
[GH-ISSUE #19] For multi-step / complex tasks, how should this skill be used properly? #15
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/planning-with-files#15
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @wqh17101 on GitHub (Jan 12, 2026).
Original GitHub issue: https://github.com/OthmanAdi/planning-with-files/issues/19
I am using this skill to handle a complex task. It has planned 5 steps for me. After completing the first step, the context length has already reached 140K, nearing the automatic compression trigger.
To ensure the best results, how should I proceed? For example, should I open a new window and ask it to continue working by referring to the task_plan.md file? If so, what would be an appropriate prompt to use?
@liangxiwei commented on GitHub (Jan 12, 2026):
just use claude code's plan mode
@OthmanAdi commented on GitHub (Jan 12, 2026):
Good question @wqh17101 this is exactly the scenario the skill is designed for.
The solution: Start a new Claude session and use this prompt:
The core idea of this skill is that your files are your memory, not the context window. When context fills up, you don't try to compress it you start fresh and reload from the files.
Before switching sessions, make sure your 3 planning files are fully updated. If you've been following the workflow (updating after each phase, logging discoveries), everything important is already on disk.
Why not use
/resumeor auto-compact?/resumerestores full message history — same context problemA possible improvement: I could create a branch with a
RESUME.mdtemplate a file that gives you a ready-to-paste prompt and captures any volatile context before you switch sessions. If you'd like to test this, let me know and I'll set up a branch for you to try.@OthmanAdi commented on GitHub (Jan 12, 2026):
@liangxiwei Plan mode solves a different problem it's for designing an approach before implementation.
This issue is about context filling up during execution of a multi-step task. Plan mode doesn't help when you're mid-task at 140K tokens.
The two can work together: plan mode for the design phase, planning-with-files for persisting state across sessions during execution.
@OthmanAdi commented on GitHub (Jan 12, 2026):
@wqh17101 中文版本:
好问题 这正是这个技能设计的使用场景。
解决方案: 开启一个新的 Claude 会话,使用这个提示词:
这个技能的核心理念是:文件就是你的记忆,而不是上下文窗口。当上下文满了,不要试图压缩它 直接开新会话,从文件重新加载。
切换会话之前,确保你的3个计划文件已完全更新。如果你一直按照工作流程操作(每个阶段后更新、记录发现),所有重要内容都已经在磁盘上了。
为什么不用
/resume或自动压缩?/resume恢复完整消息历史 同样的上下文问题可能的改进: 我可以创建一个带有
RESUME.md模板的分支 这个文件会给你一个可直接复制的提示词,并在切换会话前捕获任何临时上下文。如果你想测试,告诉我,我会为你建立一个分支。@wqh17101 commented on GitHub (Jan 12, 2026):
That is good,i am glad to try the branch.
Additionally, regarding avoiding automatic compression, it currently seems the only solution is for a human to manually intervene and start a new window when the context is nearly full. Do you think we could integrate other skills or plugins to achieve automatic creation? Alternatively, could we break this down into multiple tasks handled by sub-agents (are the contexts of sub-agents calculated independently)?
@OthmanAdi commented on GitHub (Jan 12, 2026):
@wqh17101 Great questions. I researched both and here's what I found:
1. Automatic Detection of Context Fullness
Currently not possible with Claude Code's architecture.
Here's what exists:
<system_warning>Token usage: 35000/200000; 165000 remaining</system_warning>after tool calls (source)/contextcommandWhat's missing:
Bottom line: Until Claude Code adds a context-threshold hook, manual intervention is the only option.
2. Sub-Agents with Independent Context
Yes, sub-agents have isolated context windows — but there's nuance.
How it works (source):
The complication — context inheritance varies by agent type (source):
.claude/agents/So if you spawn a
general-purposesub-agent for Phase 2, it might inherit the 140K from Phase 1. That defeats the purpose.Potential solution: Create a custom subagent that enforces fresh context:
I haven't tested this yet — it needs verification whether custom subagents truly start fresh or inherit context.
What Definitely Works Now
The manual approach I described earlier:
Read task_plan.md, findings.md, progress.md and continue from Phase XNext Steps
I'll set up the
feature/session-handoffbranch with theRESUME.mdtemplate for you to test.For the sub-agent approach — I can also create an experimental
phase-executorsubagent definition if you want to test whether custom subagents get fresh context. Let me know.@OthmanAdi commented on GitHub (Jan 12, 2026):
@wqh17101 just commneted on what we need https://github.com/anthropics/claude-code/issues/14047
@wqh17101 commented on GitHub (Jan 12, 2026):
What do you think about this article https://www.anthropic.com/engineering/effective-harnesses-for-long-running-agents ?
Is there anything worth taking inspiration from?
@OthmanAdi commented on GitHub (Jan 12, 2026):
@wqh17101 This is a solid reference — it's from Anthropic's own engineering team and basically confirms the approach this skill takes.
What they do:
claude-progress.txtto track completed work (same idea as ourprogress.md)Patterns we could borrow:
init.shtask_plan.mdwith statusThe key insight:
So fresh session + read files isn't a hack — it's the intended pattern.
What I'll add to the repo:
init.shtemplate for session setuptask_plan.mdThanks for digging this up — really helpful.
@OthmanAdi commented on GitHub (Jan 12, 2026):
@wqh17101 中文版本:
这是个很好的参考 — 来自 Anthropic 自己的工程团队,基本上验证了这个技能的核心思路。
他们的做法:
claude-progress.txt记录完成的工作(和我们的progress.md一样的思路)我们可以借鉴的模式:
init.shtask_plan.md的状态追踪关键洞察:
所以"新会话 + 读取文件"不是临时方案 — 这就是官方推荐的模式。
我会添加到仓库的内容:
init.sh会话启动模板task_plan.md中增加通过/失败状态追踪感谢你找到这篇文章 — 非常有帮助。
@wqh17101 commented on GitHub (Jan 14, 2026):
Let me know when you're ready. I'm really looking forward to it! -- handoff
@lasmarois commented on GitHub (Jan 17, 2026):
@OthmanAdi I just created a PR https://github.com/OthmanAdi/planning-with-files/pull/33 that proposes a more robust workflow:
Before (default): Auto-compact on, context managed automatically by Claude Code
New recommendation:
/planning-with-filesto start/clearwhen full/planning-with-filesagain → auto-catches up → continueWhy: Maximizes usable context per session, and the skill now handles the recovery automatically instead of relying on auto-compact's summarization.
@OthmanAdi commented on GitHub (Jan 17, 2026):
@wqh17101 Building those features now! I'll add them in a
feature/anthropic-patternsbranch and tag you when ready.The features based on the Anthropic article:
init.sh)Should have this ready soon!
@OthmanAdi commented on GitHub (Jan 17, 2026):
@wqh17101 The features are ready! 🎉
I've implemented all the session management patterns from the Anthropic article in the feature/anthropic-patterns branch.
What's New
Session Initialization Script (init-session.sh / .ps1)
Pass/Fail Status Tracking
Git Checkpoint Workflow
Session-Start Verification
Try It Out
See IMPLEMENTATION_SUMMARY.md in the branch for full usage instructions.
Let me know how it works for you! Once you approve, I'll merge to main.
Ahmad
@wqh17101 commented on GitHub (Jan 18, 2026):
Wow, that's awesome! I'll give it a try next week.
question 1
How to start a new Claude session and run init-session.sh again ? By input "Continue using the "planning-with-files" skill."?
question 2
Is this process manual or automated?
@OthmanAdi commented on GitHub (Jan 18, 2026):
@wqh17101 The features are ready! 🎉
I've implemented all the session management patterns from the Anthropic article in the ** branch.
What's New
Session Initialization Script (\ / )
Pass/Fail Status Tracking
Git Checkpoint Workflow
Session-Start Verification
Try It Out
See \ in the branch for full usage instructions.
Let me know how it works for you! Once you approve, I'll merge to main.
Ahmad
@wqh17101 commented on GitHub (Jan 19, 2026):
Some problems. https://github.com/OthmanAdi/planning-with-files/discussions/36#discussioncomment-15543845
@yuanhaorannnnnn commented on GitHub (Feb 4, 2026):
so your advice is using planning-with-files in normal mode intead plan mode?
@OthmanAdi commented on GitHub (Feb 4, 2026):
@yuanhaorannnnnn Thanks for the question. you should use both, they complement each other.
Plan mode = designing your approach before you start (what to build, how to structure it)
planning-with-files = persisting your state while you're executing (so you never lose progress)
The real value of this skill is that your files become your memory. Claude's context window is limited and volatile, once it fills up or you start a new session, everything is gone. planning-with-files solves that by keeping task_plan.md, findings.md, and progress.md as persistent state on disk.
So the workflow is:
No other tool gives you that kind of continuity across sessions. That's the core value.