Move onto kraft-default
Kraft's own chains and library are the built-in add-on kraft-default. It
comes with the installed Kraft, so every upgrade updates it, and nothing in
$KRAFT_HOME/config/ has to change for you to get it. A new home is seeded with
thin default and quick-task chains that only say extends: kraft-default:<id>, and an empty library.yaml. Your overrides sit on those
chains, and releases flow underneath them.
A home seeded before this release holds full copies of the chains and the
library instead. Kraft never rewrites them, in this release or a later one: that copy hides
kraft-default:default, so it stays as it was on the day it was seeded. This
guide moves such a home onto kraft-default by hand, keeping your edits.
Before you start
- You have upgraded Kraft (
kraft admin update). See Upgrade Kraft. - Your config directory is
~/.kraft/config/, or$KRAFT_HOME/config/if you setKRAFT_HOME. The directoryKRAFT_CONFIG_DIRnames wins over both, and so does a 1.xKRAFT_TEMPLATES_DIRwhenKRAFT_CONFIG_DIRis unset. The commands below follow the same order. gitis installed.
Keep your config in git
Do this once. If you haven't yet, do it now, before you change any chain, so that
git diff shows your move. A git history lets you see your own edits apart from
Kraft's, and undo a bad change.
Skip this block if the config directory is already in git: with config set as in
its first line, git -C "$config" status answers instead of failing.
Each command runs only if the one before it worked, and every git command names
the directory with -C. A config directory that doesn't exist stops the
block before it touches anything, and nothing runs in the folder you are in. The
block adds access.yaml and notify.yaml to a .gitignore that is already
there, and leaves its other lines alone:
config="${KRAFT_CONFIG_DIR:-${KRAFT_TEMPLATES_DIR:-${KRAFT_HOME:-$HOME/.kraft}/config}}"
git -C "$config" init &&
for f in access.yaml notify.yaml; do
grep -qxs "$f" "$config/.gitignore" || printf '\n%s\n' "$f" >> "$config/.gitignore"
done &&
git -C "$config" add -A &&
git -C "$config" commit -m "My Kraft config"
Leave access.yaml and notify.yaml out. One holds your password hash, the
other a webhook URL that usually carries a token. Keep the repository on this
machine: repos.yaml can hold secrets in a repo's env:.
See which chains are copies
kraft admin doctor
When a chain of yours has the ID of a kraft-default chain and doesn't extend
it, the kraft-default row warns, one line per chain:
warn kraft-default chains/default.yaml is a full copy and hides kraft-default:default; see Move onto kraft-default
On a home that is already thin the row reads ships with Kraft <version>. The
row also reports an old GitHub copy of kraft-default, a held update and the
other things on its page.
With the Claude Code plugin, /kraft:check runs the checks and templates lint,
and explains each row. It only reports until you ask it to change something.
Diff against the shipped defaults
The built-in's files sit inside the installed Kraft (a source checkout reads the
repository's config/). Kraft can tell you where, through the Python that runs
your kraft command, which works for a uv, script or Homebrew install:
KRAFT_PY="$(head -1 "$(command -v kraft)" | cut -c3-)"
SHIPPED="$("$KRAFT_PY" -c 'from kraft.addons import builtin; print(builtin.source_dir())')"
echo "$SHIPPED"
echo prints a path that ends in kraft/_bundled/kraft-default. If it prints an
empty line, the line above it failed and the shell printed that error: the first
line of your kraft command isn't an interpreter path. Use the repo's copy
instead: the
config/ directory at
the tag for your version, such as v2.6.0, not main. Download it, and set
SHIPPED to that folder with SHIPPED=/path/to/config. The next blocks stop
with a message while it is unset.
Then compare the chain and the library you copied with it:
config="${KRAFT_CONFIG_DIR:-${KRAFT_TEMPLATES_DIR:-${KRAFT_HOME:-$HOME/.kraft}/config}}"
diff -u "${SHIPPED:?set SHIPPED first, as the block above does}/chains/default.yaml" "$config/chains/default.yaml"
diff -u "$SHIPPED/library.yaml" "$config/library.yaml"
A line starting - is in the built-in and not in yours. That is either
something new or something you removed on purpose. A line starting + is yours.
Your git log tells your edits apart from the version you were seeded with. Do the
same for chains/quick-task.yaml and for any chain of yours that is a full copy
of one.
Move your edits onto an extending chain
Do this for each chain doctor named.
- Write down what you changed. From the diff, list the nodes and tasks whose
fields differ from the built-in's: a
model, aneffort, atime_cap_minutes, a node you added or removed. - Replace the chain with a thin one that carries only those differences. For
chains/default.yaml:id: default extends: kraft-default:default overrides: # one entry per component you changed, keyed by its canonical path implementation.main.implement: {policy: {time_cap_minutes: 60}}
The most common edit is a task'smodeloreffort. Either define the tier you want inharnesses.yamland select it withimplementation.main.implement: {profile: deep}, or overridemodelandefforton the task. Settingprofiledrops an inheritedmodelandeffort, so state them again if you still want them.
Node IDs stay bare, because the chain inherits them, so theloops:keys inpolicy.yamland the IDs your tooling knows are unchanged. A baredefaultis still your local chain. A node, step or task is reached by its canonical path, and a node you added or removed goes underadd:orremove:: Library and chains has the rules. - Change a task from the chain, not the library. A bare name inside
kraft-default:defaultresolves within the add-on, so alibrary.yamlentry of your own never changes whatdefaultruns. To change what a node runs, override the node on the chain. Alibrary.yamlentry matters only to chains that name it. - Delete the library entries you never changed. An entry in your
library.yamlthat matches the built-in's is a stale copy. First change each chain of yours that names it bare (extends: strict_judge) to the prefixed name (extends: kraft-default:strict_judge), because a bare name is looked up in your own library. Then delete the entry. Keep the tasks, steps and steering of your own that a chain names.
Then check and load the result:
kraft admin templates lint
kraft admin reload
lint checks every chain against your library and the built-in, and exits 1 on
any error. reload makes the running server read the files, with no restart. It
exits 1 and names any chain that doesn't resolve. A pass prints these lines
(the counts are your own):
3 chain(s), no errors
reloaded 3 template(s) and policy.yaml and intake.yaml
Work items filed before the move finish on the chain they were filed with.
Check it worked
config="${KRAFT_CONFIG_DIR:-${KRAFT_TEMPLATES_DIR:-${KRAFT_HOME:-$HOME/.kraft}/config}}"
kraft admin templates show default --resolved
kraft admin doctor
git -C "$config" diff
show --resolvedprints the chain as it runs, with each library entry expanded. Check that your overrides are there and the rest is the built-in's.- In
doctor, thekraft-defaultrow no longer listschains/default.yamlas a full copy. git diffshows exactly what the move changed. Commit it.
Settings files (harnesses.yaml, policy.yaml, intake.yaml, repos.yaml and
the rest) aren't part of kraft-default. They are seeded once, as before and
the capabilities row of doctor still tells you what a newer Kraft can do with
them that yours doesn't use yet. A new policy.yaml key is yours to add only if
you want to change its default; a key your file leaves out takes the default. See
policy.yaml.
Next steps
- Migrating a home from 0.x: the one upgrade that replaces the config directory, with a backup.
- The built-in kraft-default: what it is, and what Kraft does and doesn't do with it.
- Library and chains: every field in the files you changed.
- Write your own chain: a chain of your own that extends one.
- What an update shows about kraft-default: the review before an upgrade installs.
Upgrade Kraft
Back up, upgrade and check an installed Kraft, and pin it to a version, with a pointer to how to roll back to an earlier release.
Coming from 1.4
Update a 1.4 install to the current release without losing the database, act on the changes that need it, and go back to 1.4 if the update goes wrong.