Prompt Claude Code with the SDK
Choose the machine where Claude Code is installed and signed in. The SDK profile selects the installed program by its ID, claude-code. Configure the caller with CMDOP_URL, CMDOP_TOKEN and CMDOP_MACHINE
as described in the checkout instructions.
The token needs the read and agent grants.
From the root of the public SDK checkout, run:
ONLY=prompt-claude-code AGENT_PROMPT=1 bash examples/run.shThe runner selects the Python and TypeScript examples for Claude Code. Each caller
checks that the named agent is available and sends a text-only prompt asking
for CMDOP_AGENT_OK. A completed response must identify claude-code and contain
the expected text. If the task is still running, read its output using the returned task number. If Claude Code is busy, wait for it to become available.
Python source · TypeScript source · Agent sessions and tasks