* feat(#1928): remove sunset gemini cli runtime, redirect to antigravity Google sunset Gemini CLI on 2026-06-18; Antigravity CLI is its official successor (already a first-class GSD runtime). Remove the gemini runtime from the enum (16->15), aliases, labels, config-home fragment, install path, converters (convertClaudeToGemini{Markdown,Toml,Agent}, convertSlashCommandsToGeminiMentions), capability descriptor, gemini-extension.json, RULESET.GEMINI.*, and the interactive menu (renumbered, no gap). --gemini now prints an explicit deprecation notice citing the 2026-06-18 sunset and redirects to --antigravity (no silent alias, per the issue's Hyrum's-Law rejection). Antigravity is preserved throughout: its GEMINI.md contextFileName, .gemini/antigravity config home, the shared convertGeminiToolName/claudeToGeminiTools tool vocabulary, and the 'gemini' hookEvents dialect it declares. GEMINI.md retargeted as Antigravity's context file. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * chore(#1928): backfill changeset PR number (#1996) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * chore(#1928): drop Gemini CLI from issue templates (review nit) Removes the sunset Gemini CLI runtime from the two GitHub issue-template runtime lists that the removal PR missed, per @davesienkowski's review nit: - feature_request.yml: 'Applicable runtimes' checkbox (a user could otherwise request a feature for a runtime GSD no longer supports) - bug_report.yml: 'Runtime' dropdown + the stale ~/.gemini/settings.json retrieval-help line Leaves the post-removal templates fully consistent with the Antigravity redirect. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
81 lines
2.8 KiB
Markdown
81 lines
2.8 KiB
Markdown
# Context Window Monitor
|
|
|
|
A post-tool hook (`PostToolUse` for Claude Code, `AfterTool` for Antigravity CLI) that warns the agent when context window usage is high.
|
|
|
|
## Problem
|
|
|
|
The statusline shows context usage to the **user**, but the **agent** has no awareness of context limits. When context runs low, the agent continues working until it hits the wall — potentially mid-task with no state saved.
|
|
|
|
## How It Works
|
|
|
|
1. The statusline hook writes context metrics to `/tmp/claude-ctx-{session_id}.json`
|
|
2. After each tool use, the context monitor reads these metrics
|
|
3. When remaining context drops below thresholds, it injects a warning as `additionalContext`
|
|
4. The agent receives the warning in its conversation and can act accordingly
|
|
|
|
## Thresholds
|
|
|
|
| Level | Remaining | Agent Behavior |
|
|
|-------|-----------|----------------|
|
|
| Normal | > 35% | No warning |
|
|
| WARNING | <= 35% | Wrap up current task, avoid starting new complex work |
|
|
| CRITICAL | <= 25% | Stop immediately, save state (`/gsd-pause-work`) |
|
|
|
|
## Debounce
|
|
|
|
To avoid spamming the agent with repeated warnings:
|
|
- First warning always fires immediately
|
|
- Subsequent warnings require 5 tool uses between them
|
|
- Severity escalation (WARNING -> CRITICAL) bypasses debounce
|
|
|
|
## Architecture
|
|
|
|
```
|
|
Statusline Hook (gsd-statusline.js)
|
|
| writes
|
|
v
|
|
/tmp/claude-ctx-{session_id}.json
|
|
^ reads
|
|
|
|
|
Context Monitor (gsd-context-monitor.js, PostToolUse/AfterTool)
|
|
| injects
|
|
v
|
|
additionalContext -> Agent sees warning
|
|
```
|
|
|
|
The bridge file is a simple JSON object:
|
|
|
|
```json
|
|
{
|
|
"session_id": "abc123",
|
|
"remaining_percentage": 28.5,
|
|
"used_pct": 71,
|
|
"timestamp": 1708200000
|
|
}
|
|
```
|
|
|
|
## Integration with GSD
|
|
|
|
GSD's `/gsd-pause-work` command saves execution state. The WARNING message suggests using it. The CRITICAL message instructs immediate state save.
|
|
|
|
## Setup
|
|
|
|
Both hooks are registered automatically during `npx @opengsd/gsd-core` installation — no manual steps are needed under normal circumstances. For hook configuration details, threshold overrides, and manual registration examples, see [Configuration](CONFIGURATION.md).
|
|
|
|
As a brief reference: the statusline hook registers as `statusLine` in `settings.json`; the context monitor (`gsd-context-monitor.js`) registers as a `PostToolUse` hook (or `AfterTool` for Antigravity CLI). Both entries use the absolute Node executable path that ran the installer. On Windows PowerShell, prefix quoted executable paths with `&`.
|
|
|
|
## Safety
|
|
|
|
- The hook wraps everything in try/catch and exits silently on error
|
|
- It never blocks tool execution — a broken monitor should not break the agent's workflow
|
|
- Stale metrics (older than 60s) are ignored
|
|
- Missing bridge files are handled gracefully (subagents, fresh sessions)
|
|
|
|
---
|
|
|
|
## Related
|
|
|
|
- [Architecture](ARCHITECTURE.md)
|
|
- [Configuration](CONFIGURATION.md)
|
|
- [docs index](README.md)
|