Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ aliases when both are set — the aliases keep working but are deprecated.
| `context_thresholds` | `YAS_CONTEXT_THRESHOLDS` | — | `[context].thresholds` | `25,50,70,90` |
| `show_render_time` | `YAS_SHOW_RENDER_TIME` | — | `[layout].show_render_time` | `false` |
| `show_tool_uses` | `YAS_SHOW_TOOL_USES` | — | `[layout].show_tool_uses` | `false` |
| `show_tokens_over_time` | `YAS_SHOW_TOKENS_OVER_TIME` | — | `[layout].show_tokens_over_time` | `false` |
| `labels` | `YAS_LABELS` | — | `[layout].labels` | `false` |
| `justify` | `YAS_JUSTIFY` | — | `[layout].justify` | `false` |
| `show_day_stats` | `YAS_SHOW_DAY_STATS` | — | `[tokens].show_day_stats` | `true` |
Expand All @@ -130,6 +131,7 @@ aliases when both are set — the aliases keep working but are deprecated.
- **`full_width`** — when `true`, makes the box fill the terminal and ignore `max_width`.
- **`show_render_time`** — when `true`, annotates the bottom-right border with the previous run's wall-clock render time (e.g. `…47.2ms──╯`). Off by default; each run shows the prior run's timing, so it is blank on a session's first render.
- **`show_tool_uses`** — when `true`, adds a row (wide layout only) under the tokens/cost band, listing per-tool `tool_use` counts.
- **`show_tokens_over_time`** — when `true`, adds a full-width "tokens over time" row (wide layout only) under the tokens/cost band, showing the `t/m` rate and live sparkline. The trailing column of the tokens/cost row always shows skills + plugins; the sparkline is opt-in via this row.
- **`labels`** — when `true`, paints small superscript field captions into the border/separator rows (wide layout only). **Note:** this is a different knob from `[context].labels`, which is the five-word state list — see [Context state word](#context-state-word). The two share a key name but live in different sections and take different types.
- **`justify`** — when `true`, aligns fields into columns instead of packing them left (wide layout only).
- **`show_day_stats`** — when `true` (the default), shows today's cumulative token and cost totals alongside the session's, as `session/day` pairs. **Note:** this key lives under **`[tokens]`**, not `[layout]`, unlike the other display toggles.
Expand Down
15 changes: 13 additions & 2 deletions claude/yas/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
DEFAULT_THEME,
DEFAULT_SHOW_DAY_STATS,
DEFAULT_SHOW_TOOL_USES,
DEFAULT_SHOW_TOKENS_OVER_TIME,
DEFAULT_TRANSCRIPT_CACHE,
config_path,
)
Expand Down Expand Up @@ -419,8 +420,9 @@ class Config:
'max_width', 'full_width', 'justify', 'labels', 'soft_limit',
'token_window', 'theme', 'bg_shift', 'glyph_mode', 'single_width',
'show_day_stats', 'context_state', 'context_labels', 'context_thresholds',
'show_render_time', 'show_tool_uses', 'soft_limit_models', 'openspec_scan_depth',
'show_icons', 'transcript_cache', 'rate_limit_rules', 'errors', 'debug_lines',
'show_render_time', 'show_tool_uses', 'show_tokens_over_time', 'soft_limit_models',
'openspec_scan_depth', 'show_icons', 'transcript_cache', 'rate_limit_rules',
'errors', 'debug_lines',
)

