environment

Manage persistent variables, session history, and worker delegation in pi-extensions code-mode.

8|Updated Mar 22, 2026
One-click install
npx skills add https://github.com/Cygnusfear/pi-extensions --skill environment-cygnusfear
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: environment
Source: https://github.com/Cygnusfear/pi-extensions/tree/main/skills/environment
Command: npx skills add https://github.com/Cygnusfear/pi-extensions --skill environment-cygnusfear

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It solves the confusion and context-loss that happens when agents need to coordinate code-mode execution, persistent working memory, fast search, and reliable multi-agent delegation inside the pi-extensions environment.

Core Features & Use Cases

  • Code-mode execution model: Uses a single execute_code block paradigm for reading, editing, searching, and running commands without wasting turns.
  • Persistent working memory with $: Keeps variables alive across code blocks and protects key data with $.__pin against eviction.
  • Session-history retrieval with ouija: Searches prior and dead sessions to recover decisions and raw conversational context, not just summaries.
  • Delegation orchestration with teams: Spawns worker agents with templates, then waits correctly using teams.on events (no sleep-polling).
  • Context management and guardrails: Provides explicit rules to avoid TUI freezes, block timeouts, and supervisor spam.

Quick Start

Use the environment skill to coordinate code-mode work by running your JavaScript block with $ state, searching prior context with ouija when needed, and delegating parallel tasks with teams while waiting via teams.on.

Frequently Asked Questions about environment

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I keep variables alive across code blocks during multi-agent code execution?

Persistent working memory is maintained by using the $ state variable, which keeps data alive across execute_code blocks and allows pinning critical data with $.__pin to prevent eviction during long-running tasks.

What is the best way to coordinate parallel worker agents without causing context blowups?

Parallel worker agents are coordinated by spawning them with templates and waiting via teams.on events, applying guardrails and supervise(false) to prevent context blowups, TUI freezes, and supervisor spam.

How can I recover raw conversational context from prior or dead sessions?

Prior session memory is recovered by searching dead sessions with ouija, which retrieves raw conversational context and past decisions rather than just summaries for effective debugging.

Why does my agent lose context when running long shell orchestration tasks?

Context loss occurs when not following the execute_code paradigm or using $ for cross-block persistence; managing safe long-running shell orchestration requires explicit guardrails against block timeouts.

Can I run safe parallel code-mode workflows without sleep-polling background tasks?

Safe parallel code-mode workflows run without sleep-polling by delegating tasks with teams and correctly waiting via teams.on events, preventing TUI freezes and supervisor spam.

When do I need to pin variables during async orchestration in code-mode?

Variables should be pinned with $.__pin during async orchestration when protecting key data against eviction, ensuring persistent working memory survives across multiple execute_code blocks.