{"owner":"jarrodwatts","repo":"claude-hud","hasSkills":true,"hasMcp":false,"mcpConfig":null,"found":["CLAUDE.md"],"skills":{"CLAUDE.md":"# CLAUDE.md\n\nThis file provides guidance to Claude Code when working with this repository.\n\n## Project Overview\n\nClaude HUD is a Claude Code plugin that displays a real-time multi-line statusline. It shows context health, tool activity, agent status, and todo progress.\n\n## Build Commands\n\n```bash\nnpm ci               # Install dependencies\nnpm run build        # Build TypeScript to dist/\n\n# Test with sample stdin data\necho '{\"model\":{\"display_name\":\"Opus\"},\"context_window\":{\"current_usage\":{\"input_tokens\":45000},\"context_window_size\":200000}}' | node dist/index.js\n```\n\n## Architecture\n\n### Data Flow\n\n```\nClaude Code → stdin JSON → parse → render lines → stdout → Claude Code displays\n           ↘ transcript_path → parse JSONL → tools/agents/todos\n```\n\n**Key insight**: The statusline is invoked by Claude Code after each interaction (new assistant message, `/compact` finishing, permission-mode changes, vim-mode toggles), debounced at 300ms — not on a fixed polling loop. Each invocation:\n1. Receives JSON via stdin (model, context, tokens - native accurate data)\n2. Parses the transcript JSONL file for tools, agents, and todos\n3. Renders multi-line output to stdout\n4. Claude Code displays all lines\n\n### Data Sources\n\n**Native from stdin JSON** (accurate, no estimation):\n- `model.display_name` - Current model\n- `context_window.current_usage` - Token counts\n- `context_window.context_window_size` - Max context\n- `transcript_path` - Path to session transcript\n\n**From transcript JSONL parsing**:\n- `tool_use` blocks → tool name, input, start time\n- `tool_result` blocks → completion, duration\n- Running tools = `tool_use` without matching `tool_result`\n- `TodoWrite` calls → todo list\n- `Task` calls → agent info\n\n**From config files**:\n- MCP count from `~/.claude/settings.json` (mcpServers)\n- Hooks count from `~/.claude/settings.json` (hooks)\n- Rules count from CLAUDE.md files\n\n**From Claude Code stdin rate limits**:\n- `rate_limits.five_hour.used_percentage` - 5-hour subscriber usage percentage\n- `rate_limits.five_hour.resets_at` - 5-hour reset timestamp\n- `rate_limits.seven_day.used_percentage` - 7-day subscriber usage percentage\n- `rate_limits.seven_day.resets_at` - 7-day reset timestamp\n\n### File Structure\n\n```\nsrc/\n├── index.ts             # Entry point\n├── stdin.ts             # Parse Claude's JSON input\n├── transcript.ts        # Parse transcript JSONL\n├── config-reader.ts     # Read MCP/rules configs\n├── config.ts            # Load/validate user config\n├── git.ts               # Git status (branch, dirty, ahead/behind)\n├── cost.ts              # Cost estimation (native stdin cost preferred)\n├── effort.ts            # Thinking effort parsing\n├── external-usage.ts    # External usage snapshot fallback / balance_label\n├── speed-tracker.ts     # Output speed tracking\n├── context-cache.ts     # Context/usage caching across invocations\n├── memory.ts            # System memory stats\n├── claude-config-dir.ts # Resolve the Claude config directory\n├── constants.ts         # Shared constants\n├── debug.ts             # Debug logging\n├── extra-cmd.ts         # Run an optional user command for a custom label\n├── version.ts           # Plugin version handling\n├── i18n/                # HUD label translations (en, zh-Hans)\n├── utils/               # Shared helpers\n├── types.ts             # TypeScript interfaces\n└── render/\n    ├── index.ts             # Main render coordinator\n    ├── session-line.ts      # Compact mode: single line with all info\n    ├── tools-line.ts        # Tool activity (opt-in)\n    ├── skills-mcp-line.ts   # Skills & MCP activity (opt-in)\n    ├── agents-line.ts       # Agent status (opt-in)\n    ├── todos-line.ts        # Todo progress (opt-in)\n    ├── colors.ts            # ANSI color helpers\n    ├── width.ts             # Terminal width / CJK-aware measurement\n    ├── format-reset-time.ts # Usage reset time formatting\n    └── lines/\n        ├── index.ts         # Barrel export\n        ├── project.ts       # Model bracket + project + git (+ advisor)\n        ├── identity.ts      # Context bar\n        ├── usage.ts         # Usage bar (merged with context by default)\n        ├── environment.ts   # Config counts (opt-in)\n        ├── advisor.ts       # Advisor model label (opt-in)\n        ├── cost.ts          # Session cost display\n        ├── prompt-cache.ts  # Prompt cache countdown\n        ├── memory.ts        # Memory usage display\n        ├── session-time.ts  # Session duration / timestamps\n        ├── session-tokens.ts # Session token totals\n        ├── added-dirs.ts    # /add-dir workspace directories\n        └── label-align.ts   # Label column alignment\n```\n\n### Output Format (default expanded layout)\n\n```\n[Opus] │ my-project git:(main*)\nContext █████░░░░░ 45% │ Usage ██░░░░░░░░ 25% (1h 30m / 5h)\n```\n\nLines 1-2 always shown. Additional lines are opt-in via config:\n- Tools line (`showTools`): ◐ Edit: auth.ts | ✓ Read ×3\n- Skills/MCP lines (`showSkills` / `showMcp`): active Skill invocations and MCP servers; when the Skills line is enabled, Skill-tool entries are suppressed from the tools line\n- Agents line (`showAgents`): ◐ explore [haiku]: Finding auth code\n- Todos line (`showTodos`): ▸ Fix authentication bug (2/5)\n- Environment line (`showConfigCounts`): 2 CLAUDE.md | 4 rules\n- Advisor label (`showAdvisor`): inlined on the project line, e.g. `Advisor: Opus 4.7`\n\n### Context Thresholds\n\n| Threshold | Color | Action |\n|-----------|-------|--------|\n| <70% | Green | Normal |\n| 70-85% | Yellow | Warning |\n| >85% | Red | Show token breakdown |\n\n## Plugin Configuration\n\nThe plugin manifest is in `.claude-plugin/plugin.json` (metadata only - name, description, version, author).\n\n**StatusLine configuration** must be added to the user's `~/.claude/settings.json` via `/claude-hud:setup`.\n\nThe setup command adds an auto-updating command that finds the latest installed version at runtime.\n\nNote: `statusLine` is NOT a valid plugin.json field. It must be configured in settings.json after plugin installation. Updates are automatic - no need to re-run setup.\n\n## Dependencies\n\n- **Runtime**: Node.js 18+ or Bun\n- **Build**: TypeScript 5, ES2022 target, NodeNext modules\n"},"files":{"CLAUDE.md":"# CLAUDE.md\n\nThis file provides guidance to Claude Code when working with this repository.\n\n## Project Overview\n\nClaude HUD is a Claude Code plugin that displays a real-time multi-line statusline. It shows context health, tool activity, agent status, and todo progress.\n\n## Build Commands\n\n```bash\nnpm ci               # Install dependencies\nnpm run build        # Build TypeScript to dist/\n\n# Test with sample stdin data\necho '{\"model\":{\"display_name\":\"Opus\"},\"context_window\":{\"current_usage\":{\"input_tokens\":45000},\"context_window_size\":200000}}' | node dist/index.js\n```\n\n## Architecture\n\n### Data Flow\n\n```\nClaude Code → stdin JSON → parse → render lines → stdout → Claude Code displays\n           ↘ transcript_path → parse JSONL → tools/agents/todos\n```\n\n**Key insight**: The statusline is invoked by Claude Code after each interaction (new assistant message, `/compact` finishing, permission-mode changes, vim-mode toggles), debounced at 300ms — not on a fixed polling loop. Each invocation:\n1. Receives JSON via stdin (model, context, tokens - native accurate data)\n2. Parses the transcript JSONL file for tools, agents, and todos\n3. Renders multi-line output to stdout\n4. Claude Code displays all lines\n\n### Data Sources\n\n**Native from stdin JSON** (accurate, no estimation):\n- `model.display_name` - Current model\n- `context_window.current_usage` - Token counts\n- `context_window.context_window_size` - Max context\n- `transcript_path` - Path to session transcript\n\n**From transcript JSONL parsing**:\n- `tool_use` blocks → tool name, input, start time\n- `tool_result` blocks → completion, duration\n- Running tools = `tool_use` without matching `tool_result`\n- `TodoWrite` calls → todo list\n- `Task` calls → agent info\n\n**From config files**:\n- MCP count from `~/.claude/settings.json` (mcpServers)\n- Hooks count from `~/.claude/settings.json` (hooks)\n- Rules count from CLAUDE.md files\n\n**From Claude Code stdin rate limits**:\n- `rate_limits.five_hour.used_percentage` - 5-hour subscriber usage percentage\n- `rate_limits.five_hour.resets_at` - 5-hour reset timestamp\n- `rate_limits.seven_day.used_percentage` - 7-day subscriber usage percentage\n- `rate_limits.seven_day.resets_at` - 7-day reset timestamp\n\n### File Structure\n\n```\nsrc/\n├── index.ts             # Entry point\n├── stdin.ts             # Parse Claude's JSON input\n├── transcript.ts        # Parse transcript JSONL\n├── config-reader.ts     # Read MCP/rules configs\n├── config.ts            # Load/validate user config\n├── git.ts               # Git status (branch, dirty, ahead/behind)\n├── cost.ts              # Cost estimation (native stdin cost preferred)\n├── effort.ts            # Thinking effort parsing\n├── external-usage.ts    # External usage snapshot fallback / balance_label\n├── speed-tracker.ts     # Output speed tracking\n├── context-cache.ts     # Context/usage caching across invocations\n├── memory.ts            # System memory stats\n├── claude-config-dir.ts # Resolve the Claude config directory\n├── constants.ts         # Shared constants\n├── debug.ts             # Debug logging\n├── extra-cmd.ts         # Run an optional user command for a custom label\n├── version.ts           # Plugin version handling\n├── i18n/                # HUD label translations (en, zh-Hans)\n├── utils/               # Shared helpers\n├── types.ts             # TypeScript interfaces\n└── render/\n    ├── index.ts             # Main render coordinator\n    ├── session-line.ts      # Compact mode: single line with all info\n    ├── tools-line.ts        # Tool activity (opt-in)\n    ├── skills-mcp-line.ts   # Skills & MCP activity (opt-in)\n    ├── agents-line.ts       # Agent status (opt-in)\n    ├── todos-line.ts        # Todo progress (opt-in)\n    ├── colors.ts            # ANSI color helpers\n    ├── width.ts             # Terminal width / CJK-aware measurement\n    ├── format-reset-time.ts # Usage reset time formatting\n    └── lines/\n        ├── index.ts         # Barrel export\n        ├── project.ts       # Model bracket + project + git (+ advisor)\n        ├── identity.ts      # Context bar\n        ├── usage.ts         # Usage bar (merged with context by default)\n        ├── environment.ts   # Config counts (opt-in)\n        ├── advisor.ts       # Advisor model label (opt-in)\n        ├── cost.ts          # Session cost display\n        ├── prompt-cache.ts  # Prompt cache countdown\n        ├── memory.ts        # Memory usage display\n        ├── session-time.ts  # Session duration / timestamps\n        ├── session-tokens.ts # Session token totals\n        ├── added-dirs.ts    # /add-dir workspace directories\n        └── label-align.ts   # Label column alignment\n```\n\n### Output Format (default expanded layout)\n\n```\n[Opus] │ my-project git:(main*)\nContext █████░░░░░ 45% │ Usage ██░░░░░░░░ 25% (1h 30m / 5h)\n```\n\nLines 1-2 always shown. Additional lines are opt-in via config:\n- Tools line (`showTools`): ◐ Edit: auth.ts | ✓ Read ×3\n- Skills/MCP lines (`showSkills` / `showMcp`): active Skill invocations and MCP servers; when the Skills line is enabled, Skill-tool entries are suppressed from the tools line\n- Agents line (`showAgents`): ◐ explore [haiku]: Finding auth code\n- Todos line (`showTodos`): ▸ Fix authentication bug (2/5)\n- Environment line (`showConfigCounts`): 2 CLAUDE.md | 4 rules\n- Advisor label (`showAdvisor`): inlined on the project line, e.g. `Advisor: Opus 4.7`\n\n### Context Thresholds\n\n| Threshold | Color | Action |\n|-----------|-------|--------|\n| <70% | Green | Normal |\n| 70-85% | Yellow | Warning |\n| >85% | Red | Show token breakdown |\n\n## Plugin Configuration\n\nThe plugin manifest is in `.claude-plugin/plugin.json` (metadata only - name, description, version, author).\n\n**StatusLine configuration** must be added to the user's `~/.claude/settings.json` via `/claude-hud:setup`.\n\nThe setup command adds an auto-updating command that finds the latest installed version at runtime.\n\nNote: `statusLine` is NOT a valid plugin.json field. It must be configured in settings.json after plugin installation. Updates are automatic - no need to re-run setup.\n\n## Dependencies\n\n- **Runtime**: Node.js 18+ or Bun\n- **Build**: TypeScript 5, ES2022 target, NodeNext modules\n"},"items":[{"name":"CLAUDE.md","path":"CLAUDE.md","title":"CLAUDE.md","content":"# CLAUDE.md\n\nThis file provides guidance to Claude Code when working with this repository.\n\n## Project Overview\n\nClaude HUD is a Claude Code plugin that displays a real-time multi-line statusline. It shows context health, tool activity, agent status, and todo progress.\n\n## Build Commands\n\n```bash\nnpm ci               # Install dependencies\nnpm run build        # Build TypeScript to dist/\n\n# Test with sample stdin data\necho '{\"model\":{\"display_name\":\"Opus\"},\"context_window\":{\"current_usage\":{\"input_tokens\":45000},\"context_window_size\":200000}}' | node dist/index.js\n```\n\n## Architecture\n\n### Data Flow\n\n```\nClaude Code → stdin JSON → parse → render lines → stdout → Claude Code displays\n           ↘ transcript_path → parse JSONL → tools/agents/todos\n```\n\n**Key insight**: The statusline is invoked by Claude Code after each interaction (new assistant message, `/compact` finishing, permission-mode changes, vim-mode toggles), debounced at 300ms — not on a fixed polling loop. Each invocation:\n1. Receives JSON via stdin (model, context, tokens - native accurate data)\n2. Parses the transcript JSONL file for tools, agents, and todos\n3. Renders multi-line output to stdout\n4. Claude Code displays all lines\n\n### Data Sources\n\n**Native from stdin JSON** (accurate, no estimation):\n- `model.display_name` - Current model\n- `context_window.current_usage` - Token counts\n- `context_window.context_window_size` - Max context\n- `transcript_path` - Path to session transcript\n\n**From transcript JSONL parsing**:\n- `tool_use` blocks → tool name, input, start time\n- `tool_result` blocks → completion, duration\n- Running tools = `tool_use` without matching `tool_result`\n- `TodoWrite` calls → todo list\n- `Task` calls → agent info\n\n**From config files**:\n- MCP count from `~/.claude/settings.json` (mcpServers)\n- Hooks count from `~/.claude/settings.json` (hooks)\n- Rules count from CLAUDE.md files\n\n**From Claude Code stdin rate limits**:\n- `rate_limits.five_hour.used_percentage` - 5-hour subscriber usage percentage\n- `rate_limits.five_hour.resets_at` - 5-hour reset timestamp\n- `rate_limits.seven_day.used_percentage` - 7-day subscriber usage percentage\n- `rate_limits.seven_day.resets_at` - 7-day reset timestamp\n\n### File Structure\n\n```\nsrc/\n├── index.ts             # Entry point\n├── stdin.ts             # Parse Claude's JSON input\n├── transcript.ts        # Parse transcript JSONL\n├── config-reader.ts     # Read MCP/rules configs\n├── config.ts            # Load/validate user config\n├── git.ts               # Git status (branch, dirty, ahead/behind)\n├── cost.ts              # Cost estimation (native stdin cost preferred)\n├── effort.ts            # Thinking effort parsing\n├── external-usage.ts    # External usage snapshot fallback / balance_label\n├── speed-tracker.ts     # Output speed tracking\n├── context-cache.ts     # Context/usage caching across invocations\n├── memory.ts            # System memory stats\n├── claude-config-dir.ts # Resolve the Claude config directory\n├── constants.ts         # Shared constants\n├── debug.ts             # Debug logging\n├── extra-cmd.ts         # Run an optional user command for a custom label\n├── version.ts           # Plugin version handling\n├── i18n/                # HUD label translations (en, zh-Hans)\n├── utils/               # Shared helpers\n├── types.ts             # TypeScript interfaces\n└── render/\n    ├── index.ts             # Main render coordinator\n    ├── session-line.ts      # Compact mode: single line with all info\n    ├── tools-line.ts        # Tool activity (opt-in)\n    ├── skills-mcp-line.ts   # Skills & MCP activity (opt-in)\n    ├── agents-line.ts       # Agent status (opt-in)\n    ├── todos-line.ts        # Todo progress (opt-in)\n    ├── colors.ts            # ANSI color helpers\n    ├── width.ts             # Terminal width / CJK-aware measurement\n    ├── format-reset-time.ts # Usage reset time formatting\n    └── lines/\n        ├── index.ts         # Barrel export\n        ├── project.ts       # Model bracket + project + git (+ advisor)\n        ├── identity.ts      # Context bar\n        ├── usage.ts         # Usage bar (merged with context by default)\n        ├── environment.ts   # Config counts (opt-in)\n        ├── advisor.ts       # Advisor model label (opt-in)\n        ├── cost.ts          # Session cost display\n        ├── prompt-cache.ts  # Prompt cache countdown\n        ├── memory.ts        # Memory usage display\n        ├── session-time.ts  # Session duration / timestamps\n        ├── session-tokens.ts # Session token totals\n        ├── added-dirs.ts    # /add-dir workspace directories\n        └── label-align.ts   # Label column alignment\n```\n\n### Output Format (default expanded layout)\n\n```\n[Opus] │ my-project git:(main*)\nContext █████░░░░░ 45% │ Usage ██░░░░░░░░ 25% (1h 30m / 5h)\n```\n\nLines 1-2 always shown. Additional lines are opt-in via config:\n- Tools line (`showTools`): ◐ Edit: auth.ts | ✓ Read ×3\n- Skills/MCP lines (`showSkills` / `showMcp`): active Skill invocations and MCP servers; when the Skills line is enabled, Skill-tool entries are suppressed from the tools line\n- Agents line (`showAgents`): ◐ explore [haiku]: Finding auth code\n- Todos line (`showTodos`): ▸ Fix authentication bug (2/5)\n- Environment line (`showConfigCounts`): 2 CLAUDE.md | 4 rules\n- Advisor label (`showAdvisor`): inlined on the project line, e.g. `Advisor: Opus 4.7`\n\n### Context Thresholds\n\n| Threshold | Color | Action |\n|-----------|-------|--------|\n| <70% | Green | Normal |\n| 70-85% | Yellow | Warning |\n| >85% | Red | Show token breakdown |\n\n## Plugin Configuration\n\nThe plugin manifest is in `.claude-plugin/plugin.json` (metadata only - name, description, version, author).\n\n**StatusLine configuration** must be added to the user's `~/.claude/settings.json` via `/claude-hud:setup`.\n\nThe setup command adds an auto-updating command that finds the latest installed version at runtime.\n\nNote: `statusLine` is NOT a valid plugin.json field. It must be configured in settings.json after plugin installation. Updates are automatic - no need to re-run setup.\n\n## Dependencies\n\n- **Runtime**: Node.js 18+ or Bun\n- **Build**: TypeScript 5, ES2022 target, NodeNext modules\n","category":"root","tokens":1543}]}