Skip to main content

Command line

cedarloom lists, checks and changes the workflows of the cl-workflow plugin (the steps Claude Code takes for a task) in the project in the current folder; cloom is a short name for it. Run it with npx @cedarloom/cli <command>, or install it for the short names with npm i -g @cedarloom/cli (see the install steps); the commands below use the short names.

Commands​

CommandWhat it does
doctorChecks the Node.js version, the project, the cl-workflow plugin and the workflow definitions.
workflows listLists the shipped and project workflow definitions.
workflows show <name>Shows a workflow definition.
workflows validate [<name>...]Checks workflow definitions with the plugin's generator.
workflows generate [<name>...]Writes the files of workflow definitions into .claude.
workflows new <name> [--from <shipped>]Creates a project workflow from a shipped definition, dev by default.
workflows add, move, remove, setEdit a project workflow and its files in .claude: see Edit a workflow.
workflows off <id>Switches a workflow off for this project.
workflows off --pluginSwitches the plugin off for this project.
workflows on <id>, workflows on --pluginSwitches back on what workflows off switched off.
runs listLists the runs recorded for this project.
runs show <run>Shows a run and its steps.
undo <run>Undoes a run, as a run of its own.

Read-only views​

Three commands give scripts and integrations a project's state as JSON with --json. They change nothing and need no Orca (the separate tool that runs CedarLoom bots): gh reads GitHub, and git the fetched default branch.

CommandWhat it does
bots planLists the bots that cedarloom.json on origin/HEAD plans, each with the model and effort of the cl-workflow model map, and present where Orca has the bot. Without the file, none.
inbox [<owner/repo>...]Lists the open cl:needs-human issues: a body with a What: line and lettered options as its options, any other body as text.
runs state [<owner/repo>...]Per repository: the ready issues in pick order, the open pull requests with checks and review, and whether the default branch is red.

A ready issue is one the coordinator may pick: open, with the startLabel and every issues.labels entry of cedarloom.json on the default branch (without a startLabel, none is ready), without cl:needs-human, cl:in-progress or cl:deferred, named in no Issue: <owner/repo>#<n> line of an open owner question that is unanswered or answered with an option that holds it, without a merged or open pull request from a <type>/<n>-<slug> branch, written by the repository owner, a trustedAuthors login or someone with write access, and, for an approved goal card, with the title and body its newest Approved card comment pins. A cedarloom.json that the coordinator refuses, such as one whose startLabel is another cl: label, refuses runs state with policy.invalid. Questions in the coordinator's local queue (.cedarloom/questions/ on its host) are not read, so an issue that only such a question holds can be listed as ready.

Without <owner/repo>, inbox and runs state read the repository of the current folder. The documents' schemas are BotsPlan, Inbox and RunsState in project-views.ts.

Plans and undo​

A command that changes files shows its plan and stops. Add --yes to apply the plan as a run. undo <run> reverts a run in the same way: a plan first, a new run with --yes. Before its plan, each of these commands settles a step that a crashed run left half done, to the state the run's journal records, also without --yes.

cedarloom workflows new my-flow # shows the plan
cedarloom workflows new my-flow --yes # applies it as a run
cedarloom runs list
cedarloom undo <run> --yes

Agent homes​

Four commands write the files of an agent home, ~/.orca/bots/<name>/, where <name> is cl- followed by lowercase letters, digits and hyphens. Only this folder takes their writes: ~ is the account's home folder from the system's user database, and no setting, environment variable or argument names another one. Each command is a run with a plan, a backup of each file it replaces, a record of the files it creates and an undo, in a store of its own outside the home.

