# 使用 Claude Code:会话管理与 100 万 上下文 Canonical URL: https://www.traeai.com/articles/f7f34773-f330-4e5b-b877-55b5d4700baa Original source: https://baoyu.io/translations/claude-code-session-management Source name: 宝玉的分享 Content type: article Language: 未知 Score: 8.5 Reading time: 未知 Published: 2026-04-15T00:00:00+00:00 Tags: Claude Code, AI编程, 上下文管理, 大模型工程, 开发工作流 ## Summary traeai 从博客、播客、视频和推文中筛选高质量技术内容,生成摘要、要点、评分和每日早报。 ## Key Takeaways - 面对百万级上下文,需根据任务阶段灵活选用继续、回溯、清空、压缩或子智能体,以规避上下文衰减导致的模型失焦。 - 纠正AI错误时应优先使用回溯功能退回关键节点重新引导,避免在错误路径上堆砌提示词,从而节省Token并提高成功率。 - 长会话应主动压缩或新建以防关键信息被丢弃;涉及大量中间过程的任务宜交由子智能体处理,主会话仅接收最终结果。 ## Citation Guidance When citing this item, prefer the canonical traeai article URL for the AI-readable summary and include the original source URL when discussing the underlying source material.