claude-code - 💡(How to fix) Fix [Bug] Excessive API token consumption during Claude Code sessions (12% in 49 sec - Max 5x plan) [2 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#56441Fetched 2026-05-06 06:27:57
View on GitHub
Comments
2
Participants
3
Timeline
8
Reactions
2
Author
Timeline (top)
labeled ×3commented ×2cross-referenced ×1renamed ×1

Error Message

[{"error":"Error: ensureToolResultPairing: repaired missing tool_result blocks (537 -> 537 messages). Message structure: [0] user; [1] assistant(id=msg_011EaFwwJoNMJT4dG1d93yA4, tool_uses=[toolu_01A5Dxb3CNzwApUcpwPoSY2C,toolu_017RJMTiwduPsNQbcXxjQ2sp,toolu_01TmR5zhZsddHqhtQoif5yPK]); [2] user(tool_results=[toolu_01A5Dxb3CNzwApUcpwPoSY2C,toolu_017RJMTiwduPsNQbcXxjQ2sp,toolu_01TmR5zhZsddHqhtQoif5yPK]); [3] assistant(id=msg_0143yZhpa9pwXcXt13yrz2fc, tool_uses=[toolu_01Pk3JRKN1yuufaB4L3JvP9W,toolu_011jkL66eUWLBW5YT7r5xeRx,toolu_01DYKJMHJLTSgcD93gKSAFTW]); [4] user(tool_results=[toolu_01Pk3JRKN1yuufaB4L3JvP9W,toolu_011jkL66eUWLBW5YT7r5xeRx,toolu_01DYKJMHJLTSgcD93gKSAFTW]); [5] assistant(id=msg_017MwQ9rdcncQiU6bARGbgmp, tool_uses=[toolu_01STgCfAjvo43PW3tBwU6Y7A,toolu_01XQwknFanA6MZUFaxiAoWpW,toolu_01GLZZkcChzMXW4EcXstzcX6,toolu_01Vo3HoVKciwCR5KFhHwrHrZ]); [6] user(tool_results=[toolu_01STgCfAjvo43PW3tBwU6Y7A,toolu_01XQwknFanA6MZUFaxiAoWpW,toolu_01GLZZkcChzMXW4EcXstzcX6,toolu_01Vo3HoVKciwCR5KFhHwrHrZ]); [7] assistant(id=msg_01BCMEvguUCQQ2DLpuxdBUpM, tool_uses=[toolu_01Ju11YGZsiU2uSPAF5NXM6e]); [8] user(tool_results=[toolu_01Ju11YGZsiU2uSPAF5NXM6e]); [9] assistant(id=msg_01TNr37GCmGFSXZdtCx2aHkc, tool_uses=[toolu_018Usje4gaFz9QtYei1Y7Pbo,toolu_017itcNHtHSEFxQWKCumQkCS,toolu_01FY96VcgTfGGAdRtHbGxDVq,toolu_01Rwx3ztEiDfA3YhFJRvdgGb,toolu_01YTxVbxr1sz3FKuhyPMY8Vh]); [10] user(tool_results=[toolu_018Usje4gaFz9QtYei1Y7Pbo,toolu_017itcNHtHSEFxQWKCumQkCS,toolu_01FY96VcgTfGGAdRtHbGxDVq,toolu_01Rwx3ztEiDfA3YhFJRvdgGb,toolu_01YTxVbxr1sz3FKuhyPMY8Vh]); [11] assistant(id=msg_013iZ6ocxZgETPeHPZJzrrZ5, tool_uses=[toolu_01FaifHHtvkPfDzn91zq8mWG,toolu_01Go7NPxSHXh3EH7JBanTsWm,toolu_01Mjq1hHnHXwvBKo1BiiZf2p,toolu_01WZpjFVchRv1RXEqJy3oojt,toolu_013yAPmCbXQeEC7y7Q2B4TJf]); [12] user(tool_results=[toolu_01FaifHHtvkPfDzn91zq8mWG,toolu_01Go7NPxSHXh3EH7JBanTsWm,toolu_01Mjq1hHnHXwvBKo1BiiZf2p,toolu_01WZpjFVchRv1RXEqJy3oojt,toolu_013yAPmCbXQeEC7y7Q2B4TJf]); [13] assistant(id=msg_01U6fRqoub7aqrG2mZRV9BwL, tool_uses=[toolu_01D2eq4vAULSFeBrvLZosEsf,toolu_01UTmZYs3dGLvQfcpwMD52Qz,toolu_015KsaiXgJBjFYEJYsJkMThW,toolu_014f29q1TJ8MJ7r4mTuF7mXA]); [14] user(tool_results=[toolu_01D2eq4vAULSFeBrvLZosEsf,toolu_01UTmZYs3dGLvQfcpwMD52Qz,toolu_015KsaiXgJBjFYEJYsJkMThW,toolu_014f29q1TJ8MJ7r4mTuF7mXA]); [15] assistant(id=msg_01R2sgbZCXXfZpEN9ZyphAHt, tool_uses=[toolu_01BwZDoxXNPijzZmLy4eu3Tt]); [16] user(tool_results=[toolu_01BwZDoxXNPijzZmLy4eu3Tt]); [17] assistant(id=msg_01LcdFt7cisHdB3GqP8XoZLn, tool_uses=[toolu_01G4mhDUW3FpUm7s5rPaNwUz,toolu_017B1wN8B1T15YLW5aUoprgL,toolu_012SLDvBz8Xdg4b1LXxFvbHN]); [18] user(tool_results=[toolu_01G4mhDUW3FpUm7s5rPaNwUz,toolu_017B1wN8B1T15YLW5aUoprgL,toolu_012SLDvBz8Xdg4b1LXxFvbHN]); [19] assistant(id=msg_011YSJSAUtX4uFsFHbjrooUH, tool_uses=[toolu_01WWmCGyVgeZgwKkfKjGFL7N,toolu_015ms8mTUCKSYwCzJKaWbPPJ,toolu_01A1ghiUcUK41R8x9er7Jwcs,toolu_01NG1ttH2f3cdmgmxVmKcznE,toolu_018j3RnXvM9XtA4TBVmTT87p,toolu_012qXqepoAE29whH6VrzCW5e]); [20] user(tool_results=[toolu_01WWmCGyVgeZgwKkfKjGFL7N,toolu_015ms8mTUCKSYwCzJKaWbPPJ,toolu_01A1ghiUcUK41R8x9er7Jwcs,toolu_01NG1ttH2f3cdmgmxVmKcznE,toolu_018j3RnXvM9XtA4TBVmTT87p,toolu_012qXqepoAE29whH6VrzCW5e]); [21] assistant(id=msg_01FvNnoVQc98yUr8Tch7W8Pc, tool_uses=[toolu_01FdksrKt27smGLCffnGXL3n,toolu_012Z8MFdrJyzLGo3A5CXjChM,toolu_01B6axu5SdDBYybWYG4jjp9U,toolu_01UtsCbXTfDrtzzkxqsY8imP]); [22] user(tool_results=[toolu_01FdksrKt27smGLCffnGXL3n,toolu_012Z8MFdrJyzLGo3A5CXjChM,toolu_01B6axu5SdDBYybWYG4jjp9U,toolu_01UtsCbXTfDrtzzkxqsY8imP]); [23] assistant(id=msg_016ND3ECafoWkQB5kdV2kd7g, tool_uses=[toolu_01BfkRoBYB63MkuU1wKnHP1x,toolu_01GsEQ576ieJhiL5CLyTiKQS,toolu_01Sm9ygQDZGKvApxyTx7mX3z,toolu_01UyVqSbdBeaLND9iVFGJNLt]); [24] user(tool_results=[toolu_01BfkRoBYB63MkuU1wKnHP1x,toolu_01GsEQ576ieJhiL5CLyTiKQS,toolu_01Sm9ygQDZGKvApxyTx7mX3z,toolu_01UyVqSbdBeaLND9iVFGJNLt]); [25] assistant(id=msg_01AfnTodQ7WnrRoLnEWivpvP, tool_uses=[toolu_01V9WeWfxHYGUYPeDLZG7LyL]); [26] user(tool_results=[toolu_01V9WeWfxHYGUYPeDLZG7LyL]); [27] assistant(id=msg_01N4mowF1DPHhofyGehwiZmd, tool_uses=[toolu_01TNfkR59VLRnL152UXmGiXo,toolu_01YV1PAhiSphzXrwFWJr8dCF,toolu_01E8Af7pwHmeEFYeEKAEoVTo,toolu_01X9dGLVLFaQ369WLiJvUbtZ]); [28] user(tool_results=[toolu_01TNfkR59VLRnL152UXmGiXo,toolu_01YV1PAhiSphzXrwFWJr8dCF,toolu_01E8Af7pwHmeEFYeEKAEoVTo,toolu_01X9dGLVLFaQ369WLiJvUbtZ]); [29] assistant(id=msg_018m3C898Xjf3es3FSoKYa8Q, tool_uses=[toolu_01UbpfSi1iane3KYbEaL9zvu,toolu_0162pnoDFVHMRpiKniPfKPRm,toolu_019rTSL8DpfrLAxT7LHWnCrL]); [30] user(tool_results=[toolu_01UbpfSi1iane3KYbEaL9zvu,toolu_0162pnoDFVHMRpiKniPfKPRm,toolu_019rTSL8DpfrLAxT7LHWnCrL]); [31] assistant(id=msg_01UFMUmYyz2efouEta8FcFzK, tool_uses=[toolu_01HWLCfe9tdmGtEXPt6Rdnqy,toolu_01BdU5FY4yBGe1cnD14JBQvr]); [32] user(tool_results=[toolu_01HWLCfe9tdmGtEXPt6Rdnqy,toolu_01BdU5FY4yBGe1cnD14JBQvr]); [33] assistant(id=msg_01MP2VVhtReR5nZthgu8vcvB, tool_uses=[toolu_01XQbZXxsZ1CBtRLwstfUhGy,toolu_016ohN6feimTh1YRAm7zCFVm,toolu_01P8bAQqto6GWyvoymsBnTKU,toolu_01YMijpozAZfzqQw3j7m6yb9,toolu_012xt4vJPQufpD5TSQzdNDJp]); [34] user(tool_results=[toolu_01XQbZXxsZ1CBtRLwstfUhGy,toolu_016ohN6feimTh1YRAm7zCFVm,toolu_01P8bAQqto6GWyvoymsBnTKU,toolu_01YMijpozAZfzqQw3j7m6yb9,toolu_012xt4vJPQufpD5TSQzdNDJp]); [35] assistant(id=msg_01Sp3AbetL5CpzYagoqKAS4F, tool_uses=[toolu_019snzWMQWvxxYCPu3AvAVDq,toolu_01F9yvGKF1f7E4CFfs4ekRcW]); […

Code Example

[{"error":"Error: ensureToolResultPairing: repaired missing tool_result blocks (537 -> 537 messages). Message structure: [0] user; [1] assistant(id=msg_011EaFwwJoNMJT4dG1d93yA4, tool_uses=[toolu_01A5Dxb3CNzwApUcpwPoSY2C,toolu_017RJMTiwduPsNQbcXxjQ2sp,toolu_01TmR5zhZsddHqhtQoif5yPK]); [2] user(tool_results=[toolu_01A5Dxb3CNzwApUcpwPoSY2C,toolu_017RJMTiwduPsNQbcXxjQ2sp,toolu_01TmR5zhZsddHqhtQoif5yPK]); [3] assistant(id=msg_0143yZhpa9pwXcXt13yrz2fc, tool_uses=[toolu_01Pk3JRKN1yuufaB4L3JvP9W,toolu_011jkL66eUWLBW5YT7r5xeRx,toolu_01DYKJMHJLTSgcD93gKSAFTW]); [4] user(tool_results=[toolu_01Pk3JRKN1yuufaB4L3JvP9W,toolu_011jkL66eUWLBW5YT7r5xeRx,toolu_01DYKJMHJLTSgcD93gKSAFTW]); [5] assistant(id=msg_017MwQ9rdcncQiU6bARGbgmp, tool_uses=[toolu_01STgCfAjvo43PW3tBwU6Y7A,toolu_01XQwknFanA6MZUFaxiAoWpW,toolu_01GLZZkcChzMXW4EcXstzcX6,toolu_01Vo3HoVKciwCR5KFhHwrHrZ]); [6] user(tool_results=[toolu_01STgCfAjvo43PW3tBwU6Y7A,toolu_01XQwknFanA6MZUFaxiAoWpW,toolu_01GLZZkcChzMXW4EcXstzcX6,toolu_01Vo3HoVKciwCR5KFhHwrHrZ]); [7] assistant(id=msg_01BCMEvguUCQQ2DLpuxdBUpM, tool_uses=[toolu_01Ju11YGZsiU2uSPAF5NXM6e]); [8] user(tool_results=[toolu_01Ju11YGZsiU2uSPAF5NXM6e]); [9] assistant(id=msg_01TNr37GCmGFSXZdtCx2aHkc, tool_uses=[toolu_018Usje4gaFz9QtYei1Y7Pbo,toolu_017itcNHtHSEFxQWKCumQkCS,toolu_01FY96VcgTfGGAdRtHbGxDVq,toolu_01Rwx3ztEiDfA3YhFJRvdgGb,toolu_01YTxVbxr1sz3FKuhyPMY8Vh]); [10] user(tool_results=[toolu_018Usje4gaFz9QtYei1Y7Pbo,toolu_017itcNHtHSEFxQWKCumQkCS,toolu_01FY96VcgTfGGAdRtHbGxDVq,toolu_01Rwx3ztEiDfA3YhFJRvdgGb,toolu_01YTxVbxr1sz3FKuhyPMY8Vh]); [11] assistant(id=msg_013iZ6ocxZgETPeHPZJzrrZ5, tool_uses=[toolu_01FaifHHtvkPfDzn91zq8mWG,toolu_01Go7NPxSHXh3EH7JBanTsWm,toolu_01Mjq1hHnHXwvBKo1BiiZf2p,toolu_01WZpjFVchRv1RXEqJy3oojt,toolu_013yAPmCbXQeEC7y7Q2B4TJf]); [12] user(tool_results=[toolu_01FaifHHtvkPfDzn91zq8mWG,toolu_01Go7NPxSHXh3EH7JBanTsWm,toolu_01Mjq1hHnHXwvBKo1BiiZf2p,toolu_01WZpjFVchRv1RXEqJy3oojt,toolu_013yAPmCbXQeEC7y7Q2B4TJf]); [13] assistant(id=msg_01U6fRqoub7aqrG2mZRV9BwL, tool_uses=[toolu_01D2eq4vAULSFeBrvLZosEsf,toolu_01UTmZYs3dGLvQfcpwMD52Qz,toolu_015KsaiXgJBjFYEJYsJkMThW,toolu_014f29q1TJ8MJ7r4mTuF7mXA]); [14] user(tool_results=[toolu_01D2eq4vAULSFeBrvLZosEsf,toolu_01UTmZYs3dGLvQfcpwMD52Qz,toolu_015KsaiXgJBjFYEJYsJkMThW,toolu_014f29q1TJ8MJ7r4mTuF7mXA]); [15] assistant(id=msg_01R2sgbZCXXfZpEN9ZyphAHt, tool_uses=[toolu_01BwZDoxXNPijzZmLy4eu3Tt]); [16] user(tool_results=[toolu_01BwZDoxXNPijzZmLy4eu3Tt]); [17] assistant(id=msg_01LcdFt7cisHdB3GqP8XoZLn, tool_uses=[toolu_01G4mhDUW3FpUm7s5rPaNwUz,toolu_017B1wN8B1T15YLW5aUoprgL,toolu_012SLDvBz8Xdg4b1LXxFvbHN]); [18] user(tool_results=[toolu_01G4mhDUW3FpUm7s5rPaNwUz,toolu_017B1wN8B1T15YLW5aUoprgL,toolu_012SLDvBz8Xdg4b1LXxFvbHN]); [19] assistant(id=msg_011YSJSAUtX4uFsFHbjrooUH, tool_uses=[toolu_01WWmCGyVgeZgwKkfKjGFL7N,toolu_015ms8mTUCKSYwCzJKaWbPPJ,toolu_01A1ghiUcUK41R8x9er7Jwcs,toolu_01NG1ttH2f3cdmgmxVmKcznE,toolu_018j3RnXvM9XtA4TBVmTT87p,toolu_012qXqepoAE29whH6VrzCW5e]); [20] user(tool_results=[toolu_01WWmCGyVgeZgwKkfKjGFL7N,toolu_015ms8mTUCKSYwCzJKaWbPPJ,toolu_01A1ghiUcUK41R8x9er7Jwcs,toolu_01NG1ttH2f3cdmgmxVmKcznE,toolu_018j3RnXvM9XtA4TBVmTT87p,toolu_012qXqepoAE29whH6VrzCW5e]); [21] assistant(id=msg_01FvNnoVQc98yUr8Tch7W8Pc, tool_uses=[toolu_01FdksrKt27smGLCffnGXL3n,toolu_012Z8MFdrJyzLGo3A5CXjChM,toolu_01B6axu5SdDBYybWYG4jjp9U,toolu_01UtsCbXTfDrtzzkxqsY8imP]); [22] user(tool_results=[toolu_01FdksrKt27smGLCffnGXL3n,toolu_012Z8MFdrJyzLGo3A5CXjChM,toolu_01B6axu5SdDBYybWYG4jjp9U,toolu_01UtsCbXTfDrtzzkxqsY8imP]); [23] assistant(id=msg_016ND3ECafoWkQB5kdV2kd7g, tool_uses=[toolu_01BfkRoBYB63MkuU1wKnHP1x,toolu_01GsEQ576ieJhiL5CLyTiKQS,toolu_01Sm9ygQDZGKvApxyTx7mX3z,toolu_01UyVqSbdBeaLND9iVFGJNLt]); [24] user(tool_results=[toolu_01BfkRoBYB63MkuU1wKnHP1x,toolu_01GsEQ576ieJhiL5CLyTiKQS,toolu_01Sm9ygQDZGKvApxyTx7mX3z,toolu_01UyVqSbdBeaLND9iVFGJNLt]); [25] assistant(id=msg_01AfnTodQ7WnrRoLnEWivpvP, tool_uses=[toolu_01V9WeWfxHYGUYPeDLZG7LyL]); [26] user(tool_results=[toolu_01V9WeWfxHYGUYPeDLZG7LyL]); [27] assistant(id=msg_01N4mowF1DPHhofyGehwiZmd, tool_uses=[toolu_01TNfkR59VLRnL152UXmGiXo,toolu_01YV1PAhiSphzXrwFWJr8dCF,toolu_01E8Af7pwHmeEFYeEKAEoVTo,toolu_01X9dGLVLFaQ369WLiJvUbtZ]); [28] user(tool_results=[toolu_01TNfkR59VLRnL152UXmGiXo,toolu_01YV1PAhiSphzXrwFWJr8dCF,toolu_01E8Af7pwHmeEFYeEKAEoVTo,toolu_01X9dGLVLFaQ369WLiJvUbtZ]); [29] assistant(id=msg_018m3C898Xjf3es3FSoKYa8Q, tool_uses=[toolu_01UbpfSi1iane3KYbEaL9zvu,toolu_0162pnoDFVHMRpiKniPfKPRm,toolu_019rTSL8DpfrLAxT7LHWnCrL]); [30] user(tool_results=[toolu_01UbpfSi1iane3KYbEaL9zvu,toolu_0162pnoDFVHMRpiKniPfKPRm,toolu_019rTSL8DpfrLAxT7LHWnCrL]); [31] assistant(id=msg_01UFMUmYyz2efouEta8FcFzK, tool_uses=[toolu_01HWLCfe9tdmGtEXPt6Rdnqy,toolu_01BdU5FY4yBGe1cnD14JBQvr]); [32] user(tool_results=[toolu_01HWLCfe9tdmGtEXPt6Rdnqy,toolu_01BdU5FY4yBGe1cnD14JBQvr]); [33] assistant(id=msg_01MP2VVhtReR5nZthgu8vcvB, tool_uses=[toolu_01XQbZXxsZ1CBtRLwstfUhGy,toolu_016ohN6feimTh1YRAm7zCFVm,toolu_01P8bAQqto6GWyvoymsBnTKU,toolu_01YMijpozAZfzqQw3j7m6yb9,toolu_012xt4vJPQufpD5TSQzdNDJp]); [34] user(tool_results=[toolu_01XQbZXxsZ1CBtRLwstfUhGy,toolu_016ohN6feimTh1YRAm7zCFVm,toolu_01P8bAQqto6GWyvoymsBnTKU,toolu_01YMijpozAZfzqQw3j7m6yb9,toolu_012xt4vJPQufpD5TSQzdNDJp]); [35] assistant(id=msg_01Sp3AbetL5CpzYagoqKAS4F, tool_uses=[toolu_019snzWMQWvxxYCPu3AvAVDq,toolu_01F9yvGKF1f7E4CFfs4ekRcW]); [
RAW_BUFFERClick to expand / collapse

Bug Description High usage reported.

  1. I've hit my hourly limit during a Claude Code session.
  2. I've waited for the reset time.
  3. I've typed "continue"
  4. The operation lasted 49 seconds.
  5. Web browser shows i've already used 12% from my new 5 hour window. I'm on Pro Max 5x plan. 12% in 49 seconds? I've observed similar behaviours in my sessions.

Environment Info

  • Platform: darwin
  • Terminal: Apple_Terminal
  • Version: 2.1.118
  • Feedback ID: 2e03a82d-102b-4d22-a748-9b0bc71862a1

Errors

[{"error":"Error: ensureToolResultPairing: repaired missing tool_result blocks (537 -> 537 messages). Message structure: [0] user; [1] assistant(id=msg_011EaFwwJoNMJT4dG1d93yA4, tool_uses=[toolu_01A5Dxb3CNzwApUcpwPoSY2C,toolu_017RJMTiwduPsNQbcXxjQ2sp,toolu_01TmR5zhZsddHqhtQoif5yPK]); [2] user(tool_results=[toolu_01A5Dxb3CNzwApUcpwPoSY2C,toolu_017RJMTiwduPsNQbcXxjQ2sp,toolu_01TmR5zhZsddHqhtQoif5yPK]); [3] assistant(id=msg_0143yZhpa9pwXcXt13yrz2fc, tool_uses=[toolu_01Pk3JRKN1yuufaB4L3JvP9W,toolu_011jkL66eUWLBW5YT7r5xeRx,toolu_01DYKJMHJLTSgcD93gKSAFTW]); [4] user(tool_results=[toolu_01Pk3JRKN1yuufaB4L3JvP9W,toolu_011jkL66eUWLBW5YT7r5xeRx,toolu_01DYKJMHJLTSgcD93gKSAFTW]); [5] assistant(id=msg_017MwQ9rdcncQiU6bARGbgmp, tool_uses=[toolu_01STgCfAjvo43PW3tBwU6Y7A,toolu_01XQwknFanA6MZUFaxiAoWpW,toolu_01GLZZkcChzMXW4EcXstzcX6,toolu_01Vo3HoVKciwCR5KFhHwrHrZ]); [6] user(tool_results=[toolu_01STgCfAjvo43PW3tBwU6Y7A,toolu_01XQwknFanA6MZUFaxiAoWpW,toolu_01GLZZkcChzMXW4EcXstzcX6,toolu_01Vo3HoVKciwCR5KFhHwrHrZ]); [7] assistant(id=msg_01BCMEvguUCQQ2DLpuxdBUpM, tool_uses=[toolu_01Ju11YGZsiU2uSPAF5NXM6e]); [8] user(tool_results=[toolu_01Ju11YGZsiU2uSPAF5NXM6e]); [9] assistant(id=msg_01TNr37GCmGFSXZdtCx2aHkc, tool_uses=[toolu_018Usje4gaFz9QtYei1Y7Pbo,toolu_017itcNHtHSEFxQWKCumQkCS,toolu_01FY96VcgTfGGAdRtHbGxDVq,toolu_01Rwx3ztEiDfA3YhFJRvdgGb,toolu_01YTxVbxr1sz3FKuhyPMY8Vh]); [10] user(tool_results=[toolu_018Usje4gaFz9QtYei1Y7Pbo,toolu_017itcNHtHSEFxQWKCumQkCS,toolu_01FY96VcgTfGGAdRtHbGxDVq,toolu_01Rwx3ztEiDfA3YhFJRvdgGb,toolu_01YTxVbxr1sz3FKuhyPMY8Vh]); [11] assistant(id=msg_013iZ6ocxZgETPeHPZJzrrZ5, tool_uses=[toolu_01FaifHHtvkPfDzn91zq8mWG,toolu_01Go7NPxSHXh3EH7JBanTsWm,toolu_01Mjq1hHnHXwvBKo1BiiZf2p,toolu_01WZpjFVchRv1RXEqJy3oojt,toolu_013yAPmCbXQeEC7y7Q2B4TJf]); [12] user(tool_results=[toolu_01FaifHHtvkPfDzn91zq8mWG,toolu_01Go7NPxSHXh3EH7JBanTsWm,toolu_01Mjq1hHnHXwvBKo1BiiZf2p,toolu_01WZpjFVchRv1RXEqJy3oojt,toolu_013yAPmCbXQeEC7y7Q2B4TJf]); [13] assistant(id=msg_01U6fRqoub7aqrG2mZRV9BwL, tool_uses=[toolu_01D2eq4vAULSFeBrvLZosEsf,toolu_01UTmZYs3dGLvQfcpwMD52Qz,toolu_015KsaiXgJBjFYEJYsJkMThW,toolu_014f29q1TJ8MJ7r4mTuF7mXA]); [14] user(tool_results=[toolu_01D2eq4vAULSFeBrvLZosEsf,toolu_01UTmZYs3dGLvQfcpwMD52Qz,toolu_015KsaiXgJBjFYEJYsJkMThW,toolu_014f29q1TJ8MJ7r4mTuF7mXA]); [15] assistant(id=msg_01R2sgbZCXXfZpEN9ZyphAHt, tool_uses=[toolu_01BwZDoxXNPijzZmLy4eu3Tt]); [16] user(tool_results=[toolu_01BwZDoxXNPijzZmLy4eu3Tt]); [17] assistant(id=msg_01LcdFt7cisHdB3GqP8XoZLn, tool_uses=[toolu_01G4mhDUW3FpUm7s5rPaNwUz,toolu_017B1wN8B1T15YLW5aUoprgL,toolu_012SLDvBz8Xdg4b1LXxFvbHN]); [18] user(tool_results=[toolu_01G4mhDUW3FpUm7s5rPaNwUz,toolu_017B1wN8B1T15YLW5aUoprgL,toolu_012SLDvBz8Xdg4b1LXxFvbHN]); [19] assistant(id=msg_011YSJSAUtX4uFsFHbjrooUH, tool_uses=[toolu_01WWmCGyVgeZgwKkfKjGFL7N,toolu_015ms8mTUCKSYwCzJKaWbPPJ,toolu_01A1ghiUcUK41R8x9er7Jwcs,toolu_01NG1ttH2f3cdmgmxVmKcznE,toolu_018j3RnXvM9XtA4TBVmTT87p,toolu_012qXqepoAE29whH6VrzCW5e]); [20] user(tool_results=[toolu_01WWmCGyVgeZgwKkfKjGFL7N,toolu_015ms8mTUCKSYwCzJKaWbPPJ,toolu_01A1ghiUcUK41R8x9er7Jwcs,toolu_01NG1ttH2f3cdmgmxVmKcznE,toolu_018j3RnXvM9XtA4TBVmTT87p,toolu_012qXqepoAE29whH6VrzCW5e]); [21] assistant(id=msg_01FvNnoVQc98yUr8Tch7W8Pc, tool_uses=[toolu_01FdksrKt27smGLCffnGXL3n,toolu_012Z8MFdrJyzLGo3A5CXjChM,toolu_01B6axu5SdDBYybWYG4jjp9U,toolu_01UtsCbXTfDrtzzkxqsY8imP]); [22] user(tool_results=[toolu_01FdksrKt27smGLCffnGXL3n,toolu_012Z8MFdrJyzLGo3A5CXjChM,toolu_01B6axu5SdDBYybWYG4jjp9U,toolu_01UtsCbXTfDrtzzkxqsY8imP]); [23] assistant(id=msg_016ND3ECafoWkQB5kdV2kd7g, tool_uses=[toolu_01BfkRoBYB63MkuU1wKnHP1x,toolu_01GsEQ576ieJhiL5CLyTiKQS,toolu_01Sm9ygQDZGKvApxyTx7mX3z,toolu_01UyVqSbdBeaLND9iVFGJNLt]); [24] user(tool_results=[toolu_01BfkRoBYB63MkuU1wKnHP1x,toolu_01GsEQ576ieJhiL5CLyTiKQS,toolu_01Sm9ygQDZGKvApxyTx7mX3z,toolu_01UyVqSbdBeaLND9iVFGJNLt]); [25] assistant(id=msg_01AfnTodQ7WnrRoLnEWivpvP, tool_uses=[toolu_01V9WeWfxHYGUYPeDLZG7LyL]); [26] user(tool_results=[toolu_01V9WeWfxHYGUYPeDLZG7LyL]); [27] assistant(id=msg_01N4mowF1DPHhofyGehwiZmd, tool_uses=[toolu_01TNfkR59VLRnL152UXmGiXo,toolu_01YV1PAhiSphzXrwFWJr8dCF,toolu_01E8Af7pwHmeEFYeEKAEoVTo,toolu_01X9dGLVLFaQ369WLiJvUbtZ]); [28] user(tool_results=[toolu_01TNfkR59VLRnL152UXmGiXo,toolu_01YV1PAhiSphzXrwFWJr8dCF,toolu_01E8Af7pwHmeEFYeEKAEoVTo,toolu_01X9dGLVLFaQ369WLiJvUbtZ]); [29] assistant(id=msg_018m3C898Xjf3es3FSoKYa8Q, tool_uses=[toolu_01UbpfSi1iane3KYbEaL9zvu,toolu_0162pnoDFVHMRpiKniPfKPRm,toolu_019rTSL8DpfrLAxT7LHWnCrL]); [30] user(tool_results=[toolu_01UbpfSi1iane3KYbEaL9zvu,toolu_0162pnoDFVHMRpiKniPfKPRm,toolu_019rTSL8DpfrLAxT7LHWnCrL]); [31] assistant(id=msg_01UFMUmYyz2efouEta8FcFzK, tool_uses=[toolu_01HWLCfe9tdmGtEXPt6Rdnqy,toolu_01BdU5FY4yBGe1cnD14JBQvr]); [32] user(tool_results=[toolu_01HWLCfe9tdmGtEXPt6Rdnqy,toolu_01BdU5FY4yBGe1cnD14JBQvr]); [33] assistant(id=msg_01MP2VVhtReR5nZthgu8vcvB, tool_uses=[toolu_01XQbZXxsZ1CBtRLwstfUhGy,toolu_016ohN6feimTh1YRAm7zCFVm,toolu_01P8bAQqto6GWyvoymsBnTKU,toolu_01YMijpozAZfzqQw3j7m6yb9,toolu_012xt4vJPQufpD5TSQzdNDJp]); [34] user(tool_results=[toolu_01XQbZXxsZ1CBtRLwstfUhGy,toolu_016ohN6feimTh1YRAm7zCFVm,toolu_01P8bAQqto6GWyvoymsBnTKU,toolu_01YMijpozAZfzqQw3j7m6yb9,toolu_012xt4vJPQufpD5TSQzdNDJp]); [35] assistant(id=msg_01Sp3AbetL5CpzYagoqKAS4F, tool_uses=[toolu_019snzWMQWvxxYCPu3AvAVDq,toolu_01F9yvGKF1f7E4CFfs4ekRcW]); [

Note: Content was truncated.

extent analysis

TL;DR

The issue is likely related to incorrect usage tracking, causing the system to report high usage despite the user waiting for the reset time and only using the service for a short duration.

Guidance

  • Review the usage tracking mechanism to ensure it accurately accounts for time spent in sessions.
  • Investigate the ensureToolResultPairing error and its impact on usage tracking.
  • Check for any discrepancies in the tool_uses and tool_results data structures that might contribute to incorrect usage calculations.
  • Verify that the system correctly resets usage counters after the specified time period.

Example

No specific code example can be provided without more context, but reviewing the ensureToolResultPairing function and the logic behind tool_uses and tool_results might help identify the issue.

Notes

The provided error log suggests a complex interaction between the user and the assistant, with multiple tool_uses and tool_results exchanges. The root cause of the issue might be buried within this complexity, requiring a detailed analysis of the system's usage tracking and session management logic.

Recommendation

Apply a workaround by manually reviewing and adjusting usage tracking data for affected users until the root cause is identified and fixed, as the current system behavior is likely to cause incorrect usage reports and potential service disruptions.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [Bug] Excessive API token consumption during Claude Code sessions (12% in 49 sec - Max 5x plan) [2 comments, 3 participants]