SLOPSHOPPER

timer-spawn-probe

Throwaway probe for the factory loop: can an agent a mod spawns from a timer call that mod's own tool?

newguardcommandtoolprocesstimer
A shopper browsing a rack in a slop shop
Preview · a replayed session in a sandbox
claude · ~/work/app · timer-spawn-probe
› fix the failing auth test and add an audit log call ⏺ Read(src/auth.ts) ⎿ Read 6 lines ⏺ Update(src/auth.ts) ⎿ Added 2 lines, removed 1 line ⏺ Bash(bun test) ⎿ 3 pass, 1 fail ● Done. refresh now rejects expired claims and logs an audit event. ✻ Worked for 42s · done 4:20 PM › /timer-spawn-probe ⎿ timer-spawn-probe: timer-spawn-probe: one agent spawned from this hook, one from a timer; see log.jsonl ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── › ? for shortcuts
README

dev-system

Run autonomous coding agents on any repo, from issue to merged pull request, with one shared, versioned setup. It is for people who want to hand work to Claude Code (or codex) from a phone or a browser and come back to a reviewed PR, without keeping a shell open on any machine.

How it works

  • Every agent environment is its own container. The same image runs as a desktop dev container, under docker run, on Kubernetes or as a Coder workspace. In an orchestrator container, tmux holds one Claude session and a supervisor restarts it when it exits. dev-system is not a tmux multiplexer running many terminals on one machine; you scale out by running more containers.
  • Two ways to give it work.
  • Talk to a persistent orchestrator session in the Claude app (via Remote Control). It stays alive across restarts, so you come back to it and dispatch work from anywhere.
  • Label a GitHub issue ready. The orchestrator session watching the repo delegates design and implementation to sub-agents, which work in git worktrees and open PRs through the no-mistakes pipeline.
  • Sub-agents do the work inside the orchestrator's container. Each issue goes to a sub-agent in its own worktree; the orchestrator does not start new containers.
  • You never need a shell on the host. Logins, sessions and approvals happen from the Claude app or a link on your phone.

Architecture

Three layers, each pinned independently:

  • Agent behaviour - the callum-flow plugin in plugins/callum-flow/: the skills and hooks that turn issues into PRs. Beside it, the opt-in factory-hud mod shows usage and factory counts on every client, the phone included.
  • Environment - the base image in images/base/: the tools, headless Claude with Remote Control, logins and persistent state.
  • Repo config - templates/ synced into each repo by callum-dev, so a repo pins a version and pulls updates.
flowchart LR
  app["Claude app<br/>(Remote Control)"] --> orch
  gh["GitHub issue<br/>labelled ready"] --> orch
  subgraph c1["Container: orchestrator (one per repo)"]
    orch["Orchestrator session<br/>(one supervised Claude)"]
    orch --> w1["Sub-agent<br/>worktree A"]
    orch --> w2["Sub-agent<br/>worktree B"]
  end
  subgraph c2["Container: hands-on workspace"]
    ws["Remote Control server<br/>(own worktree per new session)"]
  end
  app --> ws
  w1 --> pr["Pull requests<br/>(no-mistakes pipeline)"]
  w2 --> pr
  ws --> pr

Containers are independent and sit side by side. See docs/architecture.md for the layers, versioning and the runtime map.

Typical flows

Dispatch from a phone

  1. Open the repo's orchestrator session in the Claude app.
  2. Describe the work or point at an issue.
  3. The orchestrator hands it to a sub-agent in a fresh worktree.
  4. The pipeline reviews, tests and opens a PR; the orchestrator verifies and merges it, asking you when an owner decision is needed.

Label an issue ready

  1. Write the issue and add the ready label.
  2. The orchestrator session picks it up and delegates design and implementation to sub-agents. Large or high-risk issues follow the designer's split rules.
  3. The implementation sub-agent works in a worktree; the no-mistakes pipeline gates the change and opens a PR linked to the issue. The orchestrator then verifies and merges it.

What's included

  • An environment that runs anywhere - one image for desktop, docker run, Kubernetes and Coder (images/base/).
  • Agents you drive without a shell - headless Claude with Remote Control, restarted when it exits (images/base/).
  • Logins from your phone - sign-in links reach you as a log line, login page or push notification (first-run logins).
  • State that survives rebuilds - logins and tool state live on /persist volumes (runtime storage).
  • An issue-to-PR workflow - issue-orchestrator, implement-issue, /update-dev and /callum-flow:onboard (plugin in plugins/callum-flow/).
  • Repo config that stays current - callum-dev init, update and check (templates/).
  • Coder workspaces - including an orchestrator workspace that resumes across restarts (Coder template reference).
  • Central session history and telemetry - optional session sync to one searchable viewer and OTLP export (images/base/).

Start

New or existing repo: open an agent in the folder and tell it to follow docs/onboarding.md ("make this a dev-system repo"), or, with the callum-flow plugin installed, run /callum-flow:onboard.

By hand:

npm i -D github:cbundy/dev-system#semver:0.x
npx callum-dev init          # then fill every <REPLACE> and commit

Docs

