Repository navigation
Claude plan limits: 5 hours and week - #20
Merged
Merged
Conversation
Claude Code only hands the limits to its status line, so the hooks install a status line relay that wraps the user's own and restores it on uninstall.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Port of upstream Louis-CFM#159, adapted to the Windows/Linux home card.
rate_limits.five_hour/seven_day: used % and reset time, Pro and Max) to its status line.coucou-hook --statuslinerelays just those limits to the app on a side thread and exits; nothing else from the status line input leaves the machine.statusLine. An existing command is kept hex-encoded in ours (--statusline --wrap <hex>), run throughsh -cwith the same input, and its output and exit code are passed through. Other fields (padding…) are untouched, reinstalling never wraps twice, and uninstalling puts the original command back. Same diff + backup + confirm flow as the hooks.StatusLinewithout a session or log line, keeps the latest limits inclaude-plan.json(rewritten only when a number moves or once a minute), and pushes them to the page.Claude 42%(the higher of the two windows) instead of today's tokens once limits are known; the tooltip readsClaude plan: 42% of 5 hours (resets 14:30), 18% of week (resets Mon 09:00), plus the token count. A window past its reset counts as 0.Test plan
cargo test -p coucou(status line wrap, rewrap, restore; limits parsing and validation)cargo test -p coucou-hook(only the limits are relayed; hex round trip)tsc --noEmit,npm run checkclaude-plan.jsonwritten