上下文与输出限制速查

先确认模型窗口,再配置工具侧压缩和 max tokens,避免长会话溢出。

工具类型上下文配置输出上限压缩 / 摘要
Claude CodeCLI / Anthropic跟随模型;可用 CLAUDE_CODE_MAX_CONTEXT_TOKENS 覆盖假设CLAUDE_CODE_MAX_OUTPUT_TOKENS自动压缩默认约 95%;可用 CLAUDE_AUTOCOMPACT_PCT_OVERRIDE 提前
OpenAI Codex CLICLI / OpenAI Responsesmodel_context_windowmodel_max_output_tokensmodel_auto_compact_token_limit
TraeIDE跟随 Trae 内置模型识别由 Trae 和上游共同限制无细粒度压缩配置
OpenCodeCLI / TUIprovider model limit.contextprovider model limit.outputcompaction.auto / prune / reserved
HermesCLI / Agentmodel.context_length(总上下文窗口)model.max_tokens(单次输出上限,建议留空或按需限制)compression.enabled / compression.threshold / summary_model
OpenClawCLI / AgentcontextWindow(按当前 schema)请求侧或 provider 透传 max_tokens遵循工具会话管理
WorkBuddyAI Agent由 Agent 自动管理由上游模型限制Agent 自动管理上下文

工具列表