Skip to content

Bug: TUI status preview out of sync with actual Claude Code status line #20

Description

@vishnujayvel

Description

The TUI Status tab "Live Preview" does not match what the user actually sees in their Claude Code session footer. Two distinct sync issues:

1. Stdin-dependent segments show fake placeholder values

The TUI preview renders hardcoded placeholders for segments that depend on Claude Code's stdin pipe:

  • context_bar: shows 50% — real session shows 71%
  • cost: shows $3.45 — real session shows $22.58
  • duration: shows 1h23m — real session shows 4h03m
  • daemon_health: shows daemon: ok — may not match

These segments get their data from Claude Code's JSON piped to hookwise status-line via stdin on each render tick. The TUI has no access to this pipe — it only reads the disk cache.

2. Layout mismatch (5-line preview vs 2-line real)

The TUI shows the new 5-line layout with project, calendar, insights, trend, and mantra lines. But the actual Claude Code session may show fewer lines if running an older hookwise version or config.

Root Cause

tui/hookwise_tui/tabs/status.py uses STDIN_PLACEHOLDERS (hardcoded fake values) for context_bar, cost, duration, daemon_health. These values never update because the TUI can't intercept Claude Code's stdin pipe.

Expected Behavior

The TUI preview should either:

  1. Show actual session data by reading the last-rendered status line output (e.g., cache the output of each hookwise status-line invocation to a file)
  2. Clearly mark stdin segments as "live only" — don't show fake numbers that mislead the user into thinking the preview matches reality
  3. Show the actual layout the user would see based on their installed hookwise version

Screenshots

TUI Preview Actual Session
50% | $3.45 | 1h23m 71% | $22.58 | 4h03m
5 lines (project, calendar, insights...) 2 lines only

Proposed Fix

Option A (preferred): Have the hookwise status-line command write its last output to a cache file (e.g., ~/.hookwise/cache/last-status-output.txt). The TUI reads this file for the preview instead of re-rendering from cache.

Option B: Replace placeholder values with [live] or -- indicators and add a note "These segments update in real-time during Claude Code sessions".

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions