418 Commits

Author SHA1 Message Date
Jarrod Watts
24d6c50d00 test: cover Agent tool name in transcripts 2026-04-04 14:09:18 +11:00
Jarrod Watts
19e1542d9e Merge pull request #341 from rafdouglas/fix/readme-reload-plugins
README.md: added the instruction to /reload-plugins after installing claude-hud
2026-04-04 14:07:37 +11:00
Jarrod Watts
2afa93d4dd Merge pull request #365 from jarrodwatts/issue-348-usage-contract
docs: clarify official usage data contract
2026-04-04 14:06:52 +11:00
Jarrod Watts
dcb92d8218 docs: clarify official usage data contract 2026-04-04 14:05:56 +11:00
github-actions[bot]
e7d94b4307 build: compile dist/ [auto] 2026-04-04 03:00:35 +00:00
Jarrod Watts
b4a1f93f23 Merge pull request #364 from jarrodwatts/issue-351-safe-width-fallback
fix: keep HUD visible when terminal width is unavailable
2026-04-04 14:00:13 +11:00
Jarrod Watts
7ea5f331d9 fix: wrap HUD output when terminal width is unavailable 2026-04-04 13:59:08 +11:00
github-actions[bot]
d9b1a3daae build: compile dist/ [auto] 2026-04-04 02:52:13 +00:00
Jarrod Watts
5e5c950c3a Merge pull request #349 from xiaodream551-a11y/feat/i18n-chinese-support
feat: add Chinese (zh) language support
2026-04-04 13:51:54 +11:00
Jarrod Watts
f223562354 test: align reset countdown expectation for i18n 2026-04-04 13:51:04 +11:00
Jarrod Watts
6c863b2f02 Merge main into i18n branch and keep English default 2026-04-04 13:50:24 +11:00
Jarrod Watts
72c01d75af Merge pull request #363 from jarrodwatts/fix-gh-star-command-compat
docs: add gh star command fallback
2026-04-04 13:43:51 +11:00
Jarrod Watts
36bc0d8f20 docs: add gh star command fallback 2026-04-04 13:41:56 +11:00
Jarrod Watts
f7b71255b8 Merge pull request #362 from jarrodwatts/issue-355-windows-node-default
docs: prefer node over bun on windows
2026-04-04 13:36:09 +11:00
Jarrod Watts
a47c952b6b docs: prefer node over bun on windows 2026-04-04 13:35:21 +11:00
Jarrod Watts
5909886a48 Merge pull request #361 from jarrodwatts/issue-346-star-command
docs: shorten setup star command
2026-04-04 13:31:42 +11:00
Jarrod Watts
593be9398a docs: shorten setup star command 2026-04-04 13:31:03 +11:00
Jarrod Watts
f2445a490f Merge pull request #360 from jarrodwatts/issue-315-json-safety
docs: make setup JSON escaping explicit
2026-04-04 13:30:27 +11:00
Jarrod Watts
5cecc69e33 docs: make setup JSON escaping explicit 2026-04-04 13:29:50 +11:00
github-actions[bot]
98a2358e3e build: compile dist/ [auto] 2026-04-04 02:28:54 +00:00
Jarrod Watts
b851959be0 Merge pull request #359 from jarrodwatts/issue-353-auth-label
fix: stop guessing auth mode from env vars
2026-04-04 13:28:38 +11:00
Jarrod Watts
03c394825c fix: stop guessing auth mode from env vars 2026-04-04 13:28:03 +11:00
github-actions[bot]
3c4a2c1976 build: compile dist/ [auto] 2026-04-04 02:26:18 +00:00
Jarrod Watts
0786f4c50b Merge pull request #357 from kagura-agent/fix/preserve-taskid-map-across-todowrite
fix: preserve taskIdToIndex map across TodoWrite operations (#345)
2026-04-04 13:25:59 +11:00
Jarrod Watts
a30a7afd63 chore: drop generated dist artifacts 2026-04-04 13:25:45 +11:00
github-actions[bot]
16ce438825 build: compile dist/ [auto] 2026-04-04 02:24:24 +00:00
Jarrod Watts
2d8561a84f Merge pull request #354 from zelinewang/feat/compact-model-display-name
feat: add display.modelFormat and display.modelOverride config options
2026-04-04 13:24:10 +11:00
kagura-agent
9955880815 fix: preserve taskIdToIndex map across TodoWrite operations (#345)
When TodoWrite is called, the taskIdToIndex map was cleared and
rebuilt from scratch. However, TodoItem objects only contain content
and status fields — no taskId. This meant all taskId mappings from
prior TaskCreate calls were permanently lost, causing subsequent
TaskUpdate operations to silently fail.

Fix: Before clearing the map, build a reverse lookup of content →
taskIds from the existing state. After replacing latestTodos with the
new TodoWrite items, re-register taskId mappings for items whose
content matches a previously-known task. Stale mappings (for content
no longer present) are naturally dropped.

Adds two tests:
- TaskCreate → TodoWrite → TaskUpdate flow preserves taskId
- TodoWrite-only regression test (no TaskCreate involved)
2026-04-03 17:19:49 +08:00
Zane Wang
e6ed4aa1a6 test: add render tests for modelFormat and modelOverride
Cover both rendering paths (expanded + compact) to verify that:
- modelFormat compact/short correctly strips context suffix and prefix
- modelOverride completely replaces the model name in the badge
- modelOverride takes precedence over modelFormat
- loadConfig structural test validates new display fields
2026-04-03 06:49:40 +08:00
Zane Wang
ab4c564892 feat: add display.modelOverride for custom model display names
Users can now set a fully custom model name in their config:

  { "display": { "modelOverride": "zane's intelligent opus 4.6" } }

When set, the override completely replaces the auto-detected model
name (while preserving the provider qualifier like "| Bedrock").

Follows the same pattern as customLine: string type, max 80 chars,
empty string means disabled (falls through to modelFormat).
2026-04-03 06:42:25 +08:00
Zane Wang
5676041f19 feat: add configurable modelFormat option (full/compact/short)
Redesign from mandatory stripping to user-configurable display format.
Adds display.modelFormat with three levels:

  full:    Show raw display name as-is (default, backward-compatible)
  compact: Strip redundant context-window suffix
  short:   Strip context suffix AND "Claude " prefix

Examples with Bedrock model "Opus 4.6 (1M context)":
  full:    [Opus 4.6 (1M context) | Bedrock]
  compact: [Opus 4.6 | Bedrock]
  short:   [Opus 4.6 | Bedrock]

Examples with API model "Claude Sonnet 3.5 (200k context)":
  full:    [Claude Sonnet 3.5 (200k context)]
  compact: [Claude Sonnet 3.5]
  short:   [Sonnet 3.5]
2026-04-03 06:37:26 +08:00
Zane Wang
c12e514465 feat: strip redundant context-window suffix from model display names
Claude Code may include the context window size in display_name
(e.g. "Opus 4.6 (1M context)"), but the HUD already shows context
usage via the context bar — making the parenthetical redundant.

This adds stripContextSuffix() which removes any parenthetical
containing the word "context" from the display name. It handles
common variants like "(1M context)", "(200k context)",
"(with 1M context)", and "(extended context window)" while
preserving non-context parentheticals like "(beta)" or "(preview)".

Before: [Opus 4.6 (1M context) | Bedrock]
After:  [Opus 4.6 | Bedrock]
2026-04-03 06:25:24 +08:00
xiaodream
7895941b8b fix: address code review findings for i18n
- Fix detectLanguage() to follow POSIX priority: LC_ALL > LC_MESSAGES > LANG
- Fix Chinese format.resetsIn from broken wrap-around grammar to prefix form
- Fix loadConfig() to call mergeConfig({}) when no config file exists,
  ensuring detectLanguage() runs for auto-detection
- Add setLanguage('en') guard to render.test.js for locale-independent tests
- Add dedicated i18n test suite (tests/i18n.test.js) covering t(),
  detectLanguage(), and mergeConfig language handling

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 17:03:53 +08:00
xiaodream
c8d9e809ed feat: add Chinese (zh) language support (#334)
Add i18n infrastructure with automatic language detection from system
locale (LANG/LC_ALL/LC_MESSAGES) and manual override via config.json.
Translates all user-facing HUD labels, status messages, and format
strings. English remains the default.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 16:39:45 +08:00
rafd
10a34afb18 README.md: added the instruction to /reload-plugins after installing claude-hud 2026-03-30 19:00:16 +02:00
Krushnamegh Chakke
3790411344 Refactor agent rendering and status icon logic
MAX_RECENT_COMPLETED and MAX_AGENTS_SHOWN constants at the top
Dedup seen set in renderAgentsLine
getStatusIcon() extracted with failed case handled
Math.max(0, ...) guard in formatElapsed
Hour-aware branch at the bottom of formatElapsed
2026-03-29 09:57:15 +05:30
dependabot[bot]
2959f23456 chore(deps-dev): bump typescript from 5.9.3 to 6.0.2
Bumps [typescript](https://github.com/microsoft/TypeScript) from 5.9.3 to 6.0.2.
- [Release notes](https://github.com/microsoft/TypeScript/releases)
- [Commits](https://github.com/microsoft/TypeScript/compare/v5.9.3...v6.0.2)

---
updated-dependencies:
- dependency-name: typescript
  dependency-version: 6.0.2
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-28 21:32:30 +00:00
Viktor
2d0212b12f fix: detect agents recorded as "Agent" in transcript
Claude Code now writes subagent tool_use entries with "name": "Agent"
in the transcript JSONL, but processEntry() only checked for "Task".
This meant the agents line never displayed any agents.

Keep backwards compatibility with older transcripts that used "Task".

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 17:13:49 +02:00
윤혁준
7752a901ee feat: add styled Weekly label for 7-day usage window
When both 5h and 7d usage windows are displayed, the 7d gauge had no
label prefix. This adds a dim-styled "Weekly" label (matching the
Context/Usage label style) and removes colons from usage window labels
for consistency with other HUD labels.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 14:08:59 +09:00
Peter Chan @ TreeholeHK
ef3f04d06d fix(render): strip OSC 8 hyperlink sequences from visual length calculation
The ANSI escape patterns only matched SGR color sequences (\x1b[...m),
leaving OSC 8 hyperlink sequences (\x1b]8;;URL\x1b\ ... \x1b]8;;\x1b\)
counted as visible characters in visualLength() and sliceVisible().

This caused HUD elements to be incorrectly measured as wider than they
are, so line-wrapping kicked in too early and pushed elements like the
context bar and session duration off-screen on terminals with OSC 8
hyperlinks enabled (Ghostty, iTerm2, WezTerm, Kitty).

Fix: extend both patterns to also match \x1b][^\x1b]*\x1b\ (OSC sequences
terminated by ST), which covers OSC 8 and any future OSC sequences.
2026-03-25 10:59:23 +08:00
francis yun
21809d51a0 perf: add mtime-based disk cache for countConfigs()
countConfigs() performs ~15 file I/O operations on every invocation.
Since the statusLine plugin spawns a new process ~every 300ms, this means
~50 filesystem ops/sec per session. With multiple concurrent sessions,
this scales to ~1500 ops/sec for config data that rarely changes.

Add a sentinel-based mtime cache (following the pattern established in
transcript.ts) that stats ~4-10 sentinel paths and serves cached results
when no config files have changed. Steady-state cost drops from ~15
syscalls to ~4-10 stat calls + 1 cache read.

Cache files are stored under ~/.claude/plugins/claude-hud/config-cache/
with SHA-256 hashed keys for cwd+configDir isolation. Cache misses
trigger a fresh recompute and cache write.

Known limitation: nested rules/ subdirectory changes are not monitored
(only the top-level rules/ directory mtime is checked).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-24 23:02:37 +08:00
luborui
928279852b feat: add cumulative session token usage display
Parse assistant message usage fields from the transcript JSONL to
accumulate input, output, cache creation and cache read tokens across
the entire session. Display the total as a new HUD line controlled by
the `display.showSessionTokens` config option (default: false).

Changes:
- types.ts: add SessionTokenUsage interface
- transcript.ts: accumulate usage from assistant messages
- config.ts: add showSessionTokens option
- render/lines/session-tokens.ts: new render component
- render/index.ts & session-line.ts: integrate into both layouts
- commands/configure.md: add Session tokens to configure flow

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 17:59:24 +08:00
github-actions[bot]
30e1dfe46a build: compile dist/ [auto] 2026-03-23 04:05:49 +00:00
Jarrod Watts
7e3b1cd284 feat: configurable element colors 2026-03-23 15:05:16 +11:00
Jarrod Watts
7ea243ae88 feat: add configurable element colors 2026-03-23 15:04:40 +11:00
Jarrod Watts
557e563970 docs: collapse Windows runtime install note 2026-03-23 14:52:46 +11:00
Jarrod Watts
cb2f07c172 docs: remove stale plan label examples 2026-03-23 14:48:33 +11:00
github-actions[bot]
891cc9baee build: compile dist/ [auto] 2026-03-23 03:47:56 +00:00
Jarrod Watts
3aebe1b973 Simplify usage display to stdin only (#288)
* Simplify usage display to stdin only

* chore: bump version to 0.0.11
2026-03-23 14:47:39 +11:00
Jarrod Watts
c449c0ba29 milestone-5: prepare v0.0.10 release v0.0.10 2026-03-23 13:37:16 +11:00