Repository navigation
docs: explain what max_total_tokens counts - #237
Merged
Merged
Conversation
Each turn adds its whole prompt (cached tokens included) plus output, so the total grows much faster than the conversation: the 1M default is reached around turn 16 at a 60K context. Documented in the rustdoc and the context guide, with a table and the settings for long sessions (raise or usize::MAX, and max_duration). Behaviour unchanged; counting conversation growth instead is tracked as a low-priority follow-up. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01T7iq5hpndSiHQcnAsywKuG
… caps (review of #237) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01T7iq5hpndSiHQcnAsywKuG
Merged
yuanhao
added a commit
that referenced
this pull request
Oct 5, 2026
Reliability fixes from the October codebase review (#232-#235, #237, #238). Claude-Session: https://claude.ai/code/session_01T7iq5hpndSiHQcnAsywKuG Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #226 by documenting the behaviour. The behaviour itself is unchanged.
What's documented: each turn adds its whole prompt (cached tokens included) plus its output. The prompt resends the conversation, so the total grows much faster than the conversation does: the 1M default is reached around turn 16 at a 60K-token context.
Where:
ExecutionLimits::max_total_tokensandwith_max_total_tokensrustdoc: what is counted, why it grows fast, and to raise it or setusize::MAXfor long sessions.max_durationrustdoc: the 10-minute default also ends long interactive sessions.docs/concepts/context-management.md: a new "Whatmax_total_tokenscounts" section, with a context-size → turns table and a long-session example.Counting the conversation's growth instead is tracked as a low-priority follow-up issue.
🤖 Generated with Claude Code
https://claude.ai/code/session_01T7iq5hpndSiHQcnAsywKuG