pi-a2a

pi-a2a is a skill for Claude Code, Codex from espennilsen/pi. It costs 0 tokens per session (1,959 once invoked), scanned A, original, MIT.

A task runner for work that may take hours or days, including data processing, batch operations, research, and external service jobs.

In plain words
What is it for?
Use it for large datasets, multiple external API calls, aggregation tasks, or other A2A tasks that need more than a short interactive session.
Why use it?
It avoids normal time limits stopping long or unpredictable work and can resume tasks after the Pi process restarts.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/espennilsen/pi/pi-a2a
Any agent
npx skills add espennilsen/pi --skill pi-a2a
Clone the repo
git clone --depth 1 https://github.com/espennilsen/pi

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for pi-a2a

README.md
[![agentmods](https://agentmods.dev/badge/skills/espennilsen/pi/pi-a2a.svg)](https://agentmods.dev/skills/espennilsen/pi/pi-a2a)
Your own site
<a href="https://agentmods.dev/skills/espennilsen/pi/pi-a2a"><img src="https://agentmods.dev/badge/skills/espennilsen/pi/pi-a2a.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,959 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.01959
Opus 5 $0.00000 $0.00979
Sonnet 5 $0.00000 $0.00392
Haiku 4.5 $0.00000 $0.00196

Measured 6d ago against content hash f970d2af2ad0, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

pi-a2a scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

The scan reads SKILL.md. This mod also ships 34 executable files (agent-card-auth.test.ts, agent-card.ts, agent-executor.ts, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

extensions/pi-a2a/SKILL.md · 289 lines

How it starts

The opening of the file, as written. The whole thing — 289 lines — stays where its author put it; the contents beside it link to each section on GitHub.

pi-a2a Long-Running Tasks Skill

Overview

The pi-a2a extension supports long-running tasks that can execute for hours or days without timeouts. This is essential for:

  • Data processing pipelines
  • Batch operations
  • Research and aggregation tasks
  • External API jobs with unpredictable duration
  • Any A2A task that exceeds the standard timeout

When to Use

Use long-running tasks when:

  • Task execution time is unpredictable or known to exceed 10 minutes
  • The remote agent is processing large datasets
  • Task involves multiple external API calls
  • You want the task to survive Pi restarts

Don't use for:

  • Quick queries (< 5 minutes)
  • Interactive conversations
  • Tasks requiring immediate feedback

Configuration

Enable in settings.json:

{
  "pi-a2a": {
    "longRunningTasks": {
      "enabled": true,
      "maxTaskAgeHours": 168,
      "resumeRetryAttempts": 3,
      "resumeRetryDelayMs": 5000,
      "pollingIntervalMs": 300000
    }
  }
}
```text

### Configuration Options

| Option | Type | Default | Description |
|--------|------|---------|-------------|
| `enabled` | boolean | `false` | Enable long-running task support |
| `maxTaskAgeHours` | number | `168` (7 days) | Maximum task retention period |
| `resumeRetryAttempts` | number | `3` | Retry attempts for resume failures |
| `resumeRetryDelayMs` | number | `5000` | Delay between retries |
| `pollingIntervalMs` | number | `300000` (5 min) | Hub polling interval |

## How It Works

### Architecture

┌─────────────────────────────────────────────────────────────┐ │ 1. Task Initiated │ │ - Task state saved to SQLite │ │ - Session ID assigned │ │ - Agent continues other work │ └─────────────────────────────────────────────────────────────┘ ↓ ┌─────────────────────────────────────────────────────────────┐ │ 2. Background Polling (every 5 min) │ │ - Checks hub for task completion │ │ - Detects state changes │ └─────────────────────────────────────────────────────────────┘ ↓ ┌─────────────────────────────────────────────────────────────┐ │ 3. Task Completes │ │ - State updated in SQLite │ │ - Resume request queued │ └─────────────────────────────────────────────────────────────┘ ↓ ┌─────────────────────────────────────────────────────────────┐ │ 4. Smart Resume Queue │ │ - Waits for agent to be idle │ │ - Processes one request at a time │ │ - Validates session ID (prevents stale callbacks) │ └─────────────────────────────────────────────────────────────┘ ↓ ┌─────────────────────────────────────────────────────────────┐ │ 5. Response Delivered │ │ - Completion message injected into chat │ │ - Task result available │ └─────────────────────────────────────────────────────────────┘

Read the full file on GitHub · 289 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 289 lines · 0 tokens per session scan A f970d2af2ad0

Subscribe to this mod's changes

pi-a2a is a skill published in the GitHub repository espennilsen/pi (117 stars, last pushed 13d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,959 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.