Skip to content

Conversation

@vanclute
Copy link

@vanclute vanclute commented Dec 9, 2025

Summary

Adds visual threshold warnings to context widgets to help users monitor context window usage and manage long conversations.

Features

  • 🟡 Yellow warning at configurable threshold (default: 120k tokens)
  • 🔴 Red critical at configurable threshold (default: 140k tokens)
  • Applies to Context Length and Context Percentage widgets
  • Fully configurable via settings.json

Configuration

{
  "tokenWarnings": {
    "enabled": true,
    "warningThreshold": 120000,
    "criticalThreshold": 140000,
    "showEmojis": true
  }
}

Why Context Warnings?

  • Helps stay aware of context window consumption
  • Useful for managing long conversations and avoiding auto-compact
  • Thresholds are personal preference - defaults (120k/140k) are starting points

Implementation

  • Shared utility function for consistent behavior across context widgets
  • Clean separation of concerns (settings → utility → widgets)
  • Backwards compatible (warnings enabled by default)
  • Tested locally with various threshold values

Closes #38

- Add threshold-based visual warnings to context widgets
- Yellow warning at 120k tokens (⚠️ + bold)
- Red critical at 140k+ tokens (🔴 + bold + background)
- Applies to Context Length and Context Percentage widgets
- Fully configurable via settings.json
- Options: enable/disable, custom thresholds, emoji toggle
- Shared utility function for consistent behavior
- Defaults (120k/140k) are starting points - users adjust to preference
- Helps manage context window usage and avoid auto-compact
zoonderkins added a commit to zoonderkins/ccstatusline that referenced this pull request Jan 21, 2026
Merged PRs:
- sirmalloc#138: fix: support bare repo worktrees in GitWorktree widget
- sirmalloc#135: feat: add git-indicators widget
- sirmalloc#132: fix: Windows terminal width detection
- sirmalloc#131: feat: Task Timer widget
- sirmalloc#123: feat: Add backups for settings.json
- sirmalloc#121: feat: Add configurable context warning alerts
- sirmalloc#120: feat: Add Mercurial support
- sirmalloc#119: feat: Add Git Root Dir widget
- sirmalloc#58: feat: Add support for local/project settings

Fixes Issues:
- sirmalloc#117: Windows tput cols creates null file
- sirmalloc#122: claude's settings.json deleted/lost
- sirmalloc#112: Add mercurial support

Additional fixes:
- Resolved circular dependency in renderer.ts/widgets.ts
- Fixed lint errors in multiple files
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.

Add dynamic color feature based on widget values

1 participant