Skip to content

feat: add configurable context usage display#359

Open
kidush wants to merge 1 commit into
huggingface:mainfrom
kidush:context-usage-display-config
Open

feat: add configurable context usage display#359
kidush wants to merge 1 commit into
huggingface:mainfrom
kidush:context-usage-display-config

Conversation

@kidush

@kidush kidush commented Jul 13, 2026

Copy link
Copy Markdown

Summary

Adds a configurable context usage display for Tau’s TUI.

Users can now choose how the compact context meter below the prompt is shown via ~/.tau/tui.json:

{
  "context_usage_display": "both"
}

Supported values:

  • tokens - current/default behavior
  • percent - show percentage of the active model context window
  • both - show tokens and percentage
  • off - hide the compact context meter

Changes

  • Added context_usage_percent(...) in tau_coding.context_window.
  • Exposed CodingSession.context_usage_percent.
  • Added TuiSettings.context_usage_display.
  • Wired the setting into compact TUI session info rendering.
  • Updated /session to report context usage as tokens and percentage.
  • Updated configuration docs.
  • Added a dev note with the implementation plan.

Checks

uv run pytest tests/test_context_window.py tests/test_coding_session.py tests/test_tui_config.py tests/test_tui_app.py tests/test_commands.py -q
uv run ruff check .
uv run ruff format --check .

All checks passed.

@kidush
kidush requested a review from alejandro-ao as a code owner July 13, 2026 23:26
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