Repository navigation
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
This security review couldn’t start because the paying account has exhausted its Codex allowance and has insufficient available credits. The payer can check their balance and add credits in the Codex usage dashboard, then try again. If you do not manage the paying account, contact this repository's admins. |
Elements can now list and resolve paths, write a file atomically into a state directory under the agent-shim home, and read the memory in use, all through the ports, so an element that needs the machine stays a function of its context and a test hands it an in-memory filesystem. Memory comes from vm_stat on macOS and /proc/meminfo on Linux, because os.freemem leaves reclaimable cache out of what is free and overstates the use.
…configuration counts Four elements, none in the default layout. The cost segment draws the client's own figure, or an estimate priced from the door's usage log with the prices `model price` stores when the client reports none. A routed session (a launch that selected a provider, or a Bedrock or Vertex model id) draws a cost only when cost.routed is set, and then prefers the door's record of each request over the client's figure, which is not what was billed. The daily cost segment keeps a per-day ledger in the statusline's state directory, counting a session from its first sighting and restarting at local midnight. The memory row is a bar of the memory in use, and the environment row counts CLAUDE.md files, rules, MCP servers and hook events, subject to environment.threshold. Boolean settings become a kind the key listing and `--statusline <setting>=<value>` understand.
Claude Code stamps every request with its own session id, which changes when a conversation is cleared inside one launch, unlike the launch's session id the record already carries. The door reads it from the request header into an optional clientSessionId on the usage record, so a consumer can tie requests to the client's per-conversation figures. A request without the header, or with it repeated, records none.
Compressed pages hold real memory, so leaving them out of the sum read lower than the operating system's own account of what cannot be handed on.
The day's ledger is one file for each conversation for each local day, summed on read, so statuslines drawing at the same moment can no longer overwrite one another's entries. A conversation that spans midnight starts the new day from the total it had on its last render, a conversation is bound to the source of its first figure (the client's or the door's estimate), and days older than the one before are removed through a new remove port. The door's estimate is now read for the conversation named by the client's session id, matched to the clientSessionId on each usage record, so clearing a conversation inside one launch no longer carries the earlier conversation's requests into the estimate or the daily total. A failing read of the model prices or the log now surfaces instead of being swallowed, and the routed-session predicate is no longer exported.
Mearman
force-pushed
the
feat/statusline-cost
branch
from
October 20, 2026 07:00
2d548f1 to
0602ba6
Compare
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.
Adds the cost and machine group of the claude-hud parity work to the built-in statusline: a
costand adailyCostheader segment and amemoryand anenvironmentrow. All four are named in the schema's lists and the registry but left out of the default layout, so the default output is unchanged.The cost segment draws the client's own
cost.total_cost_usdasCost. When the client reports none, it falls back to an estimate priced from the door's usage log with the per-model pricesagent-shim model pricealready stores (keyed<provider>/<model>, cache tokens at Anthropic's published ratios of the input price). There is no shipped price table, and a request whose model has no price makes the whole estimate absent rather than understated. A launch that selected a provider, or a Bedrock or Vertex model id, counts as routed: it draws nothing unlesscost.routedis set, and then the door's own record of each request is preferred over the client's figure, which is a lookup for a name it may not know. The log is read only when the layout lists a cost segment, from the UTC day the session began on.Today's spend is a ledger in a new
statuslinedirectory under the agent-shim home, written through a new port with an atomic rename. It stores each session's absolute total, so two statuslines overwriting each other cost nothing, counts a session from its first sighting, restarts at local midnight and drops sessions unseen for a day.The memory row reads vm_stat on macOS and /proc/meminfo on Linux through a port, because
os.freememleaves reclaimable cache out of what is free. The environment row counts CLAUDE.md files, rules, MCP servers and hook events from the pinned configuration directory (or the home directory's.claude) and the session's project, through list, stat and realpath ports with a link-cycle guard on the rules walk;environment.thresholdis claude-hud'senvironmentThreshold.cost.routedis the first boolean setting, so the key listing and--statusline <setting>=<value>gain a boolean kind. The parity map and document account for every key in the group, and the document records how the routed cost relates to the usage log.