max_width: int
Expand All @@ -439,6 +441,7 @@ class Config:
context_thresholds: tuple[int, ...]
show_render_time: bool
show_tool_uses: bool
show_tokens_over_time: bool
soft_limit_models: tuple[tuple[str, int], ...]
openspec_scan_depth: int
show_icons: bool
Expand All @@ -465,6 +468,7 @@ def __init__(
context_thresholds: tuple[int, ...] = DEFAULT_CONTEXT_THRESHOLDS,
show_render_time: bool = False,
show_tool_uses: bool = DEFAULT_SHOW_TOOL_USES,
show_tokens_over_time: bool = DEFAULT_SHOW_TOKENS_OVER_TIME,
soft_limit_models: tuple[tuple[str, int], ...] = (),
openspec_scan_depth: int = DEFAULT_OPENSPEC_SCAN_DEPTH,
show_icons: bool = True,
Expand All @@ -490,6 +494,7 @@ def __init__(
s(self, 'context_thresholds', context_thresholds)
s(self, 'show_render_time', show_render_time)
s(self, 'show_tool_uses', show_tool_uses)
s(self, 'show_tokens_over_time', show_tokens_over_time)
s(self, 'soft_limit_models', soft_limit_models)
s(self, 'openspec_scan_depth', openspec_scan_depth)
s(self, 'show_icons', show_icons)
Expand All @@ -512,6 +517,7 @@ def __repr__(self) -> str:
f'show_day_stats={self.show_day_stats}, context_state={self.context_state}, '
f'context_labels={self.context_labels!r}, context_thresholds={self.context_thresholds!r}, '
f'show_render_time={self.show_render_time}, show_tool_uses={self.show_tool_uses}, '
f'show_tokens_over_time={self.show_tokens_over_time}, '
f'soft_limit_models={self.soft_limit_models!r}, '
f'openspec_scan_depth={self.openspec_scan_depth}, '
f'show_icons={self.show_icons}, transcript_cache={self.transcript_cache}, '
Expand Down Expand Up @@ -614,6 +620,10 @@ def cli_src(name: str) -> list[tuple[str, object]]:
'show_tool_uses',
_env_sources(env, 'YAS_SHOW_TOOL_USES') + toml_src(layout, 'show_tool_uses'),
_parse_bool, DEFAULT_SHOW_TOOL_USES, errors, debug)
show_tokens_over_time = _resolve(
'show_tokens_over_time',
_env_sources(env, 'YAS_SHOW_TOKENS_OVER_TIME') + toml_src(layout, 'show_tokens_over_time'),
_parse_bool, DEFAULT_SHOW_TOKENS_OVER_TIME, errors, debug)
justify = _resolve(
'justify',
_env_sources(env, 'YAS_JUSTIFY') + toml_src(layout, 'justify'),
Expand Down Expand Up @@ -667,6 +677,7 @@ def cli_src(name: str) -> list[tuple[str, object]]:
context_thresholds=context_thresholds,
show_render_time=show_render_time,
show_tool_uses=show_tool_uses,
show_tokens_over_time=show_tokens_over_time,
soft_limit_models=tuple(soft_limit_models),
openspec_scan_depth=openspec_scan_depth,
show_icons=show_icons,
Expand Down
22 changes: 21 additions & 1 deletion claude/yas/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

# Keep in sync with pyproject.toml's [project] version — pyproject isn't
# shipped with the runtime copy under ~/.claude, so the value lives here too.
VERSION = '0.9.0'
VERSION = '0.9.1'
# Bumped by any future on-disk relayout under yas/; stamped into
# state/version.json by yas.migrate so a future migration can detect and
# convert an older layout.
Expand Down Expand Up @@ -124,6 +124,7 @@ def settings_path() -> Path:
DEFAULT_THEME = 'claude-dark'
DEFAULT_SHOW_DAY_STATS = True
DEFAULT_SHOW_TOOL_USES = False
DEFAULT_SHOW_TOKENS_OVER_TIME = False
DEFAULT_JUSTIFY = False
DEFAULT_LABELS = False
# Context-state word (ported from Dumbometer, MIT). Opt-in: off by default so
Expand Down Expand Up @@ -223,6 +224,25 @@ def settings_path() -> Path:
# into the compact context line (losing the cost/rate row entirely, not just
# the lines).
LINES_SEGMENT_MIN_WIDTH = 103
# Upper bound, in visible columns, on the "skills + plugins" content fed into
# the tokens/cost row's trailing column (`tokens_cost`'s `trailing_content`).
# That column shares the row with the tokens/lines/cost segments, so it never
# gets anywhere near a full row's width -- pre-clipping to this fixed,
# realistic-widest cap (rather than the box's own width-3) keeps
# `tokens_cost`'s own include/shed gate satisfiable even at very wide boxes:
# without a fixed cap, clipping to `width - 3` makes the trailing content's
# measured width scale with the box itself, so the row's own min-width-with-
# leader gate (tokens + cost + trailing + vseps <= box_width) could never be
# satisfied for a long plugin/skill list at ANY width.
PLUGINS_TRAILING_MAX_W = 300

# Minimum trailing-column width `tokens_cost` requires before it will include
# the "skills + plugins" column at all (few content cols + the ellipsis
# glyph). The column is included once this minimum fits, then clipped to
# whatever wider (or narrower) space is actually free -- gating on the full
# measured `trailing_content` width instead would shed the whole column for
# any list wider than the free space, rather than truncating it.
PLUGINS_TRAILING_MIN_W = 8

# Minimum gap between the narrow tasks-header's left cluster (glyph + done/total)
# and its right-anchored active-task timer. The timer is flush to the content
Expand Down
Loading