Commit Graph

30 Commits

Author SHA1 Message Date
Jarrod Watts
5d01f9ce77 ci: Add GitHub Actions CI workflow
- Lint, typecheck, and test on push/PR to main
- Validate plugin structure (plugin.json, hooks.json, scripts)
- Build verification

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-03 07:14:22 +11:00
Jarrod Watts
e1b8d313f0 docs: Update CHANGELOG and bump version to 2.0.0
Phase 7 - Documentation:
- Update CHANGELOG with all v2.0.0 changes
- Document unified context tracking, cost display, hooks architecture
- List all fixes: flickering, session handling, test reliability
- Reference ADRs and research documents
- Bump version to 2.0.0

All phases complete:
- Phase 1: Research
- Phase 2: Architecture decisions
- Phase 3: Foundation (ESLint, Prettier, hooks)
- Phase 4: Context system rewrite
- Phase 5: Architecture refactor
- Phase 6: Polish & features
- Phase 7: Documentation

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 23:25:07 +11:00
Jarrod Watts
b398e85cab feat: Add cost tracking display to HUD
Phase 6 - Polish & Features:
- Add CostTracker integration to useHudState hook
- Create CostDisplay component showing model, tokens, and estimated cost
- Track input/output tokens from tool calls and user prompts
- Detect model from transcript for accurate pricing
- Format costs and token counts for readability
- Add 6 new tests for CostDisplay component

All 152 tests passing, lint clean.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 23:24:08 +11:00
Jarrod Watts
96a249f442 refactor: Extract state management into custom hooks
Phase 5 - Architecture Refactor:
- Create useHudState hook for all event processing and state management
- Create useElapsedTime hook for session timer
- Reduce app.tsx from 329 lines to 136 lines (59% reduction)
- App component now focused purely on rendering
- Follows ADR 001: Custom hooks + useReducer pattern
- All state logic now testable independently

All 146 tests passing, lint clean.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 23:22:04 +11:00
Jarrod Watts
b2709fec9e feat: Unified context tracking to fix flickering
Phase 4 - Context System Rewrite:
- Create UnifiedContextTracker that combines transcript reading and estimation
- Eliminates dual-source flickering by making transcript the single source of truth
- Only reads transcript on Stop events (when Claude finishes responding)
- Falls back to estimation when transcript isn't available
- Removes 5-second polling interval that caused context jumps
- Maintains burn rate calculation from token history
- Tracks compaction events from PreCompact hook
- Add comprehensive tests for unified tracker (13 new tests)

All 146 tests passing, lint clean.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 23:20:11 +11:00
Jarrod Watts
efabc82b5b feat: Add ESLint, Prettier, and pre-commit hooks
Phase 3 Foundation:
- Add ESLint with TypeScript, React, React Hooks, and Prettier config
- Add Prettier with project-standard settings
- Set up Husky pre-commit hooks with lint-staged
- Fix all ESLint errors and warnings in codebase
- Format all files with Prettier
- Fix type errors in usage-reader.test.ts

All 133 tests passing, lint clean, builds successfully.

Note: GitHub Actions CI workflow saved locally but requires
manual push with workflow scope or direct upload to GitHub.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 23:17:31 +11:00
Jarrod Watts
2e55e5802d fix: Resolve smoke test race condition in FIFO cleanup
The test was deleting the temp directory immediately after unmount,
but the EventReader had pending reconnection timers that would fire
and try to access the deleted FIFO.

Fix:
- Move cleanup to afterEach hook
- Add sleep delays to allow timers to clear
- Wrap cleanup in try/catch to ignore errors

All 133 tests now pass with 0 errors.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 23:12:05 +11:00
Jarrod Watts
6bb9c675f2 docs: Add changelog for v2 development
Tracks all changes being made during the architecture overhaul.
Users can read this to understand what's changing and why.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 23:10:43 +11:00
Jarrod Watts
e39933fac2 docs: Add architecture decision records for v2
ADR 001: State Management - Custom hooks + useReducer
- Extract state logic from app.tsx into domain-specific hooks
- useReducer for predictable state transitions
- Each hook independently testable

ADR 002: Data Flow - Event-driven with minimal polling
- Primary: Hook events via FIFO (real-time)
- Secondary: Single consolidated poll (git/mcp only)
- Eliminate redundant polling sources that cause flickering

ADR 003: Shell vs TypeScript - Minimal shell, logic in TS
- Hooks must be shell scripts (Claude Code requirement)
- Keep shell scripts minimal (extract data, write FIFO)
- Complex logic moves to testable TypeScript

