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,095 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

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/agentproto/ts/pb-new-agent-session
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.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.svg" alt="Measured on agentmods" 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,095 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 $0.00068 $0.01095
Opus 5 $0.00034 $0.00548
Sonnet 5 $0.00014 $0.00219
Haiku 4.5 $0.00007 $0.00110

Measured yesterday against content hash f299118b9e05, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 yesterday.

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 · 111 lines

How it starts

The opening of the file, as written. The whole thing — 111 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 · 111 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. yesterday 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 (5 stars, last pushed today), licensed Apache-2.0. It adds 68 tokens to every session and 1,095 once invoked, about $0.0003 per session on Opus 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.

Related

Other skills, from other repositories

markedit-tools

Provides tools for managing MarkEdit, a macOS markdown editor.

sammcj/agentic-coding · 16 tokens

differed-task-execution

Delays execution of a task until a specified time or after a duration. Use when the user asks to run something later, in X minutes/hours, at a specific time, schedule a command, or defer work to a future point.

sammcj/agentic-coding · 55 tokens

herdr

Control Herdr, a terminal multiplexer for coding agents. Use only when the user explicitly asks to you use or configure Herdr.

sammcj/agentic-coding · 29 tokens

strands-review

Local preview of the strands-agents/devtools /strands review agent. Body is the upstream Task Reviewer SOP verbatim — do not paraphrase. Use when the user types /strands-review, asks for a "strands review" of a PR, or wants to anticipate what the remote /strands review GitHub Action will flag. Findings are close but…

strands-agents/harness-sdk · 125 tokens

docs-reviewer

Review documentation drafts for voice consistency, structure, and terminology before PR submission. Use after completing a draft, when checking if docs are ready to ship, or automatically after docs-writer produces output. Also triggers on "review this draft", "check my docs", "is this ready to ship", "review before…

strands-agents/harness-sdk · 68 tokens

docs-writer

Draft or rewrite Strands Agents documentation pages. Use when writing new doc pages, rewriting pages that failed audit, drafting sections for existing pages, or writing blog posts and release notes about Strands. Also triggers on "write a doc", "draft a page", "rewrite the quickstart", "add a tutorial for X"…

strands-agents/harness-sdk · 74 tokens