github Ruya-AI/cozempic v1.0.1
v1.0.1 — 1M context window detection

latest releases: v1.8.39, v1.8.38, v1.8.37...
8 months ago

1M context window detection

Claude Code appends [1m] to model IDs when using extended 1M context (e.g. claude-opus-4-6[1m]). Without this fix, the guard was firing at 150K tokens on a 1M session instead of 750K — triggering unnecessary prunes every few minutes and showing misleading diagnostics (50% context when it's actually 10%).

Changes

  • Auto-detection: [1m]-suffixed model IDs now map to 1M context window. Bracket-aware prefix matching handles versioned IDs like claude-opus-4-6-20260301[1m].
  • Guard banner: shows detected context window (Context: 1.0M or 200K)
  • Scaled thresholds: token thresholds now correctly compute as 75%/45% of 1M (750K/450K) instead of 200K defaults
  • Overflow scaling: danger thresholds scale with context window size so reactive recovery doesn't trigger too early on large sessions
  • Smarter hook: SessionStart hook now reads context_window_size directly from Claude Code's stdin JSON and passes it to the guard — no inference needed

Zero breaking changes. 200K sessions are unaffected. COZEMPIC_CONTEXT_WINDOW env var still takes highest priority.

Contributor: @ynaamane (PR #20)

Don't miss a new cozempic release

NewReleases is sending notifications on new releases.