CommandWhat it does
bots install <name> <dir>Writes each text file below <dir> into the home at the same relative path.
bots snapshot <name>Copies every UTF-8 text file of the home into .cedarloom/snapshots/<snapshot>/ in the home.
bots restore <name> <snapshot>Writes the files of a snapshot back into the home.
bots undo <name> <run>Undoes a run of the home as a run of its own.
  • Without --yes a command shows its plan and changes nothing (exit code 4, cli.confirm-required). Before its plan, undo settles a step that a crashed run left half done, to the state the run's journal records, also without --yes.
  • A plan that loosens the home's permissions applies only with --yes --loosen; with --yes alone it is refused with bots.loosening-unconfirmed, and loosening lists each change. Only the changes below are not loosenings; every other change of a file or key is one, including those Claude Code adds support for later.
    • In settings.json, settings.local.json, .claude/settings.json and .claude/settings.local.json (in any letter case): a change of an inert key ($schema, model, effortLevel, language, outputStyle, theme, editorMode, viewMode, prefersReducedMotion, spinnerTipsEnabled, spinnerVerbs or showTurnDuration; see the settings reference), an added permissions.deny or permissions.ask rule, and a removed permissions.allow rule. Any other change of these files, such as of env, hooks or autoMode, and text that is not a JSON object, loosens.
    • Any change of an inert file, creating or removing it included: CLAUDE.md, the Markdown files below rules/, output-styles/ and agent-memory/ (each also in .claude/), the .json files in themes/ (see the .claude directory), and the copies below .cedarloom/snapshots/.
    • An inert file loosens too when it is executable, and every inert file does while one of the four settings files holds a key other than an inert key and permissions (such as hooks, statusLine or apiKeyHelper) or is no JSON object the home holds, such as a link: a command such as a hook may run or read any file of the home, however it spells the path. Hooks of a plugin are not looked at, so a plugin hook must not run or read a file on an inert path.
    • --loosen guards capabilities (code, commands and permissions), not instructions: steering text such as CLAUDE.md, rules and output styles stays inert, and the plan shows it in full. A bot whose safety rests only on its instructions is not covered by --loosen.
  • Files Claude Code rewrites while it runs (.claude.json and its backups, history.jsonl, and the files below backups/, projects/, sessions/, session-env/, shell-snapshots/, todos/, file-history/ and statsig/, in any letter case) are copied by snapshot; install and restore write them only where the home has none and list each one they keep in plan.skipped as bots.live-file-kept.
  • .credentials.json, where Claude Code keeps its login, is never in a plan: snapshot does not copy it, and install and restore do not write it. Each lists it in plan.skipped as bots.credentials-skipped.
  • undo refuses with undo.file-changed when a file the run wrote changed since; nothing is restored then. An undo that stops part way, such as on a full disk, leaves the files it restored so far; run bots undo again to restore the rest.
  • While install, snapshot or restore runs, nothing else may write the home, so stop its bot first. Each checks the home for links before it reads a file, but Node.js cannot bind the read to that check: a process that can write the home could swap a folder for a link in between and get text from outside the home into the plan or the snapshot. That gives nothing to a process with the account's own rights, but it does to a bot whose sandbox lets it write its home and denies it reads elsewhere, such as ~/.ssh.
  • With --json the result is BotHomeRun in bot-home.ts: name, action, snapshot, plan (paths relative to ~), loosening (each with path, key and rule), applied and run. A refusal before there is a plan leaves result null.
RefusalWhen
bots.name-invalidThe name is not cl- followed by lowercase letters, digits and hyphens.
bots.root-missing~/.orca/bots does not exist.
bots.home-missingThe named home does not exist.
bots.home-not-folderThe home, or a folder on the way to it, is a file.
plan.symlinkThe home, a folder on the way to it or in it, or a source file is a link.
plan.path-outside-rootsA path is outside the home, such as one in a .git folder, or an install or restore path is below .cedarloom/snapshots/.
bots.source-missing<dir> of install is not a readable folder.
bots.snapshot-missingThe home has no such snapshot.
bots.snapshot-incompleteThe snapshot run stopped before its last step, so <snapshot>.done beside its folder is missing.
bots.store-in-homeThe state store would lie inside the home, such as with a relative CEDARLOOM_STATE_DIR and the working folder in the home.
bots.loosening-unconfirmedThe plan loosens the home's permissions and --loosen is missing.
undo.file-changedA file the run wrote changed after the run.
cedarloom bots install cl-builder ./bot-files # shows the plan
cedarloom bots install cl-builder ./bot-files --yes # applies it, unless it loosens
cedarloom bots undo cl-builder <run> --yes --loosen

Edit a workflow​

CommandWhat it does
workflows add <name> <pointer> <value>Inserts the stage or phase <value> at <pointer>.
workflows move <name> <from> <to>Moves a stage or phase to <to>, its position once it is taken out.
workflows remove <name> <pointer>Removes the stage or phase at <pointer>.
workflows set <name> <pointer> <value>Sets the field at <pointer>. Setting /name renames the workflow.
workflows set <name> <pointer> --unsetRemoves the field at <pointer>.
  • A pointer is a JSON Pointer: /stages/<i> for a stage, /stages/<i>/phases/<j> for a phase. With add, the index - stands for the end of the list.
  • A value is JSON. A text value keeps its quotes, such as '"opus"'.
  • The plugin's generator checks the edited definition first; an edit it refuses is not saved.

Options​

OptionEffect
--yesApplies the plan of a command that changes files.
--loosenWith --yes, applies a plan that loosens an agent home's permissions.
--jsonPrints one JSON document instead of text.
--plugin-root <dir>Uses this cl-workflow folder instead of the installed plugin. Its origin is not checked.
--help, -hShows the usage of a command.
--version, -VPrints the version of CedarLoom.