sugarforever

Pi Durable Subagents — Development skill for Claude Code

Development community

Foreground and persistent background subagent extensions for Pi Durable.

How to install Pi Durable Subagents

This entry records only its repository, not the path inside it, so there is no exact command to give. Open sugarforever/pi-durable-subagents and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Pi Durable Subagents does

Foreground and persistent background subagent extensions for Pi Durable.

Alternatives in Development

  • Income Investment — Income Investment: Durable and Opportunistic Distribution Analysis 15.9k ★
  • Getspecstory — Extensions for GH Copilot, Cursor, and Claude Code 1.1k ★
  • Purpose — Orient yourself in pi-vs-cc — a collection of Pi coding agent extensions and agent specs that progressively de 527 ★

README

@sugarforever/pi-durable-subagents

Subagent extensions for [`@earendil-works/pi-durable`](https://github.com/earendil-works/pi/tree/main/packages/durable).

The package provides two implementations:

  • ForegroundSubagents creates a child Conversation, waits for its answer, and returns the answer as the tool result.
  • BackgroundSubagents manages named, persistent child Conversations and reports their answers back to the parent through durable Reporter tasks.

Pi Durable is an embedded TypeScript SDK. Install this package with npm and register the selected extension in your application's Registry. Pi coding agent's `pi install` command does not register extensions in a Pi Durable Harness.

Requirements

  • Node.js 22.19 or newer
  • @earendil-works/pi-durable 1.2.x
  • @earendil-works/pi-ai 1.2.x
  • @earendil-works/chord 1.2.x

Install

npm install @sugarforever/pi-durable-subagents \
  @earendil-works/pi-durable \
  @earendil-works/pi-ai \
  @earendil-works/chord

Foreground subagents

Use the foreground extension when the parent must wait for the delegated answer before it can continue.

import { createRegistry, Harness } from "@earendil-works/pi-durable";
import { ForegroundSubagents } from "@sugarforever/pi-durable-subagents";

const registry = createRegistry();
registry.install(ForegroundSubagents);

const harness = await Harness.open(
  storage,
  {
    models,
    registry,
    settings: { toolExecution: "parallel" },
  },
  context,
);

The extension exposes one tool:

subagent({ task })

Each tool call creates an independently configured child Conversation. The child inherits the parent's Agent configuration, then removes `ForegroundSubagents` so it cannot recursively delegate again. A stable request ID and task ownership let replay-safe execution reuse the original child and submission after a restart.

Run the complete example with an OpenAI API key:

OPENAI_API_KEY=... npm run example:fo