pb-new-agent-session

pb-new-agent-session is a skill for Claude Code, Codex from agentproto/ts. It costs 68 tokens per session (1,113 once invoked), scanned A, original, Apache-2.0.

A procedure for starting one worker agent, giving it instructions, checking its result, and shutting down its session. A worker agent is a separate AI process assigned a specific task.

In plain words
What is it for?
It is for sending a single task to another agent, following up when needed, verifying the result, and cleaning up the session.
Why use it?
It keeps delegated work controlled from start to finish and prevents abandoned agent sessions from being left running.

Skill for Claude CodeCodex

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

Good fit It is for sending a single task to another agent, following up when needed, verifying the result, and cleaning up the session.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/agentproto/ts/pb-new-agent-session
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.

Any agent
npx skills add agentproto/ts --skill pb-new-agent-session
Clone the repo
git clone --depth 1 https://github.com/agentproto/ts

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 pb-new-agent-session

README.md
[![agentmods](https://agentmods.dev/badge/skills/agentproto/ts/pb-new-agent-session/github.svg)](https://agentmods.dev/skills/agentproto/ts/pb-new-agent-session)
Your own site
<a href="https://agentmods.dev/skills/agentproto/ts/pb-new-agent-session"><img src="https://agentmods.dev/badge/skills/agentproto/ts/pb-new-agent-session/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for pb-new-agent-session

Your own site · 80×15
<a href="https://agentmods.dev/skills/agentproto/ts/pb-new-agent-session"><img src="https://agentmods.dev/badge/skills/agentproto/ts/pb-new-agent-session.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 68 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,113 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.00068 $0.01113
Opus 5.5 $0.00027 $0.00445
Sonnet 5.5 $0.00014 $0.00223
Haiku 4.5 $0.00007 $0.00111

Measured 1mo ago against content hash 0b4fcf4f1d2e, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

pb-new-agent-session 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 1mo ago.

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.

packages/skill-pack-agentproto/src/skills/pb-new-agent-session/SKILL.md · 112 lines

How it starts

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

pb-new-agent-session — spawn a worker and drive it to a result

Goal

One delegated task, one session: pick the adapter and model, spawn the worker with a self-contained brief, wait for its turn to end, read and verify the result, then kill the session so the tree stays clean.

Prerequisites (reference by name, not re-explained here): ap-spawn-agent, ap-read-output, ap-wait-fanin, ap-lifecycle, ap-models-auth, ap-adapters. The family map is the agentproto skill; the cheap-model picking guidance lives in the cheap-coders group.

Steps

1. Pick the adapter and model

  • Cheap bulk work: hermes + z-ai/glm-5.3-flash, billed through the openrouter-env access profile. Note: hermes has NO built-in file/shell tools.
  • Work that must edit files or run commands natively: claude-code (Read, Write, Bash, Edit are built in — no gateway mount needed).
  • Check what is installed before choosing (adapter listing from ap-adapters); model eligibility and access profiles go to ap-models-auth.

2. Take the event cursor BEFORE spawning

Grab a cursor first so the spawn event cannot slip past your wait:

session_events_poll({})

Use the returned nextCursor in every later session_monitor call. Events emitted before this first poll are returned immediately with since, so the ordering is race-free.

3. Spawn with a self-contained brief

The child knows nothing about your conversation — put paths, constraints, deliverable, and done-criteria in the prompt:

agent_start({
  adapter: 'hermes',
  model: 'z-ai/glm-5.3-flash',
  cwd: '<ABSOLUTE host path>',
  label: 'worker-audit',
  access: { profileRef: 'openrouter-env' },
  mcpServers: [{ name: 'agentproto', transport: 'http', ref: 'http://127.0.0.1:18790/mcp' }],
  prompt: '<self-contained brief: goal, exact file paths, constraints>'
})

For claude-code, drop mcpServers (native tools) and keep the rest. The call returns the session id — keep it with the label.

Read the full file on GitHub · 112 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. 1mo ago Changed · +1 lines 0b4fcf4f1d2e
  2. 1mo ago First seen · 111 lines · 68 tokens per session scan A f299118b9e05

Subscribe to this mod's changes

pb-new-agent-session is a skill published in the GitHub repository agentproto/ts (10 stars, last pushed yesterday), licensed Apache-2.0. It adds 68 tokens to every session and 1,113 once invoked, about $0.0003 per session on Opus 5.5. 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-09-04.