launch: disable claude code token countdown to preserve KV cache (#17918)

Claude Code adds a "tokens left" system message after every tool
result. Since ollama moves system messages to the front of the prompt,
this breaks the KV cache on every request.
This commit is contained in:
Devon Rifkin 2026-08-21 17:44:44 -07:00 • committed by GitHub
parent 124e9af9d2
commit add1f92bdd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 0 deletions

View file

@ -70,6 +70,7 @@ func (c *Claude) envVars(model string) []string {
"ANTHROPIC_API_KEY=",
"ANTHROPIC_AUTH_TOKEN=ollama",
"CLAUDE_CODE_ATTRIBUTION_HEADER=0",
"CLAUDE_CODE_TOTAL_TOKENS_REMINDER=off",
"DISABLE_ERROR_REPORTING=1",
"DISABLE_FEEDBACK_COMMAND=1",
"CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY=1",

View file

@ -353,6 +353,7 @@ func TestClaudeEnvVars(t *testing.T) {
"ANTHROPIC_API_KEY": "",
"ANTHROPIC_AUTH_TOKEN": "ollama",
"CLAUDE_CODE_ATTRIBUTION_HEADER": "0",
"CLAUDE_CODE_TOTAL_TOKENS_REMINDER": "off",
"DISABLE_ERROR_REPORTING": "1",
"DISABLE_FEEDBACK_COMMAND": "1",
"CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY": "1",