[BUG] Auto-compact not triggering with AWS Bedrock backend
Resolved 💬 4 comments Opened Aug 18, 2025 by KylinWu Closed Jan 6, 2026
Environment
- Platform (select one):
- [ ] Anthropic API
- [x] AWS Bedrock
- [ ] Google Vertex AI
- [ ] Other: <!-- specify -->
- Claude CLI version: v1.0.80
- Operating System: macOS 15.4.1
- Terminal: iTerm2
Bug Description
Auto-compact feature fails to trigger properly when using AWS Bedrock as the model backend, causing context tokens to exceed maximum window size and resulting in "Input is too long for requested model" errors.
Steps to Reproduce
- Configure Claude Code to use AWS Bedrock as the model backend
- Enable auto-compact in settings
- Start a long conversation/coding session that accumulates significant context
- Observe the auto-compact warning threshold indicator (keeps flashing
0%) - Continue working until context tokens increase beyond the model's maximum context window
- Receive "Input is too long for requested model" error from the API
<img width="1187" height="84" alt="Image" src="https://github.com/user-attachments/assets/b4b62289-ef09-4a91-936f-b82e90e423fc" />
Expected Behavior
- Auto-compact should trigger automatically before reaching context window limits
- Context should be compacted proactively to prevent hitting maximum window size
- No "Input is too long for requested model" errors should occur with auto-compact enabled
Actual Behavior
- Auto-compact sometimes fails to trigger despite being enabled
- Auto-compact warning threshold indicator keeps flashing
0%as context grows (caused by context continuously increasing without compaction being triggered) - Main agent context tokens continue to increase without compaction
- Compaction doesn't occur before hitting limits, eventually resulting in "Input is too long for requested model" API error
- Manual compaction may work, but automatic triggering is unreliable
Additional Context
This appears to be specific to AWS Bedrock backend integration. The auto-compact feature may work correctly with other backends but has reliability issues with Bedrock. This causes workflow interruptions and requires manual intervention to continue working.
Related issue: https://github.com/anthropics/claude-code/issues/760
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