DigestAI news desk

Cut through the AI noise.

Marketing & Small Business6 min read

Reduced Claude Code usage by analyzing logs

Steps I took to reduce my Claude Code usage after hitting limits early At the beginning of October, I started hitting my Claude Code limits earlier than usual. The first thing you want to do is look for ways to save. Things like shortening instruction files, changing models, or frequently starting new conversations.

1 source

Key points

  • Counted Claude Code usage by analyzing conversation logs
  • Reduced input and cache read costs to save on usage
  • Fixed length of conversations and what gets read every time

However, I decided to count what I was using by checking my own conversation logs.

Analyzing Conversation Logs

I counted four things: - Input - Cache write (saved content to read more cheaply next time) - Cache read (re-reading saved content) - Output Since these four have different costs, I weighted them based on the unit price ratios of the API. The remaining limit and usage rate should be checked via the official /usage display; this aggregation cannot accurately predict the remaining amount.

Steps to Reduce Usage

I fixed the length of conversations and what gets read every time: - Narrowed down the rules read every time to 7, and set the remaining 24 to be read only when touching related files. - Shortened the common instruction file from 393 lines to 207 lines. - Reduced the memory index from 24KB to 11KB. - Set the automatic conversation summarization point to 400,000 tokens of context. - Split browser operations into a lightweight, dedicated agent that doesn't read the instruction file (in testing, 6.5K tokens at startup).

Results After 40 Days

When I re-measured the context immediately after startup in the same folder and with the same model (Sonnet), it went from 132,263 tokens to 55,320 tokens.

Conclusion

After 40 days of following these steps, there were zero conversations exceeding 500,000 tokens. However, I still hit the additional usage limit during this period.

Full story from note.com · by ATOLLS by HIRAMATAU · via Search: ClaudeOpen source ↗
Topics · follow one to build your own front page

The headline, key points and digest above were generated by Digest AI's editorial model from the linked sources. Automated summaries can contain errors: the sources are the record. Spotted a mistake? Tell us. Published by Martin K., who runs Digest AI and handles corrections.

Comments

via GitHub Discussions

More in Marketing & Small Business

All →

Related stories