docsbuild agentsworking in claude code

Working in Claude Code

Build, refine, and debug agents from your terminal. Same loop as the console agents, plus service code and diff-by-diff review.

Cast ships with three Claude Code skills — /cast-build for authoring, /cast-refine for introspection-driven refinement, and /cast-debug for diagnosis. Each loads the right manuals and conventions and turns a generic Claude Code session into one fluent in Cast's vocabulary. The safety property is operator review, line by line.

When you reach for it

The in-Cast console agents (Design, Configure, the All-Agents managers) handle ordinary blueprint authoring and per-install wiring without leaving your browser. Claude Code is the place for the agent work they can't reach:

  • Service code — anything under blueprint/service/: custom MCP tools, cron jobs, OAuth handshakes, file watchers, connectors to systems you actually use. See Writing services.
  • Refinement and introspection — reading across an agent's blueprint, runtime state, memory, and admin history at once to propose changes grounded in evidence. See Designing well.
  • Diagnosis — figuring out why an agent did (or didn't) do something, or why a message didn't arrive. Layer-by-layer reads of the gateway, agent state, runner log, and session transcripts.
  • Cross-agent folder operations — rename, restore from backup, bulk delete, anything spanning more than one agent folder.

Three lanes, one envelope

Claude Code covers three distinct activities that share the same access surface and trust model. The lanes aren't enforced — each skill can do anything the envelope allows. They differ in what they prime Claude to read first, and what posture they encourage.

Authoring writes new things — services, extensions, blueprint files, package changes. You describe what you want, Claude Code drafts the code, you review the diff, it lands.

Introspection reads existing things — an agent's blueprint next to its runtime state, its memory, the operator's recent admin actions. The output isn't code; it's a grounded read of what the agent is actually doing and what changes might earn their place. Introspection is upstream of authoring: it's how you find what to refine before you start refining.

Diagnosis reads the runtime — gateway DB, agent message log, agent-runner debug log, session transcripts — to answer "why did this happen?" or "why didn't this arrive?" The output is a named cause at a named layer; a fix follows separately (often back through the authoring lane).

The three skills

All three are available from Claude Code's slash menu. Each takes an optional <folder> argument — present narrows scope to one agent, absent opens server scope.

  • /cast-build [folder]authoring inside agent folders. Blueprint files (identity, channels, props, assets) and per-agent service code under blueprint/service/. With a folder, the session anchors at one agent. Without a folder, cross-agent folder ops (rename, restore, bulk delete) across $CAST_AGENTS_DIR/.
  • /cast-refine [folder]introspection. Reads the agent against its blueprint and surfaces refinement proposals. Output is a dated artifact, not edits. Per-agent with a folder; with no folder, the unit of analysis is the fleet.
  • /cast-debug [folder]diagnosis. Layer-by-layer reads to find what broke. Per-agent with a folder; without a folder, the gateway and host server logs are the primary surface.

The lines blur — refinement often finds a bug (switch to diagnosis), diagnosis often ends in a code change (switch to authoring). Each skill names its siblings so you can hand off mid-session.

The trust model

Cast cannot audit advanced mode — it lives outside the message log. The only safety property is your review: every diff Claude Code proposes is yours to approve, modify, or reject before it lands. That's why the skills emphasize narrow scope, naming the egress in agent.json, and documenting why a credential was added.

🔒 SECURITY
Reviewing diffs you didn't write, in a language you don't work in, is closer to approving than reviewing. Approving without catching is the failure mode you take on in advanced mode. If you can't read the code Claude Code is writing, the right move is usually to stay in the console agents and shape the request differently — not to wave through code you don't understand.
  • Writing services — the principal authoring target. Service shape, conventions, where the code runs.
  • Designing well — how refinement uses introspection to find what to change next.