CodePulse v2.3.176 - /agents start <agent-name> dispatches as a named subagent
v2.3.176 closes the Telegram-side subagent loop. /agents start now accepts an optional <agent-name> prefix — if the first word matches a custom subagent installed under .claude/agents/ or $CLAUDE_CONFIG_DIR/agents/, the background Claude Code session runs as that subagent. Bare agent names with no prompt are rejected with a usage hint instead of silently dispatching the name as a literal prompt, and the chat-context guard added to /agents pin / /agents refresh now also protects /agents start.
The headline change
v2.3.172 added /agents templates so you could discover which custom Claude Code subagents are installed on your machine. v2.3.176 closes the loop: typing the agent's name as the first word of /agents start now dispatches the background session as that subagent.
/agents templates → lists installed subagents
/agents start adversarial-reviewer audit the auth flow → 🟢 Dispatched: cafe1234
Agent: adversarial-reviewer
Same Telegram surface, same /agents peek / /agents log / /agents stop lifecycle — the session is just running under a named subagent persona instead of as a generic background invocation.
What landed in v2.3.176
/agents start [<agent-name>] <prompt>— if the first whitespace-separated token matches a name found by the samediscoverAgents()walk that powers/agents templates, it is peeled off and passed to the bridge asclaude --bg --agent <name> -- "<prompt>". Unknown leading tokens fall through to plain dispatch — exact v2.3.170 behaviour preserved, no breaking change.- Bare agent name rejection —
/agents start reviewer(a known agent name with no prompt) used to silently dispatch a Claude session whose literal prompt was the string"reviewer". v2.3.176 catches this and replies withPrompt required for agent reviewer. Usage: /agents start reviewer <prompt>instead. - Chat-context early-exit —
/agents startnow bails immediately onctx.chat?.id === undefined, matching the guard/agents pinand/agents refreshalready had. Prevents spurious background dispatches from channel posts and business messages where there's no addressable Telegram surface. - Refined
/helpand/agentsusage text — both surfaces now agree on the pin vs refresh empty-fleet distinction (refresh always rotates the message id, pin skips when no active agents), and document the new[<agent-name>]syntax.
How it feels
/agents templates → lists every installed subagent with scope + summary
/agents start adversarial-reviewer audit the new auth flow
→ 🟢 Dispatched: cafe1234
Agent: adversarial-reviewer
Prompt: audit the new auth flow
/agents start review the latest commit
→ 🟢 Dispatched: feed5678
(no Agent line — plain dispatch, since "review" is not a known subagent)
/agents start reviewer → Prompt required for agent reviewer.
Usage: /agents start reviewer <prompt>
The agent prefix resolution uses the same project-cwd that /agents templates uses: the active project root in multi-project forum topics, the global CLAUDE_WORKING_DIR in single-project mode. Project-scope agents (.claude/agents/ walking up from cwd) and user-scope agents ($CLAUDE_CONFIG_DIR/agents/ or ~/.claude/agents/) are both matchable.
Under the hood
AgentsCommands.start() was restructured so the cheap local-FS work happens first and the expensive bridge subprocess happens last. The order is now: empty-input guard → cwd resolve → discoverAgents() (local FS walk) → agent-name peel or bare-name reject → < 4 char prompt guard → cliCompatible CLI version check → dispatch. That ordering means a too-short prompt or a bare-agent-name typo short-circuits before spawning a claude subprocess just to surface an error.
The change went through three rounds of adversarial review. Round 1 surfaced four medium-severity issues (the bare-name silent dispatch, divergent help text, a missing multi-project-DM caveat, and a duplicate cwd fallback); round 2 caught the missing chat-context guard and two low-severity items; round 3 was clean. Eight new tests in agents-commands.test.ts lock in each behaviour (the bare-name rejection, the back-compat fall-through, the agent-name escape under HTML injection, the chat-context bail, the case-sensitivity contract, and the cliCompatible ordering). Full suite: 3513 passed, 1 skipped.
Why this matters
The Claude Code subagent system is what lets you compose specialised, scoped helpers — adversarial-reviewer, release-documenter, frontend-dev-expert, your own — without polluting the parent session's context. Until v2.3.176, you could see those subagents from Telegram (/agents templates) but couldn't actually launch one without bouncing out to a terminal. Now the full loop — discover, dispatch, observe, complete — lives in chat.
The release was itself the first end-to-end test of the new feature: /agents start release-documenter ... was the command that produced this entry in docs/RELEASES.md. Auto-shipped by the release pipeline; existing installs receive the update on their next poll.