[Bug] Agents fail with "prompt too long" error despite small prompts, causing zero token usage
Resolved 💬 3 comments Opened Apr 2, 2026 by nprisbrey Closed Apr 3, 2026
Bug Description
My agents aren't working at all. They always take 0 tokens and I'm told when looking after "Ctrl + o" that the prompt was too long, even though the prompt is quite small and manageable. This results in the main Claude instance always having to do everything itself manually synchronously in context. I thought this would be resolved a few Claude Code versions ago, but 2.1.89 and 2.1.90 haven't fixed this.
Environment Info
- Platform: linux
- Terminal: gnome-terminal
- Version: 2.1.90
- Feedback ID: 33ae38a9-8d95-4dab-ac34-caffcb97b964
Errors
[{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"prompt is too long: 210445 tokens > 200000 maximum\"},\"request_id\":\"req_011CZffvpsvU8hmvz8yaLqSG\"}\n at generate (/$bunfs/root/src/entrypoints/cli.js:11:51417)\n at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:5435)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-02T21:41:44.639Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"prompt is too long: 210445 tokens > 200000 maximum\"},\"request_id\":\"req_011CZffw8hUVLNFcAB3XCZmD\"}\n at generate (/$bunfs/root/src/entrypoints/cli.js:11:51417)\n at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:5435)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-02T21:41:48.519Z"},{"error":"Error: Request was aborted.\n at sN$ (/$bunfs/root/src/entrypoints/cli.js:1239:17137)\n at next (native:1:11)\n at qh7 (/$bunfs/root/src/entrypoints/cli.js:7749:9018)\n at next (native:1:11)\n at fh7 (/$bunfs/root/src/entrypoints/cli.js:7754:10842)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-02T21:59:54.418Z"},{"error":"Error: ensureToolResultPairing: repaired missing tool_result blocks (54 -> 55 messages). Message structure: [0] user; [1] assistant(id=msg_01FoHJJnEZzdxuYPDMJYSDVN, tool_uses=[toolu_01Y8uXAUoZXtohYM4iSFwD6b,toolu_01RWsJn6fNvmDxfcasUDVzsD]); [2] user(tool_results=[toolu_01Y8uXAUoZXtohYM4iSFwD6b,toolu_01RWsJn6fNvmDxfcasUDVzsD]); [3] assistant(id=msg_01TLdEfFjdTKAsAtvNSFcZM9, tool_uses=[toolu_01YNGWtH34gNLHvmrUBjvVLg,toolu_014RpVVbBoELdqwcnvi6dvet,toolu_01DNi8WT1v2nCaKxsvqB8h1M]); [4] user(tool_results=[toolu_01YNGWtH34gNLHvmrUBjvVLg,toolu_014RpVVbBoELdqwcnvi6dvet,toolu_01DNi8WT1v2nCaKxsvqB8h1M]); [5] assistant(id=msg_01958pCpYMsF2tHe2gXuGoJ8, tool_uses=[toolu_01MeNTV5TqDpr7gnnZK7o1LR,toolu_01DRuzq6DQtPCbHSiY47zCxM]); [6] user(tool_results=[toolu_01MeNTV5TqDpr7gnnZK7o1LR,toolu_01DRuzq6DQtPCbHSiY47zCxM]); [7] assistant(id=msg_01881ffwF96Atmt32wANfB9Z, tool_uses=[toolu_01X6pbBWeACPjaE3UHWFZMYe,toolu_01W484NWP2nui7JfjxB7LtF2,toolu_0192LxAmoA1CFmqMJuwteocW]); [8] user(tool_results=[toolu_01X6pbBWeACPjaE3UHWFZMYe,toolu_01W484NWP2nui7JfjxB7LtF2,toolu_0192LxAmoA1CFmqMJuwteocW]); [9] assistant(id=msg_01XpLJKEVDDk5TFnXFNGootz, tool_uses=[toolu_01BR1RfGfy8cViu8STfaE87r]); [10] user(tool_results=[toolu_01BR1RfGfy8cViu8STfaE87r]); [11] assistant(id=msg_01WwRhWSookA5UCE3Q1W1JF6, tool_uses=[toolu_014ZSRWdoe6m7cMW8QWag8y7]); [12] user(tool_results=[toolu_014ZSRWdoe6m7cMW8QWag8y7]); [13] assistant(id=msg_01F2CGFq2QqKxm11EXhLQoGR, tool_uses=[toolu_01KXGpV3WcG7uG5s7NKf4xKn]); [14] user(tool_results=[toolu_01KXGpV3WcG7uG5s7NKf4xKn]); [15] assistant(id=msg_011aiEj4nh7sQJXhfhsceWvW, tool_uses=[toolu_01Cx2XA9ydoL9CQ4WQmu6ZZS]); [16] user(tool_results=[toolu_01Cx2XA9ydoL9CQ4WQmu6ZZS]); [17] assistant(id=msg_015sUfE579XynuypUf9gRaxP, tool_uses=[toolu_01UJmmQrMdEqFuRVR9jJrXid,toolu_01HYr27KvqVsNEkh9Jrqz74r]); [18] user(tool_results=[toolu_01UJmmQrMdEqFuRVR9jJrXid,toolu_01HYr27KvqVsNEkh9Jrqz74r]); [19] assistant(id=msg_01NaNFihgvv6d1bHcmxcjuBG, tool_uses=[toolu_01WSVKToF3cRqW7qRE5SNw48]); [20] user(tool_results=[toolu_01WSVKToF3cRqW7qRE5SNw48]); [21] assistant(id=msg_01ETSrmqAUCfTSn1dszRQkJa, tool_uses=[toolu_0111M15UAgt2AfAFJVbBRsUa]); [22] user(tool_results=[toolu_0111M15UAgt2AfAFJVbBRsUa]); [23] assistant(id=msg_015Yp2ewJNCWDKodiBRUrLNM, tool_uses=[toolu_01QNRkSVsak5bcsU2tn2MZyx]); [24] user(tool_results=[toolu_01QNRkSVsak5bcsU2tn2MZyx]); [25] assistant(id=msg_01R4RLkSJYMZmeh6kXa7dufX, tool_uses=[toolu_01JWQJCA6RHc8WwcDgwNMWqV]); [26] user(tool_results=[toolu_01JWQJCA6RHc8WwcDgwNMWqV]); [27] assistant(id=msg_01PZ7uPSUYTCJkpPyR4g3Luq, tool_uses=[toolu_018rgHozRd6n35kuLScfcApq]); [28] user(tool_results=[toolu_018rgHozRd6n35kuLScfcApq]); [29] assistant(id=msg_01ATui31Wy9o9xRADFXVzr84, tool_uses=[toolu_01T1HyJS9H1zAx1H4D25qWxj]); [30] user(tool_results=[toolu_01T1HyJS9H1zAx1H4D25qWxj]); [31] assistant(id=msg_01VkpjtfRGQJeok4mMbPdVCg, tool_uses=[toolu_01YXRXpUqekEz3jxunpMLNM7]); [32] user(tool_results=[toolu_01YXRXpUqekEz3jxunpMLNM7]); [33] assistant(id=msg_01E9ucHC2tSxAaMxJt3nfHcz, tool_uses=[toolu_01E4HAewSRhku93mjVcyVTwC]); [34] user(tool_results=[toolu_01E4HAewSRhku93mjVcyVTwC]); [35] assistant(id=msg_01XyYZu392i2caJTydg9dheE, tool_uses=[toolu_011nBkoSC3zUXjaRUoHWBvVe,toolu_0111veT3Tm1qePVZF3zyxk15]); [36] user(tool_results=[toolu_011nBkoSC3zUXjaRUoHWBvVe,toolu_0111veT3Tm1qePVZF3zyxk15]); [37] assistant(id=msg_01PQh9qrQ7oKbatb6nUfcFzj, tool_uses=[toolu_013QXaowSTqCAU8k6WgvyENt,toolu_01LubM7RbvTbWSFYt3KBJmgy,toolu_01CVug…
Note: Content was truncated.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