Repository navigation
Conversation
Adds a catalogue of statusline fields (src/fields.ts) and a statusline.fields block in the config. Each existing field (location, PR tags, context gauge, model, mute icon, plan link, other worktrees, sub-agents, start-up animation) can now be switched off. All default to on, so nothing changes for existing users, and an older config without the block keeps everything on. New commands: - tricorder fields describe: explains each field and shows if it is on. - tricorder fields set <ids|all>: chooses which fields are shown. Adds a test setup (npm test: esbuild bundles the tests, node --test runs them) and runs it in CI. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… test builds No new flags from the ts-patterns checker: named constants instead of bare numbers, no raw loops, no nested ternary, .length coerced instead of compared with zero, regexes explained with examples. Upstream's own existing flags are untouched. npm test now deletes build/test first, so compiled tests left over from another branch cannot run by mistake. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The catalogue (and so `fields describe`, the README and the config) now goes mute icon, location, PR tags, context, model, plan link, then the worktrees line, the sub-agents line and the start-up animation. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
`tricorder detect` reports whether the account is a subscription or pay per use, read from the account's own .claude.json (the one in CLAUDE_CONFIG_DIR, else ~/.claude.json). Fields now say which account types they apply to, `fields describe` lists only the ones that apply, and `statusline.mode` can force the type (auto, subscription, payg). /tricorder:setup uses that to explain each field that applies, then asks which to show (multi-select, "Enable all" first, options in the order the statusline draws them) and saves the choice. - `tricorder fields questions` builds the exact questions in code (unique text per question, 2 to 4 options each, at most 4 questions per call), so the command passes them through unchanged. A trial run had failed once when the command assembled them by hand. - `tricorder fields preview` draws the statusline for a made-up session with the chosen fields, using the real statusline code in a throwaway home folder, so every field that is on can be seen. A trial run showed only 4 of 9 fields because a session-less preview has no PRs, plan, worktrees or sub-agents. The command's Bash access is limited to the plugin's own binary. setup.sh points to the command when it finishes. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A yellow * after the branch name (my-repo(main*), or 🌳 fix-login* in a worktree) when the folder has edited, staged or new files that are not committed. Nothing is shown outside a git repository. It is a new optional field, "dirty", on by default like the others, so it appears in /tricorder:setup and can be switched off. git is only asked when the field is on. The preview builds a small real repository with one new file, so the mark shows there too. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
On a subscription account Claude Code sends how much of the 5-hour and 7-day limits is used and when each window ends. Two new optional fields, usage5h and usage7d, show it as "5h 🐕 37% · 7d 🐢 12%". The animal is the pace: % of the limit used minus % of the window gone, in percentage points. 🐢 Chill (green) more than 10 under, 🐕 On track (blue) within 10, 🐎 Watch out (orange) up to 20 over, 🦅 Hot (red) beyond, and 🐉 Over (magenta) when the limit is used up. The margin (default 10) and the minimum share of the window before a pace is shown (default 3%) are settings under statusline.pace. The bands live in src/pace.ts as pure functions, with hand-checkable tests: half the window gone and 55% / 65% / 75% / 30% used gives On track / Watch out / Hot / Chill. The two fields apply to subscription accounts only, so pay-per-use users are not offered them in /tricorder:setup. The preview feeds made-up limits so both appear. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Before, the first 3% of a 5-hour or 7-day window showed only the percent, because a pace that early is noise. It now shows a grey sloth, so the reader can tell "too early to tell" from "no data". A limit that is used up still shows the dragon, even early. With no reset time from Claude Code the percent still shows alone. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The comments and the README said the default margin of 10 points follows the default of Claude's own Pacing Sensitivity screen. That could not be checked, so the text now says only that 10 is the default and can be changed in the config. No behaviour changes. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This was referenced Nov 6, 2026
npm test passed a folder to `node --test`; Node 24 (the CI runner) reads that as one missing file. List the compiled test files instead. Also address review: coerce empty checks (!others.length, filter(Boolean)) and explain each type cast. Rebuilt plugin/bin/tricorder to match. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…from a table buildFields() is now the only place that casts to Record<FieldId, boolean>, so defaultFields, setFields and the config merge need no casts of their own. `fields <name>` looks the name up in a table (own keys only, so "toString" is not a sub-command) instead of an if-chain. Coerce an empty check, mark the test-only `as never`, make the config's field table read-only. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…type Merges feature/optional-fields (test script for Node 24, coerced checks, buildFields, sub-command table) and then applies the review of this PR: - account types, modes and detected types are derived from one declaration (SUBSCRIPTION / PAYG / UNKNOWN / AUTO), not retyped as strings - `fields describe|questions <type>` reports an unknown type instead of silently using the detected one - every fields sub-command is in the dispatch table - JSON fields are read with one checked helper (readField), not casts - drop the unused FieldInfo.line; preview fails loudly without a script path - tests: name a constant for the call count, mark `as never` Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Merges feature/account-detect-setup. Then: git status output and the folder path are checked with Boolean() instead of comparing to "", and the new "dirty" field drops the removed `line` property. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…_PER_S Merges feature/dirty-flag, then: - PaceBand is derived from PACE_STYLES (one place to add a band) - MS_PER_S and the inverse of elapsedPct (resetsAtS) live in pace.ts, with a hand-checked test; preview, statusline and tests stop redefining them - the pace config merge reads user JSON with the checked readField helper - the "too early" percent in the legend is read from the default, not retyped - tests: the band names are checked against the source with `satisfies` Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Brief
On a subscription account, the status line now shows how much of the 5-hour and 7-day usage limits you have used. Each figure carries an animal that says if you use the limit faster or slower than an even pace over its window. The pace is the share of the limit used minus the share of the window that has passed. The animal and colour show the pace, from a turtle for well under it to a dragon for a used-up limit. Two settings tune it, and pay-per-use accounts are not offered these fields.
Change map
Flow 1: Input 1 -> The status line shows the limits with a pace animal
%%{init: {"theme":"base","flowchart":{"curve":"step","nodeSpacing":28,"rankSpacing":48,"diagramPadding":40},"themeVariables":{"darkMode":true,"background":"#0d1117","fontFamily":"Inter, Helvetica, Arial","fontSize":"13px","dropShadow":"none","primaryColor":"#14181e","primaryTextColor":"#e6edf3","primaryBorderColor":"#383d43","nodeTextColor":"#e6edf3","textColor":"#e6edf3","mainBkg":"#14181e","nodeBorder":"#383d43","lineColor":"#3d444d","clusterBkg":"#0d1117","clusterBorder":"#383d43","titleColor":"#9198a1","edgeLabelBackground":"#0d1117"}}}%% graph LR subgraph IN["Input"] I1(["Input 1"]) end subgraph FN["Functions"] F1["renderStatusline"]:::context F2["line1"]:::modified F3["usageSegment"]:::added F4["elapsedPct"]:::added F5["limitBand"]:::added F6["bandForDeviation"]:::added end subgraph OUT["Output"] O1["Output 1"] end I1 --> F1 F1 --> F2 F2 ==> F3 F3 ==> F4 F3 ==> F5 F5 ==> F6 F1 --> O1 F6 ~~~ O1 classDef default fill:#14181e,stroke:#383d43,stroke-width:0.75px,color:#e6edf3,font-weight:500 classDef added fill:#12221d,stroke:#3fb950,stroke-width:1px,color:#e6edf3,font-weight:500 classDef modified fill:#211f18,stroke:#d29922,stroke-width:1px,color:#e6edf3,font-weight:500 classDef removed fill:#24171c,stroke:#f85149,stroke-width:1px,stroke-dasharray:4 4,color:#e6edf3,font-weight:500 classDef context fill:#14181e,stroke:#383d43,stroke-width:0.75px,color:#9198a1,font-weight:500 classDef risk fill:#14181e,stroke:#f85149,stroke-width:2px,color:#e6edf3,font-weight:500 classDef riskadded fill:#12221d,stroke:#f85149,stroke-width:2px,color:#e6edf3,font-weight:500 classDef zone fill:#0d1117,stroke:#383d43,stroke-width:1px,color:#9198a1,font-weight:600,font-size:12px class IN,FN,OUT zone linkStyle 0,1,6 stroke:#3d444d,stroke-width:1px linkStyle 2,3,4,5 stroke:#3d444d,stroke-width:2pxLegend: 🟩 added · 🟧 modified · ⬜ unchanged context
tricorder statuslinerate_limits: forfive_hourandseven_day, aused_percentageand aresets_attime in epoch seconds.5h 🐕 37% · 7d 🐢 12%. The percent has the colour of the band.Flow 2: Input 2 -> The preview shows the limits
%%{init: {"theme":"base","flowchart":{"curve":"step","nodeSpacing":28,"rankSpacing":48,"diagramPadding":40},"themeVariables":{"darkMode":true,"background":"#0d1117","fontFamily":"Inter, Helvetica, Arial","fontSize":"13px","dropShadow":"none","primaryColor":"#14181e","primaryTextColor":"#e6edf3","primaryBorderColor":"#383d43","nodeTextColor":"#e6edf3","textColor":"#e6edf3","mainBkg":"#14181e","nodeBorder":"#383d43","lineColor":"#3d444d","clusterBkg":"#0d1117","clusterBorder":"#383d43","titleColor":"#9198a1","edgeLabelBackground":"#0d1117"}}}%% graph LR subgraph IN["Input"] I2(["Input 2"]) end subgraph FN["Functions"] F1["previewFields"]:::context F2["renderPreviewSession"]:::modified F3["resetsAt"]:::added F4["renderStatusline"]:::context end subgraph OUT["Output"] O2["Output 2"] end I2 --> F1 F1 --> F2 F2 ==> F3 F2 --> F4 F1 --> O2 F3 ~~~ O2 classDef default fill:#14181e,stroke:#383d43,stroke-width:0.75px,color:#e6edf3,font-weight:500 classDef added fill:#12221d,stroke:#3fb950,stroke-width:1px,color:#e6edf3,font-weight:500 classDef modified fill:#211f18,stroke:#d29922,stroke-width:1px,color:#e6edf3,font-weight:500 classDef removed fill:#24171c,stroke:#f85149,stroke-width:1px,stroke-dasharray:4 4,color:#e6edf3,font-weight:500 classDef context fill:#14181e,stroke:#383d43,stroke-width:0.75px,color:#9198a1,font-weight:500 classDef risk fill:#14181e,stroke:#f85149,stroke-width:2px,color:#e6edf3,font-weight:500 classDef riskadded fill:#12221d,stroke:#f85149,stroke-width:2px,color:#e6edf3,font-weight:500 classDef zone fill:#0d1117,stroke:#383d43,stroke-width:1px,color:#9198a1,font-weight:600,font-size:12px class IN,FN,OUT zone linkStyle 0,1,3,4 stroke:#3d444d,stroke-width:1px linkStyle 2 stroke:#3d444d,stroke-width:2pxLegend: 🟩 added · 🟧 modified · ⬜ unchanged context
tricorder fields previewReview guide
Size: 12 files changed, 4 of them tests (33%), 41% of the changed lines are tests
The pace bands, with the default margin of 10 points. The pace is the share of the limit used minus the share of the window gone.
Example: a 5-hour window with 2.5 hours gone is 50% gone. With 55% used the pace is +5 (On track). With 65% it is +15 (Watch out). With 75% it is +25 (Hot). With 30% it is -20 (Chill).
What changed:
renderStatusline: Unchanged. It is the entry point.line1: Changed. After the model, it adds the 5h and 7d segments when their fields are on.usageSegment: New. It draws the label, the animal and the percent in the band colour. Without a usable pace it draws the label and the percent. Without a number from Claude Code it draws nothing.elapsedPct: New. From the reset time, it gives the share of the window that has passed.limitBand: New. A limit used up (100% or more) is Over at any time. An unknown window gives no pace. Under the minimum share the sloth shows. Otherwise the pace decides.bandForDeviation: New. It maps the pace to a band. A value on an edge takes the calmer band: exactly +10 is On track, and exactly +20 is Watch out.previewFields: Unchanged.renderPreviewSession: Changed. It adds made-up limits to the payload.resetsAt: New. It turns "this share of the window has passed" into a reset time. A 5-hour window that is 50% gone ends in 2.5 hours.renderStatusline: See Flow 1.mergePace: New. It keeps valid pace settings: a margin above 0, and a minimum share from 0 up to 100. Anything else keeps the default.PACE_STYLES: New. The name, colour and animal of each band.usage5handusage7d. They apply to subscription accounts only, so setup does not offer them to pay-per-use accounts.statusline.pacein~/.claude/tricorder/config.json.Read these first
src/pace.ts:1src/statusline.ts:166rate_limits.five_hourandseven_day, each withused_percentageandresets_atin epoch seconds.src/config.ts:100src/fields.ts:111appliesTo: pay-per-use accounts must not see them.src/preview.ts:28Review order: Start at
limitBandin the pace file, then follow Flow 1 up tousageSegment.Other changed files (7) · tests: 4 · docs: 2 · generated: 1
README.mdplugin/README.mdplugin/bin/tricordertest/cli.test.tstest/fields.test.tstest/pace.test.tstest/usage.test.ts