ADR 004: Session Handling - Track session ID, graceful reset
- Session ID in all events for change detection
- Reset state on session change (/new, /exit, /resume)
- Exponential backoff reconnection strategy

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 23:10:26 +11:00
Jarrod Watts
07e6584e5f docs: Add research findings for claude-hud v2 architecture
Research covers:
- Claude Code plugin best practices from Anthropic
- TUI design principles from lazygit, btop, and awesome-tuis
- Ink/React terminal UI performance patterns
- Current architecture problems analysis
- Architecture recommendations

Key findings:
- Event-driven over polling for real-time updates
- Use <Static> component for stable UI sections
- Custom hooks + useReducer for state management
- Keep bash hooks minimal, move logic to TypeScript

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 23:08:30 +11:00
Jarrod Watts
a85cdc5d40 wip kinda broken 2026-01-02 22:08:34 +11:00
Jarrod Watts
48ba04953b feat: Security hardening and expanded test coverage
Scripts:
- Add set -uo pipefail to all shell scripts
- Add jq existence check before processing
- Add JSON validation before parsing
- Add session_id regex validation (alphanumeric, dash, underscore)

hooks.json:
- Remove empty matcher fields (follows spec)

Tests:
- Add ToolStream component tests (14 tests)
- Add TodoList component tests (10 tests)
- Add AgentList component tests (13 tests)
- Add SessionStats component tests (8 tests)
- Add ModifiedFiles component tests (10 tests)
- Add McpStatus component tests (14 tests)
- Add stats-reader formatTokens tests (5 tests)

Docs:
- Update README paths for marketplace installs
- Update CLAUDE.md with current architecture

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 17:09:39 +11:00
Jarrod Watts
44e5afdd02 feat: Developer Intelligence Dashboard (v0.1.0)
Surface real data from Claude Code internals instead of estimates:

