Conversation
- Replace token count with ASCII progress bar (■◧□) - Show model name prefix (e.g., "Opus 4.5 | ctx") - Color coding: grey (<60%), orange (60-80%), red (>80%) - Hide status line when context is 0% - Add README with setup instructions
📝 WalkthroughWalkthroughAdds a README and a new Bash status line script for the Claude Code Dotfiles Plugin; the README documents enabling and output format, and the script parses JSON from stdin to extract model name and context usage, computes an effective percentage, and renders a 20-character, colour-coded progress bar with percentage. Changes
Sequence Diagram(s)sequenceDiagram
participant Input as JSON stdin
participant Script as statusline.sh
participant Terminal as Output
Input->>Script: provide JSON (model, context_window.used_percentage)
Script-->>Script: parse fields (jq), default values if missing
Script-->>Script: compute EFFECTIVE_PCT (used / 77.5 * 100), clamp, derive full/half/empty squares
Script-->>Script: assemble coloured BAR + reserved segment
Script->>Terminal: print "<MODEL> | ctx <BAR> <PERCENT>%"
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
✏️ Tip: You can disable this entire section by setting Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In `@claude-plugin/README.md`:
- Around line 31-33: Update the README color thresholds to match the
implementation logic: change the "Orange: 60-80%" line to explicitly show the
upper bound is exclusive (for example "Orange: 60-<80% (60–79%)") and clarify
the Red line to indicate it applies to >=80% (e.g., "Red: ≥80%"), so the listed
ranges for "Grey: < 60%", "Orange: 60-<80% (60–79%)", and "Red: ≥80%" accurately
reflect the script's use of `< 80` for the orange cutoff.
In `@claude-plugin/statusline/statusline.sh`:
- Around line 14-28: Clamp USED_PCT and cap computed squares to avoid negative
EMPTY_SQUARES: before calculating FULL_SQUARES/REMAINDER/HAS_HALF, clamp
USED_PCT into 0..100 (replace or assign a sanitized variable, e.g.,
SANITIZED_PCT) and then compute FULL_SQUARES from that; after computing
FULL_SQUARES, ensure FULL_SQUARES is not greater than 20 (cap to 20) and only
set HAS_HALF when FULL_SQUARES < 20 and REMAINDER >= 2.5; finally compute
EMPTY_SQUARES as max(0, 20 - FULL_SQUARES - (HAS_HALF ? 1 : 0)). Apply these
changes around the symbols USED_PCT, FULL_SQUARES, REMAINDER, HAS_HALF, BAR, and
EMPTY_SQUARES.
🧹 Nitpick comments (2)
claude-plugin/README.md (1)
25-27: Add language specifier to fenced code block.The static analysis tool correctly flags that this code block lacks a language specifier. Since this shows example terminal output, consider using
textorplaintext.-``` +```text Opus 4.5 | ctx ■■■■■□□□□□□□□□□□□□□□ 25%</blockquote></details> <details> <summary>claude-plugin/statusline/statusline.sh (1)</summary><blockquote> `1-7`: **Consider validating dependencies.** The script relies on `jq` and `bc` which may not be installed on all systems. Consider adding a check or documenting the dependencies. <details> <summary>🔧 Optional: Add dependency check</summary> ```diff #!/bin/bash +# Dependencies: jq, bc +command -v jq >/dev/null 2>&1 || { echo "jq required" >&2; exit 1; } +command -v bc >/dev/null 2>&1 || { echo "bc required" >&2; exit 1; } + # Read JSON input from stdin input=$(cat)
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
claude-plugin/README.mdclaude-plugin/statusline/statusline.sh
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2026-01-01T21:11:09.058Z
Learnt from: tyom
Repo: tyom/dotfiles PR: 6
File: scripts/setup.sh:33-41
Timestamp: 2026-01-01T21:11:09.058Z
Learning: In dotfiles repositories, when running installers during setup (e.g., Volta or similar tools) from shell scripts, pass the appropriate skip/setup flag (such as --skip-setup or an equivalent) to avoid modifying shell profiles. Shell configuration should be managed centrally in the version-controlled dotfiles, so external modifications should be prevented or minimized by default. Ensure setup.sh and related scripts do not alter shell init files outside the repo.
Applied to files:
claude-plugin/statusline/statusline.sh
🪛 markdownlint-cli2 (0.18.1)
claude-plugin/README.md
25-25: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: test
🔇 Additional comments (1)
claude-plugin/statusline/statusline.sh (1)
33-44: LGTM!The colour logic correctly implements the threshold rules, and the
printfformatting handles the output well. The use of ANSI escape codes for terminal colours is appropriate.
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
- Clamp percentage to 0-100 range to handle overflow - Cap full squares at 20 to prevent negative empty squares - Only add half square when room available - Update README with precise threshold ranges (60–79%, ≥80%)
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In `@claude-plugin/README.md`:
- Around line 25-27: The fenced code block in README.md lacks a language
specifier which triggers MD040; update the example fence around "Opus 4.5 | ctx
■■■■■□□□□□□□□□□□□□□□ 25%" by adding a language token (e.g., use "text" or
"console") after the opening ``` so the block becomes a fenced code block with a
language and satisfies the linter.
In `@claude-plugin/statusline/statusline.sh`:
- Around line 47-58: The color selection and printed percentage should use the
clamped value instead of the raw USED_PCT: change the comparison logic that sets
COLOR to compare CLAMPED_PCT (not USED_PCT) and update the printf to print
CLAMPED_PCT (not USED_PCT); keep BAR as-is (it’s already from CLAMPED_PCT), and
ensure variables referenced are COLOR, CLAMPED_PCT, USED_PCT, BAR, and the
printf call so the display and colour remain consistent for out-of-range inputs.
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
claude-plugin/README.mdclaude-plugin/statusline/statusline.sh
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2026-01-01T21:11:09.058Z
Learnt from: tyom
Repo: tyom/dotfiles PR: 6
File: scripts/setup.sh:33-41
Timestamp: 2026-01-01T21:11:09.058Z
Learning: In dotfiles repositories, when running installers during setup (e.g., Volta or similar tools) from shell scripts, pass the appropriate skip/setup flag (such as --skip-setup or an equivalent) to avoid modifying shell profiles. Shell configuration should be managed centrally in the version-controlled dotfiles, so external modifications should be prevented or minimized by default. Ensure setup.sh and related scripts do not alter shell init files outside the repo.
Applied to files:
claude-plugin/statusline/statusline.sh
🪛 markdownlint-cli2 (0.18.1)
claude-plugin/README.md
25-25: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: test
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
Display reserved context as shaded blocks (▨) in dark gray to visualize the 22.5% auto-compact buffer. Percentage now reflects usable context rather than total, giving accurate warning before auto-compact triggers.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@claude-plugin/statusline/statusline.sh`:
- Around line 1-12: The script uses jq to populate USED_PCT and MODEL (see the
jq calls around those variable assignments) but has no dependency documentation
or runtime check; update the project README to list jq as a required tool and
modify statusline.sh to fail fast if jq is missing (e.g., check via command -v
jq or type jq and print a clear error to stderr and exit non-zero before the
lines that compute USED_PCT and MODEL), so the script does not fail silently
when jq is unavailable.
🧹 Nitpick comments (3)
claude-plugin/statusline/statusline.sh (1)
55-68: Colour thresholds now useEFFECTIVE_PCTconsistently.The colour logic and final
printfboth useEFFECTIVE_PCT, which resolves the previous review concern about inconsistency. The thresholds (75%, 94%) align with the documented behaviour.One minor point: the comment on Line 56 states "60%/75%/80% of total context" but should read "~58%/~58-72%/~73%+ of total" to match the README. This is cosmetic but could cause confusion.
📝 Suggested comment clarification
# Color based on effective usage (grey < 75%, orange 75-94%, red >= 94%) -# These thresholds correspond to 60%/75%/80% of total context +# These thresholds correspond to ~58%/~58-72%/~73%+ of total contextclaude-plugin/README.md (2)
1-21: Documentation is clear and provides useful setup instructions.The configuration example is well-structured. However, the hardcoded path
~/Code/dotfiles/claude-plugin/statusline/statusline.shis user-specific and may not apply to other users of these dotfiles.Consider using a relative path or a placeholder to make it more generic.
📝 Suggested change for portability
{ "statusLine": { "type": "command", - "command": "~/Code/dotfiles/claude-plugin/statusline/statusline.sh", + "command": "<path-to-dotfiles>/claude-plugin/statusline/statusline.sh", "padding": 0 } }
23-35: Output example and colour thresholds are well-documented.The explanation of usable vs reserved squares and the effective usage calculation is helpful. The colour thresholds now correctly reflect the implementation with proper boundary notation (≥ for red).
One minor discrepancy: the script requires
jqto parse JSON input, but this dependency is not mentioned in the README. Consider adding a prerequisites section.📝 Suggested addition for dependencies
## Status Line A custom status bar showing model name and context usage with a visual progress bar. +### Prerequisites + +- `jq` - JSON processor (install via `brew install jq` or your package manager) + ### Enable
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
claude-plugin/README.mdclaude-plugin/statusline/statusline.sh
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2026-01-01T21:11:09.058Z
Learnt from: tyom
Repo: tyom/dotfiles PR: 6
File: scripts/setup.sh:33-41
Timestamp: 2026-01-01T21:11:09.058Z
Learning: In dotfiles repositories, when running installers during setup (e.g., Volta or similar tools) from shell scripts, pass the appropriate skip/setup flag (such as --skip-setup or an equivalent) to avoid modifying shell profiles. Shell configuration should be managed centrally in the version-controlled dotfiles, so external modifications should be prevented or minimized by default. Ensure setup.sh and related scripts do not alter shell init files outside the repo.
Applied to files:
claude-plugin/statusline/statusline.sh
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: test
🔇 Additional comments (3)
claude-plugin/statusline/statusline.sh (3)
14-22: Effective percentage calculation is well-designed.The logic correctly scales the raw usage against the 77.5% auto-compact threshold and clamps
EFFECTIVE_PCTto 100. The separateCLAMPED_PCTfor bar calculation (clamped to 0–77.5) is also appropriate.Minor nit: the
scale=2in Line 16 produces up to 2 decimal places, but Line 22 may produce more precision. This inconsistency is harmless since the final output uses%.0f, but could be tidied for clarity.
24-42: Bar calculation handles edge cases correctly.The clamping of
FULL_SQUARESto 15, the conditional half-square logic, and the safeguard for negativeEMPTY_SQUARESare all sensible. This addresses the overflow concern raised in prior reviews.
44-53: Bar construction is clear and functional.The loop-based approach for building the progress bar string works correctly. The use of Unicode characters (■, ◧, □) provides a clean visual representation.
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
Added status line bash script and updated the docs on how to install it.
Summary by CodeRabbit
New Features
Documentation
✏️ Tip: You can customize this high-level summary in your review settings.