Concise Summary简洁概述
Every Claude Code turn is a decision point among five options — continue, rewind, clear, compact, or delegate to a subagent — and picking well is the main lever for avoiding context rot.
With a 1M-token window, the real risk shifts from running out of space to letting irrelevant history dilute the model's attention — so proactive, targeted compaction beats waiting for automatic triggers.
Claude Code 的每一次回合都是继续、回溯、清空、压缩、派子智能体这五个选项间的抉择,选得好坏是避免「上下文衰减」的关键杠杆。
在百万级上下文窗口下,真正的风险已从「空间不够」转向「无关历史稀释模型注意力」,因此主动、有针对性地压缩优于坐等自动触发。
Infographic信息图
Five forks at every turn
每个回合的五条岔路
After each Claude response you're at a decision point: Continue, Rewind, Clear, Compact, or spin off a Subagent. Defaulting to 'just continue' is the path of least resistance but silently accumulates context debt.
Claude 每次回答完,你都站在岔路口:继续、回溯、清空、压缩或派子智能体。默认「直接继续」是阻力最小的选项,却会悄悄积累「上下文债务」。
Rewind beats correcting in place
回溯优于原地纠错
When an approach fails, typing 'that didn't work, try X' leaves the failed attempt's five files of noise in context. Rewinding to before the failed attempt and re-prompting with the lesson learned keeps the window clean.
当某种方法失败时,直接打字说「这招不管用,换 X」会把失败尝试读过的五个文件的噪音留在上下文里。回溯到失败前,带着教训重新下指令,能保持窗口干净。
Compact trades control for convenience
压缩:用控制权换便利
Compact hands Claude the decision of what matters via lossy summarization — fast but risky. Clear forces you to write the handoff yourself — slower but the resulting context is 100% deliberate.
压缩把「什么重要」的决定权交给 Claude 做有损总结——快但有风险;清空则要求你亲手写交接摘要——慢但换来的上下文百分百经过筛选。
Subagents as disposable scratch space
子智能体:一次性草稿纸
When a task will generate large volumes of 'read once, discard' intermediate output, a subagent absorbs that mess in its own window and returns only a distilled report — the parent context never sees the noise.
当一项任务会产生大量「读一次就没用」的中间结果时,子智能体能在自己的独立窗口里消化这些杂乱信息,只把提炼后的报告交回——父级上下文完全不受污染。
Detailed Summary详细解读
The piece opens by defining context window, context rot, and compaction as the vocabulary needed to reason about session management. The core insight is that context is not free: every additional token, whether from tool output, file reads, or old chat turns, competes for the model's attention, and stale content actively interferes with the current task rather than sitting inert. This reframes 'just keep the session open' as a decision with real cost, not a neutral default.
The five-way fork (continue/rewind/clear/compact/subagent) is the article's organizing device. Continue is the default because it requires zero thought, but the other four exist specifically as context-management tools — meaning the author is implicitly arguing that skilled Claude Code usage means deliberately choosing away from the default most of the time.
The rewind-over-correct-in-place argument is the article's sharpest, most actionable claim: typing a correction mid-conversation leaves the failed attempt's full trace (files read, wrong reasoning) in context, silently degrading later turns, whereas rewinding erases that trace entirely and lets you re-inject only the distilled lesson. This is presented as the single highest-leverage habit.
Compact vs. Clear is framed as a control-versus-effort trade-off rather than one being strictly better: Compact delegates the summarization judgment to the model (convenient, occasionally misses what you'll need next), while Clear forces the user to write an explicit handoff (effortful, but guarantees relevance). The failure mode of Compact — discarding details the model couldn't predict you'd need — is diagnosed precisely: it happens because the model is at its least reliable exactly when it has to decide what to keep.
Subagents close the piece as a structurally different tool: rather than managing an existing context's size, they prevent pollution altogether by isolating disposable intermediate work in a separate window and surfacing only a distilled report. The decision heuristic offered — 'will I need to see the tool outputs again, or just the conclusion?' — is a clean, reusable test readers can apply beyond Claude Code.
文章开篇先定义了上下文窗口、上下文衰减、上下文压缩这几个核心概念,为讨论会话管理打好词汇基础。核心洞察是:上下文并非免费——无论来自工具输出、文件读取还是旧对话轮次,每多一个 Token 都在争夺模型的注意力,而陈旧内容不是静静躺在那里,而是会主动干扰当前任务。这就把「保持会话一直开着」从一个中性默认选项,重新定义为一个有真实代价的决策。
「五岔路」框架(继续/回溯/清空/压缩/子智能体)是全文的组织核心。「继续」之所以是默认选项,是因为它不需要任何思考,但其余四个选项的存在本身就是为了管理上下文——这隐含地说明,熟练使用 Claude Code 意味着大多数时候要主动地不选默认项。
「用回溯代替原地纠错」是全文最尖锐、最可操作的主张:在对话中直接打字纠正,会把失败尝试的完整痕迹(读过的文件、错误推理)留在上下文里,悄悄拖累后续回合;而回溯则彻底清除这条痕迹,只重新注入提炼后的教训。文章将其称为「性价比最高的单一习惯」。
压缩与清空被定位为「控制权 vs 省力」的权衡,而非孰优孰劣:压缩把总结判断权交给模型(方便,但偶尔会漏掉你接下来需要的内容),清空则强制用户手写交接说明(费力,但保证相关性)。文章还精确诊断了压缩的失败模式——丢弃模型无法预判你会需要的细节——其根源在于,模型恰恰是在必须决定「保留什么」的那一刻,处于最不可靠的状态。
子智能体作为全文收尾,是一种结构性不同的工具:它不是管理已有上下文的大小,而是从源头上避免污染——把一次性的中间过程隔离在独立窗口中,只把提炼后的结论交回来。文章给出的判断标准——「我以后还需要看这些工具输出的细节,还是只要结论?」——是一个简洁、可迁移到其他场景的实用测试。
FAQ常见问答
Why does a 1M-token window not eliminate the need for careful session management?为什么百万级上下文窗口并没有消除精细管理会话的必要性?
Because context rot is about attention dilution, not just hitting a hard cap. Even well within the 1M limit, stale or irrelevant content degrades output quality by competing for the model's focus.
因为上下文衰减的本质是注意力被稀释,而不只是撞到硬性上限。即使远未达到百万 Token 上限,陈旧或无关内容也会争夺模型的注意力,拖累输出质量。
When should you start a brand-new session versus keep the current one alive?什么时候该开新会话,什么时候该延续当前会话?
Start new when beginning a genuinely different task — the 1M window makes long, complex builds reliable from scratch. Keep the session alive for closely related follow-ups (like writing docs right after building a feature) to avoid re-reading the same files.
开始一项真正不同的新任务时就该开新会话——百万上下文能让从零构建的长任务也很可靠。而紧密相关的后续工作(比如刚写完功能就写文档)则应延续原会话,避免重复读取同一批文件。
Is Compact ever the wrong call even when it seems convenient?即使压缩看起来很省事,它有可能是错误的选择吗?
Yes — Compact fails predictably right after long debugging sessions, where a next request referencing something outside the summarized focus (like an unrelated warning) gets silently dropped because the model couldn't anticipate it.
是的——压缩在长时间调试后特别容易翻车:如果下一条请求提到了摘要焦点之外的内容(比如一个不相关的警告),它很可能被模型悄悄丢弃,因为模型根本无法预判你会提到它。
How is Rewind different from just telling Claude it made a mistake?回溯和直接告诉 Claude「你错了」有什么区别?
Telling Claude it's wrong keeps the failed attempt's full trace — files read, flawed reasoning — sitting in context, diluting future turns. Rewind erases that trace entirely, letting you re-inject only the distilled lesson learned.
直接告诉 Claude 它错了,会让失败尝试的完整痕迹(读过的文件、错误推理)继续留在上下文里,稀释后续回合的质量。回溯则彻底抹去这条痕迹,只重新注入你提炼出的教训。
What's the simplest test for deciding whether to use a subagent?判断是否该用子智能体,最简单的检验标准是什么?
Ask: will I need to inspect the detailed tool outputs again later, or do I only care about the final conclusion? If it's just the conclusion, delegate to a subagent and let it absorb the noisy intermediate steps.
问自己:以后我还需要回看这些工具运行的详细输出吗,还是只想要最终结论?如果只要结论,就该委派给子智能体,让它自己消化那些嘈杂的中间步骤。
In-depth Analysis · Pros & Cons深入解读 · 优缺点
Anthropic's Claude Code evangelist Thariq breaks down the everyday choices — continue, rewind, clear, compact, or delegate — that determine whether a long coding session stays sharp or degrades. It's a practitioner's field guide to context management, not a research paper, but its heuristics are concrete enough to apply immediately.
Claude Code 布道者 Thariq 拆解了编码会话中每次回合都要面对的选择——继续、回溯、清空、压缩,还是委派子智能体——这些选择决定了长会话是保持清醒还是逐渐失焦。这不是一篇研究论文,而是一份来自实践者的上下文管理操作指南,其经验法则足够具体,可以直接套用。
- Concrete, reusable heuristics具体、可复用的经验法则Unlike abstract advice, each recommendation (rewind over correct, new session per new task, ask 'will I need the details') is immediately testable in a real Claude Code session.不同于空泛的建议,每条推荐(回溯优于纠错、新任务开新会话、自问「是否还需要细节」)都能在真实 Claude Code 会话中立刻验证。
- Names the exact failure mode of Compact精确点出压缩的失败模式The article doesn't just say compaction can go wrong — it explains the mechanism: the model summarizes worst exactly when context is longest, and unpredictable follow-ups get pruned.文章不止说「压缩可能出错」,而是解释了其机制:模型在上下文最长、状态最差的时刻做总结,而无法预判的后续请求会被误删。
- Reframes subagents as a distinct tool, not a lesser Compact把子智能体定位为独立工具,而非「弱化版压缩」By tying subagent use to a clean yes/no test (need details later or not), the piece avoids treating delegation as just another summarization trick.通过给出清晰的是非判断标准(以后是否需要细节),文章避免了把「委派」简单等同于又一种总结技巧。
- Written from direct product-usage feedback源自真实产品使用反馈The advice is grounded in patterns Anthropic observed across many users' actual sessions, not hypothetical scenarios, giving the heuristics practical credibility.这些建议基于 Anthropic 观察到的大量用户真实会话模式,而非假设场景,使经验法则具备实践可信度。
- Written by an Anthropic insider about their own product作者是 Anthropic 内部人士,评价自家产品Thariq is Claude Code's chief evangelist; the piece has an implicit promotional angle and doesn't discuss failure cases where these features (e.g. compact) underperform competitors or simpler workflows.Thariq 是 Claude Code 的核心布道者,文章带有隐性推广色彩,没有讨论这些功能(如压缩)相对于竞品或更简单工作流表现更差的情形。
- No quantitative evidence for any claim所有主张均无量化证据支撑Claims like 'rewind is the best habit' or descriptions of when compaction fails are asserted from experience, with no benchmarks, error rates, or user study numbers to substantiate them.「回溯是最佳习惯」以及压缩失败场景的描述,都仅凭经验断言,没有任何基准测试、错误率或用户研究数据支撑。
- Heuristics may not generalize beyond Claude Code's specific UI经验法则未必能超越 Claude Code 特定界面泛化Rewind, /compact, and subagents are Claude Code-specific mechanics; the underlying context-management principles are portable, but the concrete advice doesn't directly apply to other coding assistants.回溯、/compact、子智能体都是 Claude Code 特有的机制;底层的上下文管理原则具有可迁移性,但具体操作建议并不能直接套用到其他编程助手上。
- Says little about cost/latency trade-offs of each choice较少讨论各选项在成本与延迟上的权衡The piece briefly notes new sessions re-reading files are 'slower and costlier' but doesn't quantify how compact, clear, or subagents compare on token spend or wall-clock time, leaving practical cost planning to the reader.文章只简单提到新会话重新读文件「更慢更贵」,但没有量化压缩、清空、子智能体在 Token 花费或耗时上的具体对比,实际成本规划仍需读者自行摸索。
Read this if you use Claude Code (or any long-running coding agent) regularly and want a practical checklist for keeping sessions sharp — the rewind-over-correct and compact-vs-clear framings are worth adopting immediately. Treat it as a product usage guide with promotional undertones rather than an independent evaluation; it offers no data on when these features fail relative to simpler alternatives.
如果你经常使用 Claude Code(或任何长时运行的编程智能体),并想要一份保持会话清醒的实用清单,值得一读——「回溯优于纠错」「压缩 vs 清空」的框架可以立刻拿来用。但应把它当作带推广色彩的产品使用指南,而非独立评测:文章没有提供这些功能相对于更简单替代方案何时会失效的数据。
Excerpt原文节选
This is a short excerpt, not the full piece — the complete essay belongs to its original author; please read it in full at the link above.
以下仅为节选,并非全文——完整文章版权归原作者所有,请点击上方链接阅读全文。
The English text on this side is an AI translation provided for convenience; the authoritative version is the source in the other language.
Author: Thariq. Original: Using Claude Code: Session Management & 1M Context
[Note: Thariq is an Anthropic employee and a leading external voice for Claude Code. This piece is essentially a product usage guide with an official promotional angle, but the practical advice is genuinely useful.]
Today, we're rolling out a brand-new update to the /usage command, designed to give you a clearer picture of how you're using Claude Code. This decision comes out of a series of in-depth conversations we've had with users recently.
In these conversations, we repeatedly heard about one thing: people's habits around managing sessions vary wildly. This has become even more pronounced now that Claude Code has recently pushed its context window up to the 1 million mark.
Are you the type to keep just one or two sessions open in your terminal? Or do you start a fresh session every time you type a prompt?
[…the source continues — read the rest at the link above]
[……原文更长,完整内容请点击上方链接阅读]
We hope that in the future, Claude will be smart enough to handle all of this for you automatically.
作者:Thariq 原文: Using Claude Code: Session Management & 1M Context
【注:Thariq 是 Anthropic 员工,Claude Code 的核心对外布道者。这篇本质是产品使用指南,有官方推广成分,但操作建议确实实用。】
今天,我们为 /usage 命令推出了一项全新更新,旨在帮助你更清晰地了解自己在 Claude Code 中的使用情况。这个决定的背后,是我们近期与用户进行的多次深入交流。
在这些交流中,我们反复听到了一个现象:大家在管理会话时的习惯可谓是五花八门。尤其是最近 Claude Code 将上下文窗口(Context Window)升级到了 100 万大关,这种差异就更明显了。
你是习惯在终端里只保持一两个开着的会话?还是每次输入提示词都重新开个新会话?你通常在什么时候会用到压缩(Compact)、回溯(Rewind)或者子智能体(Subagents)?又是什么原因导致了一次糟糕的压缩呢?
这里头其实大有学问。这些看似不起眼的细节,极大地影响着你使用 Claude Code 的体验。而这一切的核心,都归结于一件事:如何管理你的上下文窗口。
快速科普:上下文、上下文压缩与上下文衰减
所谓“上下文窗口(Context Window)”,就好比模型在生成下一次回答时,眼前能同时“看到”的所有信息。它包括了你的系统提示词(System Prompt)、到目前为止的聊天记录、每一次的工具调用(Tool Call)及其输出结果,甚至还有它读过的每一个文件。现在,Claude Code 拥有高达 100 万个词元(Token) (注释:Token 是大模型处理文本的基本单位,通常一个英文单词约为 1 个 Token,一个汉字可能占 1-2 个 Token) 的超大上下文窗口。
但遗憾的是,使用上下文是需要付出一点代价的,我们通常称之为上下文衰减(Context Rot) (注释:指随着对话历史越来越长,模型需要处理的信息量过大,导致其注意力分散,遗忘早期重要信息或被无关内容干扰的现象) 。
[…the source continues — read the rest at the link above]
[……原文更长,完整内容请点击上方链接阅读]
我们期望在未来,Claude 能足够聪明,自己帮你打理好这一切。但就目前而言,熟练掌握这些决策,正是你引导 Claude 产出高质量结果的必经之路。