Repository navigation
feat: showCost toggle + context-window fill indicator in the status bar - #31
Merged
Carl723000 merged 3 commits intoJun 15, 2026
Conversation
Two new settings: - claudeCodeUsage.showCost (default true) — hide the status-bar cost item for users who only want the quota / context indicators; the dashboard still shows all cost figures. - claudeCodeUsage.showContext (default true) — a new status-bar item showing the current session's context-window fill as a percentage, like Claude Code's /context. Estimated from the session's latest log record (input + cache read + cache write tokens) against the model's window size (200K, or 1M for "[1m]" long-context variants). Amber at 80%, red at 95% (same thresholds as the quota item); hidden after 5h of inactivity (same recency rule as the current-session figure), with the recency check re-run on idle ticks so a stale percentage never lingers. Also syncs package-lock.json's version field with package.json (2.0.2). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
# Conflicts: # src/types.ts
- README (all 6 languages): document that the quota / cost / context status-bar items can each be hidden (usageLimitTracking / showCost / showContext = false). - context tooltip: add a concise cost-awareness reminder (/compact, /clear), localised in all 6 languages, above the existing estimation note.
Carl723000
added a commit
that referenced
this pull request
Jun 26, 2026
Adds a relay-execution plan (for Opus 4.8 + workflow) to the V2.1 spec after the implemented Phases 0-5, plus the on-disk log probe findings so the next session doesn't re-derive them: - effort/ultracode is NOT recorded in logs; the wf_ dir is the only real "dynamic-workflow engaged" signal - attributionSkill / attributionPlugin are first-class fields on usage lines (authoritative, replaces the <command-name> heuristic) - why native-Claude runs "look missing" from Workflows: Opus/Fable orchestration stays in the main session; only cheap haiku sub-agents (or none) write agent files Continuation phases: 6 integrate onto current main (incl. PR #31 context indicator) - 7 authoritative attribution + workflow-mode honesty + main-session orchestration cost - 8 real-total calibration (daily/weekly) - 9 advice UX + Prompt Optimizer (the headline feature) - 10 README showcase - 11 node:test coverage. Also gitignore docs/claude-advice-*.md (local reports, never committed).
Carl723000
added a commit
that referenced
this pull request
Jun 26, 2026
Catches the v2.1 workflow-attribution branch up to current main (~25 commits: v2.0.3 work, PR-attribution merges, node:test framework, CI, macOS-keychain credentials, PR #31 status-bar context-window indicator). Conflict resolutions: - src/claudeApiClient.ts: keep feature's httpClient-based transport AND main's macOS-keychain credential read; import only execFileSync (curl/fetch now live in httpClient.ts, so spawn is no longer needed here). - src/dataLoader.ts: take feature's v2.1 version wholesale, then port main's two new context methods (getCurrentContextInfo, contextWindowFor) + the ContextWindowInfo import on top. - CHANGELOG.md: fold main's [Unreleased] items (context indicator, showCost) into the [2.1.0] block. Verified: clean compile; node:test green (2/2); merged loader still yields 13 workflow runs, the attribution panel, thinking share, AND the new context-window info. version stays 2.1.0.
Carl723000
added a commit
that referenced
this pull request
Jun 26, 2026
Subscription backend dropped (this version): a re-test confirms Anthropic 403s
"Request not allowed" for calling /v1/messages with the Claude Code OAuth token
(it only succeeds by routing around the TLS-fingerprint gate via curl) — too
fragile/inappropriate for a public extension. Advice + Optimizer are API-only;
backend hardcoded to 'api'; advice.backend / advice.subscriptionModel settings
removed. The subscription transport stays in advisor.ts, dormant, to re-enable
if direct calls become permitted.
Context-window indicator:
- Honesty: contextWindowFor() now returns { tokens, estimated }; unrecognised /
proxied models flag estimated=true and the % shows a "~" prefix instead of a
confident figure. New setting contextWindowOverride (0=auto) lets users on
custom/proxied models pin their real window — fixes the #31-class wrong %.
- Correctness: getCurrentContextInfo() now prefers main-thread records (excludes
_agentId/_workflowId) so a running sub-agent/workflow no longer hijacks the
"current context" with its own window.
- Startup visibility: staleness guard widened 5h→24h so opening a window in the
morning still shows the last session's context instead of blanking it.
- Default OFF + flagged experimental in Settings (the tooltip can only show the
input-side total, not /context's category breakdown, which are CC internals
not on disk — so it's approximate by nature; opt in if useful).
- Tooltip decluttered: dropped the verbose estimate/compaction notes (the
explanation moved to the setting help), added a quota-style progress bar, and
renamed the misleading "Free space"/"剩余空间" to "Context left"/"上下文余量".
Header: removed the apple-style auto-refresh toggle (auto-refresh is managed in
the ⚙ Settings tab now); the manual ↻ refresh button still appears top-right
when auto-refresh is paused. Two shortcut buttons remain — ✨ AI advice (jumps to
the Content tab) and ⚙ Settings (jumps to the Settings tab). The gear icon now
lives on the header button; the tab label drops it (cleaner, conventional).
Compile clean; 11/11 node:test green.
Co-Authored-By: Claude <noreply@anthropic.com>
Carl723000
added a commit
that referenced
this pull request
Jun 26, 2026
- Upstream moved to an organization: all upstream PR/issue URLs now point to ClaudeCodeUsage/ClaudeCodeUsage (numbers preserved on transfer) across the README, the translated READMEs, CONTRIBUTING and the CHANGELOG. The original author (@jack21) stays credited by name. - Credits refreshed beyond the 2.0 baseline: added @ScherbakovAl (PR #31, the original context indicator + showCost) and @nickearnshaw's PR #24 (quota rollover), plus the closed issues (#25 test seed, #31 context detection). - Reconciled the docs with the final 2.1 behaviour: AI advice/Optimizer are API-only (the keyless subscription backend is documented as prototyped-but- not-shipped), the context indicator and Optimizer are experimental/off, the Optimizer returns plain text, settings live in the dashboard, and the header was trimmed. Added CHANGELOG Changed/Fixed bullets for the header rework, plain-text optimizer, redesigned cards and the workspace-switch quota fix. Docs only. Compile clean; 11/11 node:test green. Co-Authored-By: Claude <noreply@anthropic.com>
Carl723000
added a commit
that referenced
this pull request
Jun 26, 2026
Integrate the leftover upstream PR #38 (@wheelbarrel00) that never shipped with the unreleased v2.0.3. It adds `showOpusWeekly` (opt-in, default off): when on, the quota item appends `opus:NN%` after the 5h / weekly figures, so heavy Opus users get an at-a-glance weekly Opus signal. This branch diverged from upstream at PR #31, so #38 wasn't present; cherry-pick would conflict with the status-bar changes made here (setVisibility signature, cost/tokens metric, all-off entry icon). Re-applied faithfully instead, adapted to the dashboard-managed settings: - settings.ts: showOpusWeekly in the Status-bar group (state-stored, default off). - statusBar.ts: 5th setVisibility param; updateQuota appends opus:NN% and keeps the item visible when only the Opus window is present. - extension.ts / types.ts: thread the setting through. - README / README-zh-CN / CHANGELOG: documented and credited @wheelbarrel00 (#38). Compile clean; 11/11 node:test green. Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: wheelbarrel00 <103789673+wheelbarrel00@users.noreply.github.com>
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.
Two new settings:
Also syncs package-lock.json's version field with package.json (2.0.2).
Summary
Linked issues
Type of change
How was this tested?
Checklist
npm run compileis cleanI18nwith all six languages filledCHANGELOG.mdupdated (user-visible changes)README.mdupdated if behaviour/settings changed