PageRead it for
docs/onboarding.mdMaking a repo a dev-system repo (written for agents)
docs/architecture.mdLayers, versioning, how updates reach repos, the runtime map for debugging
docs/metrics.mdFactory metrics queries and the no-mistakes PostgreSQL mirror
images/base/README.mdThe base image: persistence, dev-init, dev-doctor, Remote Control, logins, agentsview
coder/dev-system/README.mdThe Coder templates: pushing them, parameters, OTLP
docs/developing-on-coder.mdDeveloping dev-system itself from a Coder workspace: logins, and what only CI can verify
templates/README.mdEach template file: what is synced and what the repo owns
RELEASING.mdCutting a release of each layer
Source 1 files
hooks/register.ts 65 lines
1// Throwaway probe for the factory loop (docs/factory-loop/SPEC.md 13, #560, #561): can an agent
2// that a mod spawns with $.agent.spawn call that mod's own tool? The loop's passes run from its
3// timer, so its agents are spawned from a $.clock callback; on Claude Code 2.1.296 and 2.1.299
4// such an agent's call fails in milliseconds with "<plugin> registered the tool ... but no
5// tool.call hook answered this call" and the hook never runs, while the same spawn made inside a
6// command.run hook works. That is why the loop's agents answer through the checked answer script
7// (config answerChannel `script`, a temporary workaround) and not through the registered answer
8// tools (`tool`, the intended design).
9//
10// Run it on each Claude Code upgrade, in a throwaway session:
11//
12//   claude --plugin-dir docs/factory-loop/probes/timer-spawn-probe
13//   /timer-spawn-probe
14//
15// It spawns one agent inside the command's own hook (`hook`, the control) and one from a
16// $.clock.after callback (`timer`, the loop's case); each loads the probe's tool with ToolSearch,
17// calls it and replies with its result. Every observation is one JSON line in
18// ${CLAUDE_CONFIG_DIR:-~/.claude}/timer-spawn-probe/log.jsonl: `spawned` per case, `called` when
19// the tool hook runs (with the caller's agentId), and `answered` with each agent's reply.
20// answerChannel can go back to `tool` once the timer agent's reply is `pong` and its `called`
21// line is there. On 2.1.299 (2026-10-14) the timer agent replied with the engine's refusal above,
22// and no `called` line came.
23import type { EngineInterface, Register } from 'claude-code'
24
25const ASK = 'Use ToolSearch with query select:mcp__timer-spawn-probe__ping, then call mcp__timer-spawn-probe__ping with {} and reply with the exact tool result text only.'
26const cases = new Map<string, string>()
27
28async function log($: EngineInterface, check: string, fields: Record<string, unknown> = {}) {
29  const dir = `${(await $.env.get('CLAUDE_CONFIG_DIR')) || `${(await $.env.get('HOME')) || '~'}/.claude`}/timer-spawn-probe`
30  const line = JSON.stringify({ at: new Date(await $.clock.now()).toISOString(), check, ...fields }) + '\n'
31  await $.process.run(['sh', '-c', 'mkdir -p "$(dirname "$1")" && cat >> "$1"', 'sh', `${dir}/log.jsonl`], { stdin: line, timeoutMs: 10_000 }).catch(() => undefined)
32}
33
34async function spawn($: EngineInterface, via: 'hook' | 'timer') {
35  const r = await $.agent.spawn({ subagentType: 'timer-spawn-probe:pinger', description: `ping probe (${via})`, prompt: ASK })
36  if (r.agentId !== undefined) cases.set(r.agentId, via)
37  await log($, 'spawned', { via, agentId: r.agentId ?? null, deny: r.deny ?? null })
38}
39
40export const register: Register = on => {
41  on('session.start', async ($, e, next) => {
42    const r = await next(e)
43    await $.tool.register({ name: 'ping', description: 'Answers pong. Call it when asked.', inputSchema: { type: 'object', properties: {} } })
44    await $.command.register({ name: 'timer-spawn-probe', description: 'spawn one agent from this hook and one from a timer; each calls the probe tool' })
45    return r
46  })
47
48  on('tool.call', { tool: 'mcp__timer-spawn-probe__ping' }, async ($, e) => {
49    await log($, 'called', { agentId: e.agentId ?? null, via: e.agentId === undefined ? null : (cases.get(e.agentId) ?? 'unknown') })
50    return { result: 'pong' }
51  }).catch(() => ({ deny: 'timer-spawn-probe: the hook failed' }))
52
53  on('command.run', { command: 'timer-spawn-probe' }, async $ => {
54    await spawn($, 'hook')
55    $.clock.after(500, () => void spawn($, 'timer').catch(err => log($, 'spawned', { via: 'timer', error: String(err) })))
56    return { text: 'timer-spawn-probe: one agent spawned from this hook, one from a timer; see log.jsonl' }
57  })
58
59  on('turn.complete', async ($, e, next) => {
60    const r = await next(e)
61    if (e.agentId !== undefined && cases.has(e.agentId)) await log($, 'answered', { via: cases.get(e.agentId), agentId: e.agentId, answer: e.answer.slice(0, 500) })
62    return r
63  }).catch(($, e, next) => next(e))
64}
65