Skip to main content
Use the SDK to run AI coding agents from your own code: give one a task, watch what it does, step in while it works, and pick the conversation up later. Every agent stays behind the same safety check the bot uses. The psychiatrist SDK is @psychiatrist/core, the engine the bot itself runs on (ADR 0003): the bot starts every agent through the same start(). A session is one agent’s conversation on a harness; you send it turns, steer it while a turn runs, interrupt, fork, close and resume it. Terms follow GLOSSARY.md.
The SDK’s packages are optional peers of @psychiatrist/core: install them beside it, as above (zod is also how you write a turn’s report schema). It needs Node 22.13 or later and Claude Code, installed and signed in (claude): sessions run on your own install, and start() rejects, saying what to run, when it is missing or signed out; a failed check is tried again on the next start(). The package is ESM with type declarations.

What’s available and what’s planned

These guides describe the SDK as it is designed, ahead of the code (ADR 0010). A page or section marked Planned · #n describes an API its ticket builds: the shape is settled, but it is not in the package yet. Everything else works today.