- Add settings-reader.ts: Parse ~/.claude/settings.json for model, plugins, MCP
- Add stats-reader.ts: Parse ~/.claude/stats-cache.json for real token counts
- Add context-detector.ts: Detect global and project CLAUDE.md files
- Add StatusBar component: Show model, idle state, plugin/MCP counts, cwd
- Add ContextInfo component: Display loaded context files
- Enhance ContextMeter: Show real token data (today's usage, cache stats)
- Enhance McpStatus: Renamed to Connections, shows MCP servers AND plugins

Version corrected from 2.0.0 to 0.1.0 (proper semver for early development)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 17:00:21 +11:00
Jarrod Watts
51c07bef2f chore: Release v2.0.0 with changelog
Phase 7 - Final release:
- Bump version to 2.0.0 in package.json and plugin.json
- Add comprehensive CHANGELOG.md documenting all v2 features
- 90 tests passing
- Plugin validation passing
- All documentation updated

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 15:22:52 +11:00
Jarrod Watts
ae490fae2f feat: Add git status panel with branch and change tracking
Phase 6 of v2 upgrade:
- Add GitStatus component showing current branch
- Display ahead/behind commit counts
- Show staged, modified, and untracked file counts
- Auto-refresh git status every 30 seconds
- Uses cwd from hook events for accurate git info
- Update README to document git status feature

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 15:22:03 +11:00
Jarrod Watts
c8d235ead9 docs: Comprehensive CONTRIBUTING guide with architecture docs
Phase 5 of v2 upgrade:
- Add detailed architecture overview with data flow diagram
- Document key components (EventReader, ContextTracker, CostTracker)
- Add guide for adding new panels
- Add guide for adding new hooks
- Include PR checklist and code style guidelines
- List contribution areas (features, improvements, testing, docs)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 15:20:57 +11:00
Jarrod Watts
0d96ec71f6 test: Add comprehensive tests for event parsing and Sparkline
Phase 4 of v2 upgrade:
- Add event-parser.test.ts with edge cases for all event types
- Add Sparkline.test.tsx for component testing
- Add ink-testing-library for component tests
- Test malformed JSON, unicode, long paths, special characters
- 65 tests total, all passing

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 15:20:05 +11:00
Jarrod Watts
b4a2e8d53b docs: Add troubleshooting guide and installation verification
Phase 3 of v2 upgrade:
- Add comprehensive TROUBLESHOOTING.md
- Add verify-install.sh script for checking installation
- Update README with new features and troubleshooting section
- Document all 8 hook events
- Add verification instructions

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 15:18:54 +11:00
Jarrod Watts
d370b16100 feat: UI enhancements with sparkline, cost tracking, and tests
Phase 2 of v2 upgrade:
- Token sparkline visualization showing usage history
- Cost estimation panel with input/output breakdown
- Session status bar with idle indicator
- Last user prompt preview
- Add comprehensive tests for CostTracker

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 14:11:44 +11:00
Jarrod Watts
bb77dd7cc3 feat: Enhanced data capture with new hooks and session tracking
Phase 1 of v2 upgrade:
- Add PreToolUse hook for true "running" state before tool execution
- Add UserPromptSubmit hook to track user prompts and idle state
- Add Stop hook for idle detection when Claude finishes responding
- Add PreCompact hook to track context compaction events
- Enrich capture-event.sh with permission_mode, transcript_path, cwd
- Add CostTracker for session cost estimation
- Add SessionInfo type for tracking session state
- Show idle indicator (💤/) and permission mode in header
- Show cost estimate when significant
- Show compaction count warning
- Show last user prompt preview

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 14:10:21 +11:00
Jarrod Watts
617c90df3a chore: Bump version to 1.0.0
- Update tui/package.json to 1.0.0
- Update plugin.json to 1.0.0
- All 18 tests passing
- TypeScript strict mode verified
- No console.log statements

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 13:38:52 +11:00
Jarrod Watts
f082f5fcff docs: Comprehensive documentation update
- Rewrite README with clear feature descriptions
- Add prominent installation command
- Document all features: context health, tool stream, agents, stats
- Add supported terminals table with checkmarks
- Add keyboard shortcuts section
- Create CONTRIBUTING.md with project structure
- Update plugin.json with better metadata and author info

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 13:36:53 +11:00
Jarrod Watts
c51e054066 feat: Add vitest testing infrastructure with context tracker tests
- Add vitest and @testing-library/react
- Create vitest.config.ts
- Add test scripts to package.json
- Write comprehensive tests for ContextTracker:
  - Token estimation
  - Event processing
  - Health status calculation
  - Reset functionality

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 13:35:37 +11:00
Jarrod Watts
340fe5d2ef feat: Improve cross-terminal support with better detection
- Add node fallback when bun is unavailable
- Better command availability checking
- Support macOS Terminal.app (Apple_Terminal)
- Add xterm support for Linux desktops
- Adjust tmux split width to 50 for better fit
- Reduce WezTerm/Windows Terminal split to 25%
- Improve error handling with && return 0 pattern
- Add LOG_FILE variable for cleaner code

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 13:34:07 +11:00
Jarrod Watts
7a7c497efc feat: Add robustness with error boundaries and connection status
- Add ErrorBoundary component to gracefully handle component crashes
- Improve EventReader with connection status tracking
- Add exponential backoff for reconnection attempts
- Show connection status indicator in HUD header (●/◐/○/✗)
- Check FIFO existence before connecting
- Wrap all HUD sections in error boundaries
- Widen HUD to 48 chars for better content fit

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 13:33:20 +11:00
Jarrod Watts
4ab459610b feat: Add session stats with tool counts, file changes, and duration
- New SessionStats component showing:
  - Live session duration timer
  - Tool usage counts (top 4 tools)
  - File change statistics (+additions/-deletions)
  - Completed agent count
- Reorder HUD sections for better information hierarchy

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 13:31:37 +11:00
Jarrod Watts
9bf55ffe05 feat: Enhance agent tracking with elapsed time and nested tools
- Add real-time elapsed time counter for running agents
- Show nested tool activity (last 3 tools per agent)
- Add active agent count indicator
- Truncate long descriptions intelligently
- Update AgentEntry type to include tools array
- Hide agents section when empty

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 13:30:29 +11:00
Jarrod Watts
6bdeb4d8c9 feat: Enhance tool stream with duration, smart truncation, and error status
- Add duration tracking for tool calls
- Smart path truncation showing parent/filename
- Color-code slow operations (>5s) in yellow
- Show tool count in header
- Detect error status from response
- Add startTs, endTs, duration fields to ToolEntry type

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 13:29:27 +11:00
Jarrod Watts
86c39cf23e feat: Add context health tracking with burn rate and breakdown
- Add ContextTracker class for accurate token estimation
- Track input/output token breakdown
- Calculate burn rate (tokens/minute)
- Add compaction warnings at 85% threshold
- Update ContextMeter to display health status, burn rate, and breakdown
- Add ContextHealth and ContextBreakdown types

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 13:28:13 +11:00
Jarrod Watts
fc0128ac73 Initial commit: Claude HUD plugin
Real-time terminal HUD for Claude Code showing:
- Context usage meter
- Tool activity stream
- Subagent visualization
- MCP status indicators
- Todo list tracking
- Modified files

Built with React/Ink for terminal UI.
Supports tmux, iTerm2, Kitty, WezTerm, Zellij, Windows Terminal.
2026-01-02 12:41:08 +11:00