跳到正文
DEV Community· PlainSkillsZero0·· 9 天前AI 評分55

Claude Code 跨工作階段容易失去脈絡?5 個可即時採用的改善方法

Claude Code keeps forgetting? 5 fixes you can apply today

AI 導讀

作者針對 Claude Code 跨工作階段失去脈絡的情況,提出 5 項無需購買新工具的工作習慣。做法包括精簡更新 CLAUDE.md、預估長任務成本、要求以不同方式驗證完成結果、為子任務設定上限與停止規則,以及把工作交接寫入 HANDOFF.md。

正文

PlainSkillsZero0

If Claude Code loses the thread between sessions, you do not need a new tool. Five habits fix most of it. Everything below is generic; nothing to buy to use it.

1. Put what must survive in CLAUDE.md, and keep it short

Write facts the next session cannot guess (commands, folders, "never do X"). One line each, checkable. Delete lines that stopped being true. Check the current format in the official docs: https://code.claude.com/docs

2. Before a long job, estimate the cost

Write down how many steps, how many sub-agents, and what it would cost if it runs 3x longer than planned. If you cannot say, shrink the job. Use your plan's usage view if it has one.

3. Never accept "done" without proof

Ask: "Check it a different way than you did it (a second command, a test, a diff) and show me the output."

4. Stop loops before they burn your plan

Every sub-task gets a one-line goal, a limit (steps or minutes) and a stop rule ("stop if two tries give the same error"). I made a small free skill for this (MIT): https://github.com/happy-program-zero/loop-stop

5. Hand over properly at the end of a session

Ask for 5 lines: what is done (with evidence), what is not, what is next, what is risky, which files changed. Save them as HANDOFF.md and start the next session by reading it.


If you would rather have the first three as ready-made skills (plain text, you read every file before installing): Claude Code Starter 3, $5.

Independent, not affiliated with Anthropic. "Claude" and "Claude Code" are trademarks of Anthropic.

來源:DEV Community · dev.to