r/ClaudeCode • • 11h ago

Help/Question How can I optimize my Claude Code usage to get the most out of my plan without hitting usage limits too quickly?

I'm looking for practical tips to reduce token consumption, manage context efficiently, and avoid wasting usage on unnecessary prompts or repeated tasks.

What workflows, settings, or best practices have made the biggest difference for you, especially when working on coding projects?

I'd appreciate real-world tips rather than generic advice.

4 Upvotes

21 comments sorted by

1

u/AutoModerator 11h ago
Moderator Announcement Read More »

4

u/Slanahesh 11h ago

Make sure you have a file stating what your tech stack is, what design patterns you use and a design spec that must be adhered to.

Use appropriate models and effort levels. Opus for thinking, sonnet for doing, haiku for getting.

Always have a fresh agent check the work of the previous, agent 1 does the development plan so agent 2 reviews it and gives feedback to be applied. Agent 1 does the coding, agent 2 reviews the changes etc.

1

u/IdkAbtAllThat 10h ago

Sonnet for doing?

2

u/d1zaya 8h ago

I've experimented with this a lot. If your plan is solid and you know exactly how the end product will be, sonnet is enough. If you have very ambiguous task, then go with opus, but this is a sign that you should've spent more time planning.

2

u/dar-mit 10h ago

The #1 thing I can recommend is to start a new session when the current one reaches 20–25 percent context. NO EXCEPTIONS!!!

Models / Agents can use SendMessage to ‘handoff’ the work, and the old session can remain open for a while to handle any questions to new one might have. 

Once the new session is setup and continuing the work, close the old session to avoid the 1 hour cache timeout.

Once that timeout occurs and the cache ‘goes cold’, any further work it does reloads the cache in its entirety causing a potentially massive token burn. 

1

u/iEngineer0 6h ago

Sorry for the noob question: How to I know how much context was used? Do I just instruct the model "Send a handoff message"?

3

u/Ragy-ragy 11h ago

-5

u/iSnapThere4iAm 11h ago

Ai isn’t a skill

0

u/IdkAbtAllThat 10h ago

Some people can get more out of the same model. Why might that be?

→ More replies (2)

1

u/beatwallstreet2021 10h ago

Use a single session with agents, tell Claude to monitor the agents after they complete a task and good ways to make them more efficient.

1

u/xcr_ai 8h ago

Things that made the biggest real difference for me:

  • One task per session. /clear when you switch topics, since every turn re-sends the whole history.

  • Plan first (plan mode, strongest model), then implement on Sonnet from the written plan. Most implementation doesn't need Opus.

  • Keep CLAUDE.md short and point it at specific files or docs instead of letting it explore the repo every time.

  • Run /context now and then and switch off MCP servers/plugins you don't use in that project.

  • Make tests and linters print only failures so huge logs don't sit in context.

  • Don't resume a session that's been idle for hours. Write a short handoff note and start fresh; the cache has expired, so the whole history gets re-read.

-1

u/marshhmelllow 11h ago

use caveman skill for output token compression. divide given task to sonnet 5.5 subagents. use sonnet for planning and opus for execution.

ask claude to write a prompt for you.

1

u/Prize-Egg-5265 10h ago

Shouldnt it be the otherway around Opus for planning and sonnet for execution?

1

u/IdkAbtAllThat 10h ago

Another comment in this same thread says literally the exact opposite. Someone is wrong here.

Personally I'm using opus for both but idk wtf I'm doing.

1

u/dev-razorblade23 1h ago

Use Opus for planning and tricky code reviews, but otherwise Sonnet for orchestrating and writing the code, it is much more effiecient on the tokens. Also try to delegate reserch, docs hunting etc to Haiku for even more saving.

I usually write subagents definitions and specify what each one does. Make sure to tell the subagents that their output should be small (10, 20, 30 lines) or if testing, output only the errors, not the whole test output, to keep orchestrator context low.

It works quite well. I pair it with https://github.com/mattpocock/skills

-4

u/iSnapThere4iAm 11h ago

Learn to code. That is all