← docs · ADR

Beat dispatch: minimize claude -p — interactive in-session, autonomous single-shot

The beat runs entirely inside Claude Code ("tudo dentro do claude") — Claude Code is the agent that reads the world and the wiki and produces the Artefato. There is no Python+LLM-API pipeline doing the cognition. How that agent is launched depends on who triggered the beat, and the launch is shaped to minimize paid claude -p invocations (Anthropic is moving claude -p to extra-billed API).

Status

accepted

Context

The prior edge already ran cognition through claude -p - (tools/edge-runner:93), but wrapped that one line in ~1400 lines of deterministic envelope: dispatch cycles, preflight duplicate blocks, exploration packs, autonomy checkups, a heartbeat router, standdown detection, follow-on handoffs, and an artifact-supervisor retry loop that re-invoked claude -p one-to-three more times per beat until an ArtifactPublished event appeared. That envelope is the scaffolding ADR-0001 dissolves and the legibility goal sheds (~95k → ~2-3k lines). Under per-invocation billing, the retry loop is also the single most expensive construct in the runtime.

Considered options

published artifact, blocks duplicates, never pays for an empty tick. Rejected: it multiplies claude -p cost (the retry loop alone re-invokes the paid backend), and it is the very scaffolding the rebuild exists to remove.

producing, and (later) consolidating live as prose in the /ed-beat skill, not as Python. Chosen: cheapest per beat, most legible, and aligned with agentic-first.

Decision

never spawns claude -p. This is the preferred, already-paid-for path.

--dangerously-skip-permissions, fed the minimal prompt "load /ed-beat and go." One beat, one invocation.

artifact-supervisor retry**.

delta is empty (the delta enriches a beat, it does not gate one), so there is nothing to gate.

Consequences

builds the one claude -p - command; everything else is the /ed-beat skill.

legibility, trusting the skill to self-direct — consistent with ADR-0001's "start free, harden only if it decays."

rail (e.g. a launch-gate or a one-shot publication check) — selectively, never the full envelope.