You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Clarify missing Claude quota data outside the account usage card #700
When Heidrun has no Claude quota information, the interface should identify which figures are unavailable and where they are expected to come from. It should not make the status sound like no Claude usage occurred.
Keep the account usage card unchanged. Put any explanation of the missing quota status outside that card.
The attached image shows the context for this request.
Each coding agent has a command that returns the live account quota at any time. The figures come from the provider, so they are there even when the agent was not used for months. Each command spends no tokens. Tested on 19 October 2026, on macOS, with Codex 0.163.0, Claude Code 2.1.302, and the Antigravity command line agy.
Coding agent
Command
Time
Output
Codex
codex app-server, then the JSON-RPC requests initialize and account/rateLimits/read on standard input
JSON, but the figures are text in the field result, for example "Current session: 6% used · resets Oct 19 at 5:29am (Europe/Paris)"
Antigravity
agy -p "/usage" --output-format json
2.7 seconds
JSON: command.data.groups[].buckets[] with id, remaining_fraction, and reset_time (ISO 8601)
Codex: reuse of a running server
When a Codex server already runs, a program can ask it without starting a new process. On this computer, a managed Codex server (codex app-server --listen unix:// --managed-daemon) listens on the socket file ~/.codex/app-server-control/app-server-control.sock. The command codex app-server proxy connects to it. The socket speaks WebSocket, so the program sends a WebSocket handshake first. Plain JSON lines get no answer. With the handshake, the answer came in 0.5 seconds. When the socket file is missing, the program starts codex app-server for one question.
Warning: claude -p fills the chat history
Each run of claude -p "/usage" writes a chat session file in ~/.claude/projects/. A refresh every 5 minutes would add 288 empty chats each day to the Past chats sidebar section. This is not acceptable. The option --no-session-persistence of Claude Code should stop the file, but this is not tested.
Other points
The text of Claude Code has no year and uses the local time zone, and a new version of Claude Code can change the wording at any time.
agy -p "/usage" returned an empty conversation_id. It is not checked whether it writes a file in ~/.gemini/antigravity-cli/conversations.
Heidrun gets the quota of each coding agent with the commands of the previous comment.
Heidrun refreshes the figures every 5 minutes. A figure that is exact to the second is not needed.
In the section "Coding agents" of the Settings window, the option "Monitor account quota" covers every coding agent that is on. The separate option "Track Antigravity quota" goes away: there is no option for Claude or for Codex, so Antigravity must not be the only one with an option.
Heidrun shows the quota of each coding agent that is on in the status bar.
Review (not decided yet)
Chat history:claude -p "/usage" writes a chat session file each time. This must be solved before the plan is built. Test --no-session-persistence first.
Keep the status line scripts: the scripts claude-statusline.sh and antigravity-statusline.sh also send the context window usage of each pane, which the usage wheel in the pane header shows. Without them, the Claude and Antigravity panes lose that wheel. The commands replace only the quota. The script can be installed by "Monitor account quota" for Antigravity, as it is for Claude today, so the settings stay the same for every coding agent.
Claude Code output is text: Heidrun must read sentences such as "resets Oct 19 at 5:29am", with no year. A new version of Claude Code can break this.
Refresh at start: also refresh when Heidrun starts, so the figures are there at once.
How Heidrun gets the quota and the context window today
Claude Code
Heidrun copies claude-statusline.sh to ~/.config/heidrun/, and sets the option statusLine in ~/.claude/settings.json to run it. The code is in claude.rs. The option "Monitor account quota" installs it.
After each answer, Claude Code runs the script and gives it JSON on standard input: rate_limits.five_hour, rate_limits.seven_day, and context_window.used_percentage.
The script sends these figures to Herdr with herdr pane report-metadata, as the pane values hd_q5h, hd_q7d, and hd_ctx. Herdr sends an event, and Heidrun reads the values of the pane. There is no timer.
Heidrun keeps the newest quota figures in the local storage of the web page, so a restart starts from the last known figures.
No figures arrive before the first answer of a session, or when the script is not installed. The status bar then says "Claude quota: unspecified".
Antigravity
Heidrun copies antigravity-statusline.sh to ~/.config/heidrun/, and sets the option statusLine in ~/.gemini/antigravity-cli/settings.json. The code is in antigravity.rs. The separate option "Track Antigravity quota" installs it.
After each answer, Antigravity runs the script with quota and context_window on standard input. The script sends them to Herdr as hd_agy_* and hd_agy_ctx. Heidrun reads them in the same way as for Claude, and keeps the newest quota in the local storage.
Codex
Codex has no status line command, so there is no script. Codex writes its figures in its session log files, ~/.codex/sessions/YYYY/MM/DD/rollout-*.jsonl, in the token_count events: rate_limits.primary, rate_limits.secondary, and info.model_context_window.
Heidrun reads the end of the 12 newest log files every 10 seconds, with a timer. The code is in usage.rs. Herdr gives only the Codex session identifier of each pane, which Heidrun uses to find the context window of that pane.
Heidrun ignores a log file that has not changed in the last 8 days. When Codex was not used in the last 8 days, there are no figures, and the card says "No data yet". The figures are not kept after a restart.
The code that combines the three sources for the web page is in session.ts.
Activity
jeromeetienne commentedon Oct 19, 2026
Ways to get the quota on demand
Each coding agent has a command that returns the live account quota at any time. The figures come from the provider, so they are there even when the agent was not used for months. Each command spends no tokens. Tested on 19 October 2026, on macOS, with Codex 0.163.0, Claude Code 2.1.302, and the Antigravity command line
agy.codex app-server, then the JSON-RPC requestsinitializeandaccount/rateLimits/readon standard inputrateLimits.primary.usedPercent,windowDurationMins,resetsAt(Unix seconds),planTypeclaude -p "/usage" --output-format jsonresult, for example "Current session: 6% used · resets Oct 19 at 5:29am (Europe/Paris)"agy -p "/usage" --output-format jsoncommand.data.groups[].buckets[]withid,remaining_fraction, andreset_time(ISO 8601)Codex: reuse of a running server
When a Codex server already runs, a program can ask it without starting a new process. On this computer, a managed Codex server (
codex app-server --listen unix:// --managed-daemon) listens on the socket file~/.codex/app-server-control/app-server-control.sock. The commandcodex app-server proxyconnects to it. The socket speaks WebSocket, so the program sends a WebSocket handshake first. Plain JSON lines get no answer. With the handshake, the answer came in 0.5 seconds. When the socket file is missing, the program startscodex app-serverfor one question.Warning:
claude -pfills the chat historyEach run of
claude -p "/usage"writes a chat session file in~/.claude/projects/. A refresh every 5 minutes would add 288 empty chats each day to the Past chats sidebar section. This is not acceptable. The option--no-session-persistenceof Claude Code should stop the file, but this is not tested.Other points
agy -p "/usage"returned an emptyconversation_id. It is not checked whether it writes a file in~/.gemini/antigravity-cli/conversations.notifydo not receive the quota figures, so a Codex status line script is not possible. Sources: Codex configuration reference, Codex hooks guide.jeromeetienne commentedon Oct 19, 2026
Plan of the developer, and review
Plan
Review (not decided yet)
claude -p "/usage"writes a chat session file each time. This must be solved before the plan is built. Test--no-session-persistencefirst.jeromeetienne commentedon Oct 19, 2026
How Heidrun gets the quota and the context window today
Claude Code
~/.config/heidrun/, and sets the optionstatusLinein~/.claude/settings.jsonto run it. The code is in claude.rs. The option "Monitor account quota" installs it.rate_limits.five_hour,rate_limits.seven_day, andcontext_window.used_percentage.herdr pane report-metadata, as the pane valueshd_q5h,hd_q7d, andhd_ctx. Herdr sends an event, and Heidrun reads the values of the pane. There is no timer.Antigravity
~/.config/heidrun/, and sets the optionstatusLinein~/.gemini/antigravity-cli/settings.json. The code is in antigravity.rs. The separate option "Track Antigravity quota" installs it.quotaandcontext_windowon standard input. The script sends them to Herdr ashd_agy_*andhd_agy_ctx. Heidrun reads them in the same way as for Claude, and keeps the newest quota in the local storage.Codex
~/.codex/sessions/YYYY/MM/DD/rollout-*.jsonl, in thetoken_countevents:rate_limits.primary,rate_limits.secondary, andinfo.model_context_window.The code that combines the three sources for the web page is in session.ts.