Feature request: warn user when context window is nearly full

Resolved 💬 3 comments Opened Apr 16, 2026 by davids-jumper Closed May 25, 2026

Preflight Checklist

  • [x] I have searched existing requests and this feature hasn't been requested yet
  • [x] This is a single feature request (not multiple features)

Problem Statement

## Summary

Add a configurable warning when the context window reaches a threshold (e.g. 90%),
so users can proactively document and compact before hitting the limit mid-conversation.

## Problem

Currently there is no signal that context is running low until auto-compaction kicks
in. By that point, nuance from the active conversation (in-progress design decisions,
debugging context, session-specific state) may already be lost. The only option is to
manually run /context and estimate remaining capacity.

Proposed Solution

## Proposed solution

A setting in Claude Code's config like:

{
"contextWarningThreshold": 0.9
}

When the context window reaches that fraction, Claude would proactively notify the user:

⚠️ Context window is ~90% full. Consider /compact or documenting before auto-compaction.

Alternatively, surfaced as a status line indicator or a hook event (context_window_warning)
that users could wire to custom scripts.

Alternative Solutions

Why it matters

Users working on long sessions benefit from a clean handoff — documenting decisions to
memory or CLAUDE.md before compacting. Without a warning, they either over-monitor
manually or lose context abruptly.

## Alternatives considered

  • Periodic manual /context checks — works but requires the user to remember
  • Auto-compact with summary — already exists, but fires too late for intentional documentation

Priority

High - Significant impact on productivity

Feature Category

CLI commands and flags

Use Case Example

_No response_

Additional Context

_No response_

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