3 comments

  • zzyyxx3322112 hours ago
    After consuming my whole usage window in a few minutes multiple times, I realised I needed a hook to do some checks for me and prompt me before submitting when cache had expired and content is too big, so that it can suggest me to &quot;compact then send&quot;. It can also prevent sub-agents from spawning when above 80% usage window. Control is handed over to the user.<p>The first I built, based on hooks (run for 75 days), the biggest burst fell from 365 agent spawned to 27, and requests over 500k tokens of context from 14.5% to 0.6%. Lockouts still went up, because lots of parallel main sessions use up the window too. The strength is that it counts agents across every session on the machine.<p>I built <a href="https:&#x2F;&#x2F;github.com&#x2F;rbartoli&#x2F;agent-usage-guard" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;rbartoli&#x2F;agent-usage-guard</a>, MIT-licensed, makes no network calls, needs Claude Code 2.1.287 or later.<p>I have also a post on this: <a href="https:&#x2F;&#x2F;rblab.com&#x2F;what-stops-claude-code-burning-your-usage-window&#x2F;" rel="nofollow">https:&#x2F;&#x2F;rblab.com&#x2F;what-stops-claude-code-burning-your-usage-...</a>
    • donfuzius1 hour ago
      interesting, I think that&#x27;s a needed lever of control that&#x27;s currently missing. Can you state against what plan you think the defaults make sense (pro &#x2F; max 5x &#x2F; max 20x)? A nice addition might be presets which are meaningful for each plan (i.e roughly scaled accordingly where it makes sense).
  • Robin_Message2 hours ago
    I was under the impression a compact resurrected the session anyway so it is not a good idea on a cold session. Is that true or is it actually cheaper?
    • randomblock11 hour ago
      Yes, it&#x27;s better to compact before it gets out of cache. I think new versions of Claude Code can do that automatically. It can be cheaper if you switch to Haiku or something
    • bhu82 hours ago
      You could use a dumber model (luna or haiku) for compact to get around this
      • kinduff1 hour ago
        I do this + caveman and my allowed usage lasts longer.
    • zzyyxx3322112 hours ago
      [dead]
  • RohaanXD1 hour ago
    [flagged]