Kiln
Kiln runs a workflow against a git checkout. Register any repo, add a job from a markdown spec, a prompt, a directory of tickets, or a Jira Cloud issue, and tick. Tick launches ready jobs in yak worktrees. Status shows each job. Approve or reject answers a human gate. kiln serve opens that same derived state in a browser on this machine.
A ready spec is the input. Kiln does not build or iterate requirements.
This repository is public. Checkout paths and jobs stay in ~/.kiln/ (or $KILN_HOME when that is set). Do not commit them.
Install
npm i -g @lchase/kiln
kiln repo add web /absolute/path/to/web --test "npm test"
kiln repo list
Run kiln repo add <name> <path> from any directory. The first run creates ~/.kiln/kiln.config.json. Jobs, logs, and deliveries live in that same directory, whichever directory you run kiln from. Set KILN_HOME or pass --config <file> to use a different kiln home.
If ./.kiln/kiln.config.json is still in the working directory and the home config does not exist, kiln stops. Move it with mv ./.kiln ~/.kiln, or pass --config / set KILN_HOME. Kiln does not move it for you.
kiln is the command. The subcommands in the rest of this file are the same ones. Examples that say npm run kiln -- are the in-checkout form.
Develop from a checkout
From packages/kiln:
npm install
npm run build
npm link
kiln repo list
npm link puts this checkout's kiln on your PATH. The bin is dist/cli.js, so build before linking, and rebuild after source changes. npm run kiln -- builds and runs without a global link.
Workflows (workflows/*.yaml) and prompts (prompts/) are read from the package that contains the running file, next to its package.json. A global install and npm link both resolve them from that package, not from the directory you ran kiln in. Local workflows, prompt overrides, and skills live in the kiln home. See Local overlay.
Local overlay
Shipped workflows (feature, investigation, review, fix) and their prompts stay in the published package. An operator can add workflow types, replace prompt files, and point the Skill tool at local Claude Code skills without forking Kiln or republishing it.
Those files live in the kiln home, the same directory as kiln.config.json: ~/.kiln by default, or the directory of $KILN_HOME / --config.
/home/operator/.kiln/workflows/*.yaml
/home/operator/.kiln/prompts/kiln/…
/home/operator/.kiln/prompts/factory/…
/home/operator/.kiln/skills/<name>/SKILL.md
Missing workflows/, prompts/, or skills/ is fine. Kiln treats each one as empty.
overlay in the config can point any of those directories somewhere else. A relative path resolves from the config directory, the same way reviewPrompt does. overlay.skillPaths adds more skill directories, so a skills checkout can be used without copying it into the kiln home.
{
"overlay": {
"workflows": "workflows",
"prompts": "prompts",
"skills": "skills",
"skillPaths": ["/home/operator/skills"]
}
}
Packaged workflows still come from the package workflows/ directory. kiln add, Add job, and POST /api/jobs list local names next to the shipped ones once the YAML is present. A local YAML must not reuse a shipped name. Kiln fails at list and load time instead of shadowing feature.yaml or the other shipped files. To change an official flow, copy it to a new name, or override a prompt file.
Prompt lookup uses the same relative path as the package (prompts/kiln/…, and prompts/factory/… when a preamble names one). A file in the local prompts tree wins for that path. Otherwise Kiln reads the packaged file. reviewPrompt is the shortcut that overrides prompts/kiln/review.md: when it is set, that file wins over both the local tree and the package, through the same lookup. A preamble that starts with <!-- factory: prompts/factory/<file>.md --> still combines with that factory body, and a local factory file wins the same way.
Workflow YAML is loaded from the package or from the local workflows directory. It is not loaded from the directory where you ran kiln.
skills/ is a tree of Claude Code skills (<name>/SKILL.md). Kiln passes that directory, plus overlay.skillPaths, to the agent. With the sandbox off, the Skill tool can load them. With sandbox.mode set to docker, yak mounts only those directories into the container, read-only, at the same host path. It does not mount ~/.claude. Skills are not copied into the checkout or into job artifacts. The Skill tool sees each skill under its directory name.
Agents do not load your user Claude Code setup (~/.claude): no global CLAUDE.md, plugins, user skills, agents, hooks, or MCP servers. The checkout's project settings still load. This keeps every agent turn small; the user setup added about 120K tokens per turn. A skill an agent needs, such as smart-review for the code review, goes in skills/ or overlay.skillPaths. For a skill installed as a plugin, point skillPaths at the plugin's skills directory, for example ~/.claude/plugins/marketplaces/<marketplace>/plugins/smart-review/skills. Settings → Local workflows and skills lists the skills agents will see and warns about a skill folder that is missing or holds no skills, so a typo does not silently drop one.
A launch with skill directories set refuses an installed @lchase/yak that drops skillDirs while loading workflow YAML, so an older package cannot ignore them. Settings does not accept workflow YAML or skill file bodies.
There is no separate agents/ directory. In this stack, factory agents are prompt files under prompts/.
Prerequisites
- Node.js >= 22.12 (the
engines field in package.json)
- git
- Claude Code, installed and logged in, for a real run.
adapter: "mock" does not call a model.
gh, installed and logged in, only when a repo uses deliver: "pr".
Each checkout is a git repo with a commit at HEAD. tick adds a worktree and leaves uncommitted files in the checkout as they are. The job edits the worktree, on branch yak/<run-id>. With the default deliver: "local", Kiln does not push. deliver: "pr" pushes that branch and opens a draft pull request. See Delivery and dependencies.
Sandbox
Sandbox mode is off. Set it in the kiln config when agent steps should run inside yak's Docker sandbox instead of on the machine. A workflow block overrides the global one field by field. mode omitted means off at that layer. allowDomains, when set, replaces the list.
{
"sandbox": { "mode": "docker" },
"workflows": {
"investigation": { "sandbox": { "mode": "off" } }
}
}
image overrides yak-agent-sandbox:latest. Leave it unset to use that tag.
With mode docker, tick injects sandbox: docker and allowedDomains under every agent step in the rendered workflow. The default allowlist is exact hostnames, matched by the proxy as dstdomain (a subdomain is not implied):
api.anthropic.com
registry.npmjs.org
github.com
api.github.com
codeload.github.com
objects.githubusercontent.com
raw.githubusercontent.com
That is the Anthropic API, the npm registry, and the GitHub hosts a fetch or install dials. It is not the open internet.
| Step |
Where it runs |
| feature: spec, build, security, ux, ui, code, approver |
Docker sandbox |
| investigation: explore |
Docker sandbox |
| fix: build |
Docker sandbox. A pull-request fix uses the same allowlist. |
| review: draft |
Docker sandbox. Sandbox on or off, this step has no Bash, Write, or Edit. |
| review: diff |
Host. It runs git diff from the base to the pull request head and nothing from the pull request. |
| feature: verify |
Host. It runs KILN_TEST through Kiln's truncate wrapper. Yak's command sandbox does not forward that environment and uses --network none. |
| approve gates |
Host. A person answers them. |
| feature: land, fix: land |
Host. git commit uses the host git identity. Publishing the fix branch is the kiln process. |
Pull request open, git push, gh pr view, feedback reads |
Host kiln process. They are not workflow steps. |
| Pull request conflict: plain merge of the base and test run |
Host kiln process. It runs the repo test command on the merged tree, outside the sandbox. |
kiln sandbox prints the resolved mode, the allowlist, and anything still missing. kiln sandbox build builds the images yak ships but does not publish, from the tag that matches the installed @lchase/yak:
docker build -t yak-agent-sandbox:latest https://github.com/lchase/yak.git#yak-v0.8.0:docker/agent-sandbox
docker build -t yak-agent-sandbox-proxy:latest https://github.com/lchase/yak.git#yak-v0.8.0:docker/agent-proxy
The agent image is node:22-slim plus the Claude CLI at /app/claude-cli. It has no git. kiln sandbox build adds git and ca-certificates and tags that result yak-agent-sandbox:latest as well. The proxy image is yak-agent-sandbox-proxy:latest (squid on port 3128). Yak mounts the worktree at /workspace and puts the container on an --internal network whose only egress is that proxy.
A linked worktree's .git file points at the checkout's common git dir, which is outside that mount. git inside the container cannot see the repository until yak mounts that dir too. Land stays on the host, where the worktree link works.
Podman works when docker is aliased to podman. Yak 0.8.0 falls back from the bridge egress network to podman when bridge is absent. YAK_SANDBOX_EGRESS_NETWORK overrides that name.
On macOS, Claude subscription auth lives in the keychain. Yak forwards only ANTHROPIC_API_KEY or CLAUDE_CODE_OAUTH_TOKEN into the container, and never a ~/.claude directory. Kiln checks that one of those variables is set before a sandboxed run. It does not print or write the value.
Outside the sandbox, an unset CLAUDE_CODE_OAUTH_TOKEN is allowed: Claude Code can use the keychain. A variable that is set but empty, or a CLAUDE_CODE_OAUTH_TOKEN that does not start with sk-ant-oat, makes kiln tick and kiln serve refuse to launch. The message names the variable and does not include the value. A later 401, Invalid bearer token, or Failed to authenticate in the yak failure or the kiln log is auth-failed. That attempt is not retried. The board says Claude login rejected (401) — check CLAUDE_CODE_OAUTH_TOKEN / claude login, then Retry. kiln retry is the way back after the token is fixed.
claude setup-token
export CLAUDE_CODE_OAUTH_TOKEN
kiln sandbox build
Then set the kiln config to "sandbox": { "mode": "docker" }.
kiln tick and kiln serve name what is missing when sandbox mode is on: the docker binary, the docker daemon, each image, and the credential. They also refuse an installed @lchase/yak that does not pass allowedDomains from the agent step into the sandbox proxy. @lchase/yak 0.8.0 does. An older package drops sandbox, image, and allowedDomains while loading YAML and opens the proxy with only api.anthropic.com, so the job would run on the host with the open internet. Kiln leaves that job failed until kiln retry, after the installed package is 0.8.0 or newer.
A sandbox or container start flake (the container never started, the daemon was unreachable) is transient and retries with the usual backoff. Any other yak sandbox-error is not retried. The card shows the failure detail, and a sandboxed job shows sandbox · docker.
Register repos
npm install
npm run kiln -- repo add web /absolute/path/to/web --test "npm test"
npm run kiln -- repo add api /absolute/path/to/api --test "npm test"
npm run kiln -- repo list
npm run kiln builds first. kiln repo add <name> <path> writes ~/.kiln/kiln.config.json. When KILN_HOME is set it writes $KILN_HOME/kiln.config.json. --config <file> writes that file instead, and jobs live in the file's directory. A relative path is stored absolute, resolved from the working directory at add time. ~ is expanded from the home directory. test is optional on the entry and required before tick can launch a job in that repo.
repo add prints the deliver mode in effect and the command that changes it. The default is local, and that default is not written into the file until you pass --deliver. kiln repo add <existing-name> <path> --deliver pr updates that repo in place: a flag you omit keeps the stored test command, deliver mode, base, prTitle, and branch. kiln repo list prints deliver local or deliver pr for every repo.
{
"repos": {
"web": { "path": "/absolute/path/to/web", "test": "npm test" },
"api": { "path": "~/src/api", "test": "npm test" }
},
"maxConcurrent": 2,
"adapter": "claude-code"
}
repos is an open map. Any name is allowed. maxConcurrent caps how many jobs may be in flight (default 2). adapter is claude-code (default) or mock.
Add a job
A job is one workflow run. The workflow name is a file workflows/<name>.yaml in the package, or the same kind of file in the kiln home. A local name is listed next to the shipped ones and cannot reuse a shipped name. feature is the factory loop. investigation answers a spike and stops for a person to approve the findings. fix is the pull request feedback run: the same builder, on the open pull request head, committing onto a new yak/<run-id> that Kiln fast-forwards onto the existing branch. Bug and security workflows are next.
npm run kiln -- add feature --repo web --spec spec.md --title "Show a Sunday summary"
npm run kiln -- add feature --repo api --spec api-spec.md --after <job-id>
npm run kiln -- add feature --repo web --jira PROJ-123
npm run kiln -- add feature --repo web --spec spec.md --issue ABC-123
--title defaults to the first # heading in the spec, then the file name. --issue KEY stores an issue id matching KEY-123 (uppercased). --after may be repeated. Those jobs must already exist. Kiln copies the spec to ~/.kiln/specs/<id>.md and writes ~/.kiln/jobs/<id>.json:
{
"id": "j20261025020600ab12",
"repo": "web",
"workflow": "feature",
"spec": "specs/j20261025020600ab12.md",
"title": "Show a Sunday summary",
"issue": "ABC-123",
"dependsOn": ["j20261025020500cd34"],
"source": { "kind": "file", "ref": "/home/dev/specs/sunday.md" },
"createdAt": "2026-10-25T02:06:00.000Z"
}
dependsOn is omitted when the job has no --after. issue is omitted when intake had no key. stack: true is set by --stack and is omitted otherwise. source records which intake created the job. Jobs written before intake omit source and still run. State is not stored. The pull request url is not stored on the job; Kiln writes it under ~/.kiln/deliveries/.
Intake