Skip to content

Add Claude and Codex usage limit indicator - #12

Merged
accessd merged 2 commits into
mainfrom
feature/agent-limit-display
Jul 25, 2026
Merged

accessd merged 2 commits into
mainfrom
feature/agent-limit-display

Conversation

@accessd

@accessd accessd commented Jul 25, 2026 •

Copy link
Copy Markdown
Owner

What changed

  • Add a global #{agent_limits} tmux status interpolation.
  • Read Claude 5-hour and 7-day usage from status-line snapshots and local cached utilization.
  • Read Codex account limits from recent rollout token_count events.
  • Display explicit used percentages matching provider dashboards, for example C 5h 57% used · X 7d 3% used.
  • Hide expired windows and cache rendered output for 60 seconds.
  • Chain existing Claude status-line commands during install and restore them during uninstall.
  • Add GitHub Actions CI for Bash syntax, ShellCheck, Python syntax, and isolated tmux tests.
  • Document status integration and configuration options.

Why

Agent lifecycle state shows when work needs attention, but it does not show whether the shared provider account is approaching a usage cap. This adds that account-level signal without tying limits to one pane or requiring Herdr at runtime.

The repository had no automated pull-request checks. The CI workflow now catches shell regressions and exercises the full tmux behavior suite before merge.

How

The Python collector reads provider-owned local files and writes a versioned cache under the user cache directory. A small shell wrapper reads tmux options and invokes the collector. The installer wraps Claude status-line commands with a base64-preserved pass-through so existing status output remains unchanged.

CI runs separate lint and test jobs on pull requests and pushes to main. The window-title regression setup now places its agent pane in the background, matching the production condition under test.

Validation

  • ./tests/run-all.sh
  • bash -n agent-indicator.tmux scripts/*.sh install.sh setup.sh tests/*.sh tests/lib/*.sh
  • shellcheck -x -S warning agent-indicator.tmux scripts/*.sh install.sh setup.sh tests/*.sh tests/lib/*.sh
  • python3 -m py_compile scripts/agent-limits.py
  • git diff --check

All automated tests and lint checks pass locally.

Add a global #{agent_limits} tmux interpolation backed by Claude status-line snapshots and Codex rollout rate-limit events. Show explicit used percentages so the segment matches provider dashboards, hide expired windows, and cache rendered output to avoid repeated filesystem scans.

Preserve existing Claude status-line commands by chaining them through the installer and restoring them on uninstall. Document the options and add collector, installer, and interpolation regression coverage.
@accessd accessd self-assigned this Jul 25, 2026
Run Bash syntax checks, ShellCheck, Python compilation, and the isolated tmux test suite for pull requests and pushes to main.

Correct the window-title regression setup so it exercises a background agent window, and clean up existing ShellCheck warnings so the repository-wide lint job is actionable.
@accessd
accessd merged commit f0c83c3 into main Jul 25, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant