* fix(usage-api): do not return socket from createConnection in proxy tunnel agent
Node.js _http_agent.js calls `oncreate(null, newSocket)` immediately
when createConnection returns a truthy value, which causes the HTTP
request to be written directly to the raw proxy socket before the
CONNECT handshake completes. Proxies like Clash reject this with
400 Bad Request, surfacing as persistent 403/network errors in the
Usage display.
Return undefined instead so the socket is only delivered via the
async callback after the CONNECT tunnel + TLS handshake succeeds.
Fixes proxy CONNECT failures with Clash and similar HTTP proxies.
* test(usage-api): cover proxy CONNECT request ordering
---------
Co-authored-by: Jarrod Watts <jarrod@cubelabs.xyz>
* feat: add showProject config to hide project name from statusline
Adds `display.showProject` (default: true) to control whether the
project path is displayed. When set to false, the project name and
its associated git info are hidden from both compact and expanded
layouts.
* fix: keep git status visible when project name is hidden
---------
Co-authored-by: Jarrod Watts <jarrod@cubelabs.xyz>
* fix: consolidate CLAUDE_CONFIG_DIR handling and keychain fallback
* chore: remove dist artifacts from this PR
* chore: bump version to 0.0.8
* docs: expand 0.0.8 changelog from post-0.0.7 commits
* fix: display reset time in days when >= 24 hours
The 7-day usage window reset countdown shows raw hours (e.g., "151h 59m")
which is hard to read. Format as days + hours when >= 24h (e.g., "6d 7h").
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* test: cover day-based usage reset formatting
---------
Co-authored-by: KwCCCC <KwCCCC@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Jarrod Watts <jarrod@cubelabs.xyz>
* feat: show session name in statusline
Reads the session slug (auto-generated) and custom title (set via
/rename) from the transcript JSONL and displays it in dim text after
the project/git info on both expanded and compact layouts.
Custom title takes priority over auto-generated slug when both exist.
* test: add session name coverage and harden integration spawn
---------
Co-authored-by: Jarrod Watts <jarrod@cubelabs.xyz>
* fix: prevent double-counting CLAUDE.md when cwd is home directory
When the working directory is the user's home directory, the project
scope check for {cwd}/.claude/CLAUDE.md resolves to the same path as
the user scope check (~/.claude/CLAUDE.md), causing the HUD to display
"2 CLAUDE.md" instead of "1 CLAUDE.md". Skip the project scope
.claude/ checks when cwd equals the home directory.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: handle home cwd config counting edge cases
* fix: avoid home cwd double-counting for rules and settings
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Jarrod Watts <jarrod@cubelabs.xyz>
Add typeof guard to only run legacy string migration when layout is a
string. When layout is an object (written by third-party config editors),
extract nested lineLayout, showSeparators, and pathLevels to top level.
- Widen LegacyConfig type to accept Record<string, unknown>
- Export mergeConfig for direct testing of migration paths
- Add test cases for all migration scenarios
* feat: show API billing indicator in model badge
When ANTHROPIC_API_KEY is present in the environment, display
[Opus | API] in red instead of [Opus | Max]. This helps users
who manage both Max plan and API key access (e.g., work vs personal)
immediately see when they're running on API billing.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Bump marketplace version to 0.0.7
---------
Co-authored-by: Fielding Johnston <fielding@justfielding.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
New default: model+project on line 1, context+usage bars combined on line 2.
All optional features (tools, agents, todos) hidden by default with
setup onboarding step to enable them.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The Bash tool on Windows uses Git Bash as its interpreter, so `uname -s`
returns MINGW even when the user launched Claude Code from PowerShell.
This caused setup to generate bash commands that fail in PowerShell.
Fix: Instruct Claude to use the Platform value from its environment
context (darwin/linux/win32) instead of running uname. This correctly
identifies the user's actual platform regardless of the Bash tool's
environment.
- darwin → bash commands (macOS)
- linux → bash commands (all distros: Ubuntu, NixOS, Arch, etc.)
- win32 → PowerShell commands (works on PowerShell, cmd.exe, Git Bash)
Fixes#90
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
- Add `--extra-cmd` CLI flag to execute a user-specified command
- Command must return JSON with a `label` field, e.g., `{"label": "$1.23/day"}`
- Includes security hardening:
- sanitize() to strip terminal escape sequences (CSI, OSC, control chars, bidi)
- maxBuffer: 10KB limit to prevent memory issues
- Label truncation to 50 chars max
- Display extraLabel in session line when present
Co-authored-by: Johnny Wang <johnnywang1991@msn.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* feat: add usageBarEnabled config option for quota display style
Add configurable display style for usage limits:
- usageBarEnabled: true → visual bar (██░░ 25%)
- usageBarEnabled: false → text format (5h: 25%)
Changes:
- config.ts: Add usageBarEnabled option (default: true)
- colors.ts: Add quotaBar() and getQuotaColor() with blue color scheme
- usage.ts, session-line.ts: Conditional rendering based on config
Closes#84
* fix: add clamp guard to coloredBar for consistency
Apply the same safeWidth/safePercent guards from quotaBar to coloredBar
to prevent RangeError on malformed input values.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* chore: revert dist files to main
Remove build artifacts from PR diff. CI will rebuild dist/ after merge.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* test: add usageBarEnabled: false to baseContext
Ensures existing tests continue to check text format behavior.
The new bar format is opt-in via config.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Aster Kim <aster@spoonlabs.com>
Co-authored-by: Jarrod Watts <jarrod@cubelabs.xyz>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* fix: resolve symlinks in path comparison for auto-execute
The HUD fails to output when ~/.claude is a symlink (common on macOS
with iCloud). This happens because process.argv[1] contains the symlink
path while fileURLToPath resolves to the real path.
Use realpathSync to normalize both paths before comparison.
Fixes#86
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: add try/catch fallback for realpathSync
Wrap realpathSync calls in try/catch to handle edge cases where the path
doesn't exist, has permission issues, or has a broken symlink chain.
Falls back to raw path comparison on errors.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Jarrod Watts <jarrod@cubelabs.xyz>