---
url: >-
  https://adk.nht.io/api/@nhtio/adk/batteries/llm/claude_code_cli/exceptions/variables/E_CLAUDE_CODE_CLI_CONTEXT_OVERFLOW.md
description: >-
  Thrown when the assembled request exceeds the configured `contextWindow`
  during the pre-flight context-window guard. Only raised when `tokenEncoding`
  is non-null. Carries
---

# Variable: E\_CLAUDE\_CODE\_CLI\_CONTEXT\_OVERFLOW

```ts
const E_CLAUDE_CODE_CLI_CONTEXT_OVERFLOW: CreatedException<
  [number, number, string, string]
>;
```

Defined in: [src/batteries/llm/claude\_code\_cli/exceptions.ts:132](https://github.com/NHTIO/ADK/blob/v1.20261003.0/src/src/batteries/llm/claude_code_cli/exceptions.ts#L132)

Thrown when the assembled request exceeds the configured `contextWindow` during the pre-flight
context-window guard. Only raised when `tokenEncoding` is non-null. Carries `{ total,
contextWindow, tokenEncoding, perBucket }` in the message so middleware can target shedding.

## Remarks

This is the ADK-side token-budget guard and refuses the request before the Claude Code CLI
wrapper is spawned. The rendered prompt and append-system prompt are measured exactly; it is
an honest floor only because Claude Code injects additional vendor-owned content (the Agent SDK
preamble, CWD/Date, billing header, built-in tool schemas, and MCP declaration envelope).
