Commit Graph

7 Commits

Author SHA1 Message Date
Jarrod Watts
9ae17fb644 fix: consolidate CLAUDE_CONFIG_DIR handling and keychain fallback (#160)
* 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
2026-03-03 16:47:15 +11:00
Ricky (aka 利器君)
bd520e42d7 fix: prevent double-counting CLAUDE.md when cwd is home directory (#141)
* 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>
2026-03-03 13:48:30 +11:00
melon
364c76e50c fix: exclude disabled MCP servers from count (#47)
* fix: exclude disabled MCP servers from count

Fixes #3 - MCP count was showing all servers regardless of
enabled/disabled state.

## Root Cause

The HUD was counting all MCP server keys from config files without
checking if they were in the disabled lists:
- `disabledMcpServers` in `~/.claude.json` (user-scope)
- `disabledMcpjsonServers` in `settings.local.json` (project .mcp.json)

## Changes

- Add `getDisabledMcpServers()` function to read disabled arrays
- Add `DisabledMcpKey` union type for compile-time safety
- Filter disabled servers when counting MCPs
- Add debug logging (enable via `DEBUG=claude-hud`)
- Add 8 new tests including Issue #3 regression test

## Test Coverage

- User-scope disabled filtering
- Project .mcp.json disabled filtering
- All MCPs disabled → 0
- Non-string values in disabled arrays (ignored)
- Cross-scope duplicate counting behavior
- Case-sensitive server name matching
- Issue #3 exact scenario (6 MCPs, disable progressively)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* refactor: extract debug logging into shared helper module

Per PR feedback, consolidate duplicate debug logging code from
config-reader.ts and usage-api.ts into a shared debug.ts helper.

- Add src/debug.ts with createDebug() factory function
- Update config-reader.ts to use createDebug('config')
- Update usage-api.ts to use createDebug('usage')
- Same functionality, better DRY compliance

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: melon-hub <melon-hub@users.noreply.github.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 08:47:41 +11:00
Jarrod Watts
36ba791cb1 fix: recursive rules discovery and .claude/CLAUDE.local.md support
- Rules now discovered recursively in subdirectories
- Added .claude/CLAUDE.local.md detection

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-03 18:16:31 +11:00
Jarrod Watts
e9b0e9f680 feat: comprehensive config detection across all scopes
- Add ~/.claude.json user-scope MCP support
- Add .mcp.json project MCP support
- Add .claude/settings.local.json support
- Add CLAUDE.local.md and .claude/CLAUDE.md detection
- Deduplicate MCPs that appear in multiple files

Locations now covered:
- User: ~/.claude/CLAUDE.md, ~/.claude/rules/, ~/.claude/settings.json, ~/.claude.json
- Project: CLAUDE.md, CLAUDE.local.md, .claude/CLAUDE.md, .claude/rules/, .mcp.json
- Project settings: .claude/settings.json, .claude/settings.local.json

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-03 18:10:26 +11:00
Jarrod Watts
c8f46cfa3f feat(v2): enhanced config display with separate counters
- Split config counting: CLAUDE.md, rules, MCPs, hooks
- Display distinct icons for each config type (📄 📜 🔌 🪝)
- Read hooks count from settings.json
- Remove ralph-loop local config file

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-03 17:38:26 +11:00
Jarrod Watts
26a3e984e4 feat(v2): statusline architecture - Phase 1 complete
Major rewrite from split-pane TUI to multi-line statusline:

- Remove hooks/, tui/, scripts/ directories
- Add new src/ structure with TypeScript
- Implement stdin JSON parser (native model/context data)
- Implement transcript JSONL parser (tools, agents, todos)
- Implement render system with 4 lines:
  - Session: model, context bar, rules, MCPs, duration
  - Tools: running + completed with counts
  - Agents: type, model, description, elapsed
  - Todos: current task with progress
- Add context warning thresholds (70%, 85%, 95%)
- Show context breakdown at high usage
- Update plugin.json with statusLine config

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-03 14:28:25 +11:00