max-context

Pi extension to keep context usage near a configurable soft limit

Packages

Package details

extension

Install max-context from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:max-context
Package
max-context
Version
1.0.2
Published
Jun 12, 2026
Downloads
not available
Author
indie-arch
License
unknown
Types
extension
Size
10.4 KB
Dependencies
0 dependencies · 3 peers
Pi manifest JSON
{
  "extensions": [
    "./extensions"
  ]
}

Security note

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

README

max-context

Pi extension to keep context usage near a configurable soft limit with a /max-context command.

Usage

  • /max-context 256k
  • /max-context 128000
  • /max-context 1.5m
  • /max-context off

When enabled, the extension auto-compacts after a prompt finishes if context usage approaches the configured limit. If you send the next prompt while compaction is still needed or running, the extension queues that prompt and replays it after compaction completes.

This is a soft limit: Pi's compaction settings, current model, system prompt, tools, and recent messages determine the final context size.

Install

pi install npm:max-context

Or install from GitHub:

pi install git:github.com/indie-arch/max-context