Feature Request: Context Threshold Hooks

Resolved 💬 3 comments Opened Jan 1, 2026 by triphase-physics Closed Jan 4, 2026

Current Limitation

Hooks only fire reactively - PreCompact triggers when context is already at ~95% and compaction is imminent. There is no way to proactively monitor context usage or fire hooks at earlier thresholds.

Requested Features

1. Add context percentage to hook input data

  • Include in all hooks, or at minimum PreCompact
  • Fields: , ,

2. Add new ContextThreshold hook event

  • Fires at user-configurable percentages (e.g., 80%, 90%)
  • Multiple thresholds can be configured
  • Fires ONCE per threshold per session (not repeatedly)

Use Case

I use PreCompact to auto-save full session transcripts before compaction. This works, but I would prefer to save proactively at 80% context rather than reactively at 95%. This gives buffer room and allows the save to happen while there is still working space for Claude to complete current tasks.

Proposed Implementation

Hook input would include:

Benefits

  • Proactive session management vs reactive-only
  • Users can save/backup at comfortable thresholds
  • PreCompact remains as safety net at ~95%
  • Better user control over context lifecycle
  • Enables early warning notifications

---
Submitted by: MIS (Magnetic Innovative Solutions LLC)

View original on GitHub ↗

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