Why is a simple edit eating 100,000+ tokens? Let’s talk about this

@Mohamed_Khafagy

As you screenshot shows there was:

  • Input: short, a sentence.
  • Output: changes to files and chat output
  • Cache Write: context needed by AI e.g. file reads etc. cached to avoid re-processing
  • Cache Read: context read from cache at (~10% of input token price and ~3% of cache write)

107k tokens is not the issue at all. As your screenshot clearly shows it would have cost $0.13 at API cost.

Suggestions for further optimization:

  • Plan task beforehand and give more details to Agent to process in one go with less back and forth changes as it can handle several changes per edit.

@kristinaOA the total tokens are not counted equally as input/output/cache read and cache write have different cost per AI providers pricing. High cache read may signify there was a long thread and per cache write there were several good sized reads from files or any other tool.

[Edit: added “or any other tool.” & PS]

PS. Could you start a new chat with privacy disabled and post here the request ID. This would help Cursor Team to check inside what has been sent and see if there are any issues.