Click to copy
<role>Python developer. Run this in Claude Code, in an empty folder {{DESK_DIR}}. Claude Opus 5.</role>
<task>
First, the environment. A virtual environment is a private folder of Python packages for this
project only. Run these one at a time, from the official Agent SDK quickstart
(https://code.claude.com/docs/en/agent-sdk/quickstart), and show me the output of each.
macOS or Linux: python3 -m venv .venv
source .venv/bin/activate
pip install claude-agent-sdk
Windows (PowerShell): py -m venv .venv
.venv\Scripts\Activate.ps1
pip install claude-agent-sdk
If PowerShell blocks Activate.ps1, the quickstart says to run first:
Set-ExecutionPolicy -Scope Process RemoteSigned
Then the test runner, from pytest's own getting started page (https://docs.pytest.org/en/stable/getting-started.html):
pip install -U pytest
The API key comes from the Claude Console (Anthropic's developer dashboard) and goes in MY shell,
never in a file you write:
macOS or Linux: export ANTHROPIC_API_KEY=your-api-key
Windows (PowerShell): $env:ANTHROPIC_API_KEY = "your-api-key"
Python 3.10 or newer is required. The Claude Code CLI comes bundled with the package.
Then create this tree at {{DESK_DIR}}. Write every file with real content. Print ls -R when done.
README.md run order and the pass condition from prompt 13
.gitignore .venv/ and .env
desk/specialists.py one system prompt per signed spec from prompt 07, and ONE shared JSON schema:
specialist, view, confidence, probability, evidence (list), flags (list of
text and tag), missing_inputs (list). All required.
desk/run_specialist.py one query() call per specialist with ClaudeAgentOptions: system_prompt,
output_format {"type": "json_schema", "schema": ...}, model="claude-opus-5",
setting_sources=[], allowed_tools=[], permission_mode="dontAsk",
disallowed_tools=["Read","Glob","Grep","Agent","WebFetch","WebSearch",
"Bash","Write","Edit"], cwd set to a FRESH EMPTY temporary folder per
specialist (the case file goes in the prompt text, never on disk where
it can be found), max_turns and max_budget_usd set. Reads
ResultMessage.structured_output, subtype, session_id, total_cost_usd.
desk/coordinator.py asyncio.gather over the specialists, each given ONLY the case file. Copies
every structured_output unchanged. One model call adds conflicts, pre mortem
and recommendation, per the prompt 09 spec.
desk/decide.py asks ME for decision, size, probability, horizon, reason. Appends one JSON
line to decision_log.jsonl. Code writes the log, never an agent.
cases/case-001.json a fixed case built from a held out incident in prompt 08
tests/test_desk.py written in prompt 12
</task>
<trap>dontAsk does not make a specialist blind. The permissions docs say calls that need no approval,
such as file reads inside the working folder and calls to Agent, still run. Left in the desk folder, a
specialist can read decision_log.jsonl and see the other views and past outcomes, which silently breaks
independence. Remove Read, Glob, Grep and Agent by name AND run each specialist in an empty folder.
setting_sources left at its default also loads my personal settings.</trap>
<stop>If pip fails with "externally-managed-environment", stop: the venv is not active. If any import
in your code does not exist in the installed claude_agent_sdk, stop and name it. Do not invent an API.
Check names against https://code.claude.com/docs/en/agent-sdk/python.</stop>
<output_format>Each command's output, then ls -R.</output_format>
<constraints>Use the signed specs from prompt 07 exactly. No tool that can place an order anywhere.</constraints>
<review_gate>I read specialists.py and confirm each prompt matches my signed spec.</review_gate>