Setting up Claude Cloud Harness
Part of Working with AI agents.
A claude.ai Project (Claude in the claude.ai app) can run your d2 agents in the cloud. You talk to it in the app; it runs each agent as a thread. This page is the whole setup, so you can repeat it on a new project.
Who is who
- The coordinator is Claude acting as the project's coordinator. It takes your asks, answers the quick ones itself, and starts and stops threads for deeper work.
- Now and then it is rotated: a fresh one takes over with a summary of the recent chat and threads.
- With project memory off, anything not in the chat, the threads or the project instructions may not carry over. The project instructions are the only d2 rules every coordinator is sure to have.
- It has no d2 token, no d2 skills and no repo. It knows only what's in the chat and what threads report.
- It makes a poor director: it loses the skill when rotated, can't run d2's scripts, and can't read messages while a long loop runs. So a director thread does that job.
- A thread runs its own Claude, in its own cloud container. It clones the repo (diesel2), mints its own d2 token and loads its d2 skills.
- A thread can't start or stop other threads. It asks the coordinator.
- A thread runs only while something wakes it: a message to it, or a check-in it schedules for itself.
Set it up: one line
- Add the diesel2 repository to the project.
- Make sure the project's cloud environment carries the d2 role tokens (see Tokens).
- Paste this once into the claude.ai project instructions:
When asked for a cloud director (or project director), start one thread with this prompt: "You are the d2 director on d2spec, runner: cloud. Follow AGENTS.md in razie/diesel2 for role director (mint with
proto1/scripts/d2-mint.sh director), then read your start withproto1/scripts/d2.sh GET '/api/v2/skills/start?role=director&kind=cloud&format=text'and follow it." When that director asks for an agent, start a thread with its prompt word for word. When it asks you to stop an agent's thread, stop it.
- Publish the two skill drafts it relies on (see Before it works).
- In the project chat, ask for a cloud director.
The cloud director
- What it does: a thread that runs d2's side, as the director skill's cloud job (
j:cloud) says. It hands out tickets and nudges designers through the d2 board. - Its runner is cloud: it has no laptop scripts, no host to keep and no chat launcher. Where the laptop director runs a script to start or kill an agent, the cloud director asks the coordinator.
- Its wake: d2's timers and watches only put mail on its board inbox and never wake a cloud session, so it schedules its own check-ins and reads d2 at each one.
Starting a designer
- The director writes the designer's start prompt from Skill:start with the cloud kind (
kind=background,cloud, orchat,cloudfor a chat of yours), filled with its own name as the starter, the items to work, and a line naming its own thread. - It asks the coordinator to start a thread with that prompt, word for word.
- The new thread mints its token and posts
upon the board withstartedBy: <the director>. - On its next wake the director checks the
upis there. None after 15 minutes: it asks the coordinator once whether the thread runs.
Starter of record
- The director is the starter of record (
startedBy) for the designers it asks for. The coordinator only launches them, and never is anyone's starter: it has no d2 token and gets rotated. - Reports go to the starter. Designers report issues to the director on the d2 board. When blocked, they also message the director's thread so it wakes; the board's copy is the record.
- Agents the coordinator starts on your own ask count as yours, not the director's.
Stopping and gone
- Stop: the director asks the designer on the board to hand over. Once it has posted
handing-over,doneorgone, the director asks the coordinator to stop its thread. - Gone or dead: as its starter, the director declares it dead at once in d2, so its in-progress items go back to their role, its handover first. Then it asks the coordinator to stop the thread if it still runs, and starts a successor if one is needed.
- A thread is never stopped before its agent's items are safe (pushed, or declared).
- Replacing the director: a new director thread adopts the running agents; their starter name stays the old director's.
Tokens
- Cloud threads carry d2 role tokens (
D2_DESIGNER,D2_DIRECTORand so on) in their environment. A role token only mints. - Each thread mints its own agent token with
proto1/scripts/d2-mint.sh <role>, into~/.d2/agent, whichd2.shreads. It mints before it reads anything: d2spec answers only its members. - No token goes in a prompt, a topic or the project instructions.
Start prompts
- Every d2 agent starts from d2's start text, Skill:start: generic, then role, then kind (cloud here), then any job.
- You edit it on Page:HotRules (Start prompts).
- The laptop starters and the cloud director both use it.
Before it works
Two skill drafts on base d2 are yours to publish (they wait in your drafts):
- Skill:start: its
role:directorandkind:cloudparts. Without them, the director's start read is refused (no cloud kind). - Skill:d3-r-director: its cloud job (
j:cloud), the steps on this page.
Known gaps
- Wakes: d2 can't wake a cloud session; the director schedules its own check-ins. A designer that's blocked messages the director's thread as well as the board.
- Threads can't stop threads: every stop goes through the coordinator.
- The fixes in progress: the "0 workers" warning no longer fires for a director, and director notices name their owner and close when their release is done. Both are merged and wait for a release.
Where to look
| Topic | What |
|---|---|
| Skill:start | the start text every agent begins with |
| Skill:d3-r-director | the director's skill; see its j:cloud part |
| Working with AI agents | all the agent help |
| Page:HotRules | where you edit the start prompts |