claude-code-toolkit

Error / Message

Context window exceeded

The conversation, including file contents and tool output, has grown too large for the model to hold in a single request.

Every message, file read, and tool result in a session counts against a fixed context budget. Long sessions — especially ones involving reading large files or many tool calls — eventually approach that limit, and Claude Code warns before it becomes a hard failure.

The fix depends on whether the earlier context still matters. If it does, /compact summarizes it down to something much smaller while keeping the gist. If the task has genuinely moved on to something unrelated, /clear starting a fresh context is usually the better call.

This isn't a bug or a sign something went wrong — it's an inherent limit of how these models work, and a normal part of any long session.

Run /compact or /clear when you see this warning

Frequently asked questions

What does "Context window exceeded" mean in Claude Code?

The conversation, including file contents and tool output, has grown too large for the model to hold in a single request.

How do I fix it?

Try: Run /compact or /clear when you see this warning

Is this something to worry about?

This isn't a bug or a sign something went wrong — it's an inherent limit of how these models work, and a normal part of any long session.

Is this covered in the Claude Code Toolkit?

Yes — Context window exceeded and patterns like it are part of the full command, hook, and template pack included with a Claude Code Toolkit subscription.

Want the full command, hook, and template pack?

This is one pattern out of the full Claude Code Toolkit — subscribe for the complete set, plus everything we add going forward.

Subscribe to the toolkit — $79/mo

← See everything in Explore