Automatic Context Management for Large Code Generation

Resolved 💬 2 comments Opened Feb 25, 2025 by matthewlloyd Closed Feb 28, 2025

Bug Description
Whenever I try to implement a complex feature, it thinks for a while then gives an API Error 400 "input length and max_tokens exceed context limit: 195769 + 20000 > 204698, decrease input length or max_tokens and try again".

It's not clear what to do next to avoid losing the work done so far. Should the user /compact? If so, how should the user retry or continue the process without losing too much state?

Claude Code should handle this itself, automatically. The context limit is an implementation detail of the underlying model used, and the user should be at least partially shielded from having to manage it.

Environment Info

  • Platform: macos
  • Terminal: iTerm.app
  • Version: 0.2.9
  • Feedback ID: 69dd5ffb-ec31-4562-9ba8-0c1f77c8320e

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