nicobailon/pi-boomerang

Token-efficient autonomous task execution with context collapse for pi coding agent

What it solves

Long autonomous coding tasks often consume massive amounts of context tokens, which can lead to performance issues or trigger "scarcity mindset" in AI agents, causing them to rush or skip steps. This extension solves this by automatically condensing the raw history of a completed task into a concise, high-level summary.

How it works

When you trigger a task, the agent performs the work autonomously. Once finished, the extension replaces the detailed, token-heavy turn history with an expanded "handoff summary" containing changed files, relevant reads, command results, and the final outcome. This summary is then fed to the agent for subsequent steps, keeping the context window clean while preserving the actual file changes on your disk.

Who it’s for

It is designed for users of the pi coding agent who perform complex, multi-step, or iterative coding tasks and want to maintain high-quality agent performance without hitting token limits or cluttering their session history.

Highlights

  • Token Efficiency: Replaces raw turn history with compact summaries to save context space.
  • Chain Execution: Supports running multiple prompt templates in sequence with a single summary at the end.
  • Rethrow Capability: Allows running a task multiple times (up to 999) with automatic summarization between each pass.
  • Anchor Mode: Enables grouping multiple tasks under a single summary point for better context management.
  • Agent-Callable Tool: Can be enabled as a tool for the agent to use autonomously based on specific guidance.

Related

  • Project
  • Project
  • Project
  • Project