@giladbarnea/pi-context-auto-heads-up

Give Pi agents context-window heads-ups at 50%, 75%, and 90% usage.

Packages

Package details

extension

Install @giladbarnea/pi-context-auto-heads-up from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@giladbarnea/pi-context-auto-heads-up
Package
@giladbarnea/pi-context-auto-heads-up
Version
0.0.2
Published
Aug 31, 2026
Downloads
401/mo · 401/wk
Author
giladbarnea
License
MIT
Types
extension
Size
9.9 KB
Dependencies
0 dependencies · 1 peer
Pi manifest JSON
{
  "extensions": [
    "./index.ts"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

pi-context-auto-heads-up

Keep the agent aware of its remaining context window.

pi extension npm version tests license

Long coding sessions can run out of context before the work is done. This Pi extension gives the agent one hidden heads-up when usage crosses 50%, 75%, or 90%.

The agent gets the guidance inside its model context. The user sees only a small notification that names the crossed threshold.

Install

pi install npm:@giladbarnea/pi-context-auto-heads-up

Run /reload in an existing Pi session after installation.

What each heads-up does

Usage Guidance
50% Compare progress with remaining context. Consider delegating noisy read-only work.
75% Inform the user when substantial work remains. Delegate more implementation work.
90% Warn the user and other agents. Write a handoff when unattended. Move direct work to fresh agents.

The wording is intentionally opinionated. It treats delegation and handoffs as context-management tools, not as automatic responses to every large task.

Behavior

  • Each threshold fires once per upward crossing.
  • A jump across several thresholds emits only the highest crossed threshold.
  • Compaction clears a pending heads-up and lets a later upward crossing fire again.
  • Mid-run heads-ups are checked after Pi's compaction decision, so the agent never receives a stale percentage.
  • Resuming a session starts from its current percentage. The extension does not emit retrospective heads-ups.

Development

npm ci
./setup.sh
npm run check
npm pack --dry-run

See DEVELOPMENT.md for the release process and manual test flow.