Troubleshooting
Updates and recovery
Separate binary and Kit updates, interpret preview and failure exits, and restore only verified snapshots.
Use this page when an update does not apply, updates the wrong scope, reports a partial failure, or needs to be rolled back.
Identify what you intended to update
ak self-update handles the ak binary. ak update coordinates the CLI,
global Kits, and project Kits, or updates an explicitly selected scope.
ak kit refresh refreshes one installed Kit route independently.
Check the binary without changing disk:
ak --version
ak self-update --check --channel <channel> --jsonA successful check exits 0; read available, status, and version fields to
learn whether an update exists. Network, verification, staging, or replacement
errors exit 1; invalid flags exit 2. A package-manager-owned binary reports
the manager and its native upgrade command instead of replacing the binary.
Binary-update and Kit-package channels are separate. Check the intended binary
channel and select the same intended Kit channel explicitly when compatibility
requires them to align; do not edit cached manifests.
Preview Kit and project changes
ak update ./myproj --dry-run --show-diffAn explicit project --dry-run is read-only and exits 0 when the preview
succeeds. In a script or non-interactive session,
ak update ./myproj without --yes also stays preview-only, but exits 3 so
automation can distinguish “not applied” from an applied update. Bare
interactive ak update opens the CLI → global Kits → project Kits wizard; each
apply step defaults to No.
Apply only after checking the selected project, runtime, Kit, and channel:
ak update ./myproj --yesUse ak self-update --yes for the binary only, or
ak update --global --yes for AgentKit-owned user installs. Bare
ak update --yes accepts every unified wizard step, so use it only when all
three scopes are intended.
Global Kit update is preserve-only: --force does not authorize overwriting
user-modified global files. A Claude user-plugin-only install is reported rather
than silently refreshed; refresh that exact route with:
ak kit refresh <kit> --global --switch-to-plugin --yesIf a global Claude refresh reports refusing foreign-home takeover, it stopped
before changing the discovered Claude home. A snapshot ID can still be present
because the snapshot is captured before that ownership refusal; it proves that
recovery material exists, not that a partial write occurred. Confirm the home is
the intended global install, then run the exact
ak kit init <kit> --global command from the error to re-establish ownership.
Do not restore solely because this pre-mutation failure includes a snapshot.
An applied runtime error, CLI hard gate, partial Kit failure, or interruption
after mutation exits 1. Invalid scope or target combinations exit 2.
A "kit installs are being modified" or busy error appears unexpectedly
If a lock or "kit installs are being modified" error shows up without you
having run ak update, an opted-in background auto-update may be running.
Check it read-only:
ak update --status --jsonWait for it to finish, then retry. To stop background updates for good, run
ak update --schedule off or set AK_NO_AUTO_UPDATE=1 for one invocation.
On Windows, a status of deferred (spawn_in_job) means the caller's process
is inside a Windows Job Object that forbids breakaway and is kill-on-close, so
a background runner started there would end with the command. A job that
forbids breakaway but is not kill-on-close does not defer; the runner starts
inside it. The next interval tries again, but a caller that always runs in a
kill-on-close job defers every time; run ak update from a plain terminal
instead.
A status of deferred (rollback_hold) means the home was rolled back to v2 and
the hold is still in place, so the background run installs nothing.
deferred (rollback_state_unreadable) means the run could not read the rollback
journal, so it waited too. To return to v3, follow
Return to v3.
Work around one failed global runtime on Windows
A global update reports each runtime separately. If the Claude Code row failed
before mutation while the Codex row says updated, Codex was updated; do not
describe the whole update as failed.
Do not treat generic terminal guidance about disk space or backup permissions as
the root cause. The CLI still uses that classification for any raw error that
contains snapshot and that it does not recognize more specifically; versions
before 3.2.0-beta.7 also applied it to recovery hints that only mention a
snapshot. A printed snapshot ID proves that at least one earlier
capture succeeded. It does not prove a partial write, and a later capture can
still fail because of disk space, ACL or security software, a locked or
unreadable Claude path, a foreign-home refusal, or another snapshot-path error.
Read the local detail first
In PowerShell, locate the failed Claude Code row and its relevant markers in the newest local report:
$report = Get-ChildItem "$env:USERPROFILE\.agentkit\support\update-report-*.md" |
Sort-Object LastWriteTime -Descending |
Select-Object -First 1
$report.FullName
Select-String -Path $report.FullName `
-Pattern '^### engineer \[claude-code\]$','^- Detail:','^- Snapshot:'Share only the relevant - Detail: and - Snapshot: lines. Redact usernames,
email addresses, project paths, tokens, and unrelated diagnostics. Without the
raw - Detail:, keep the cause unresolved.
If more evidence is needed, these checks are read-only:
ak backups show <snapshot-id> --json
ak backups verify <snapshot-id>
ak doctor --json --offline
Get-PSDrive -Name CFix the exact cause, then retry only Claude Code
Keep .agentkit, .claude, and the snapshot. Do not bypass the safety boundary
with --no-backup.
- For a locked or unreadable path, close Claude Code and the process holding that path, correct readability or permissions for that exact path, then retry.
- For a no-space detail, free space on the volume that contains the source and AgentKit backups.
- For
refusing foreign-home takeover, first confirm that AgentKit should own the global Claude Code surface. Then use the exact recovery commandak kit init engineer --global --channel <channel>, replacing<channel>with the release channel selected in the docs header. This is an ownership decision, not a permissions error. - For
runtime marker ... is not owned by an AgentKit installorruntime marker ... has foreign or modified content, the update stopped before changing any runtime file. This is an ownership refusal, not a snapshot or disk-space failure. If the install is yours, run the exactak kit init ... --force --yescommand printed in the detail; it takes a recovery snapshot, then replaces the marker. A marker that differs only in CRLF line endings (a Windows checkout withcore.autocrlf=true) is no longer refused; when the detail namescore.autocrlf, add a.gitattributesrule such as.claude/** text=auto eol=lfso Git keeps AgentKit files LF. - For
checking target before snapshotorinspect ... before snapshot, a path in the target is not the type AgentKit expected, for example a symlinked file where a directory belongs. Move that path aside, retry, then restore it if you still need it. - For
statusline target ... is not owned by an AgentKit installorstatusline target ... has foreign or modified content, the update stopped before changing any runtime file. If the statusLine is yours to replace, run the exactak kit init ... --force --yescommand printed in the detail; it takes a recovery snapshot, then replaces the statusLine. - Some snapshot failures are not about disk space; the detail says which one.
For a path that is not a regular file, move it aside, retry, then
restore it. For a file that changed during capture, close the runtime that
uses it, then retry. For a Skill that exceeds the safety limit, remove large
or generated files from the named Skill folder. For a recovery snapshot that
failed verification, check it with
ak backups verify <id>, then retry. For a stable directory snapshot or a plugin activation snapshot, retry once nothing is writing to that path; if it repeats, report it with the support bundle. - For
... require a recovery snapshotor--fresh always takes a verified recovery snapshot, the run used--no-backup. Run it again without that flag.
After correcting the cause, retry only the failed runtime:
ak update --global --target claude-code --yesAt the time this behavior was verified, 2.8.0-beta.8 was the latest beta. In
that version, a refusing foreign-home takeover detail should receive the
dedicated pre-mutation ownership guidance above. If that exact detail instead
receives generic snapshot guidance, preserve the redacted report lines and
contact support; treat it as a guidance regression, not proof of a snapshot or
permissions failure.
A Codex warning such as
preserving hook script ...cook-after-plan-reminder.cjs is a separate
ownership-preservation result. Do not use it to diagnose the Claude Code
snapshot failure.
Recover a locked Windows CLI self-update
A CLI-only ak self-update launches a detached trusted helper after the current
process exits. If another terminal, IDE, or runtime daemon keeps ak.exe
locked, close those processes and retry with the intended release channel:
ak self-update --channel <channel> --yesIf Windows still refuses replacement, use the official installer rather than deleting updater state or swapping an unverified executable:
$env:AK_CHANNEL = "<channel>"
irm https://agentkit.best/install.ps1 | iexReplace <channel> with the channel selected in the docs header. A later
self-update sweeps only recognized inactive helper, candidate, backup, and
readiness files. It preserves active pending state and unrelated files with
similar names.
A kit requires a CLI version no build on your channel provides
The ak CLI and kits pick their release channels independently. A beta CLI that
refreshes kits on the default stable kit channel can meet a stable floor that
no beta build satisfies, because a prerelease such as 3.0.0-beta.41 ranks
below its own release 3.0.0. The failed row names both channels and the newest
build on the CLI channel, and its Next line gives the exact command:
✗ engineer: failed
Why: the stable engineer kit requires ak >= 3.0.0; the newest beta build of ak is 3.0.0-beta.41Put the CLI and the kit on one channel, then the update installs normally:
# Keep the beta CLI and take the kit from the beta channel
ak update --global --yes --kits engineer --channel beta
# Or move ak to the stable channel, then refresh the kit from stable
ak update --global --yes --kits engineer --channel stableFor a project update, --channel selects only the kit channel, so switch the
CLI first with ak self-update --channel stable, then re-run
ak update --yes --kits engineer. Later updates of the kit follow the channel
you pick. Kit floors are never relaxed for a
prerelease, so an older CLI cannot install a kit built for a newer one.
Renewal required when an update is refused
If an update is refused with renewal_required (exit 15 for ak kit init --version,
ak kit refresh --version, or an ak update --version batch whose only failures
are renewals), the version you requested was released after
your update window ended. Nothing was written and your installed kits still
work.
ak licenses
ak licenses --json- Read the kit's
updatesThroughdate,latestEntitledVersion, and the renewal link. - To stay on a covered version, rerun without
--version, or pin the latest covered version. - To get the newer release, renew at the link, then rerun the command.
- In scripts, branch on
error_code: "renewal_required"andupdates.renew_urlinstead of the message text.
An unpinned ak update does not fail: it skips the kit with
reason: "renewal_required" and exits 0. See
Update windows and renewal.
A kit is skipped as not_licensed
If ak update reports a kit with status: "skipped" and
reason: "not_licensed", the signed-in account holds no license for that kit.
Nothing was written for it: the installed copy is kept unchanged. The skip
does not fail the run, and re-running the update does not change it.
ak licenses- Run
ak licensesto see which kits this account owns. - If another account owns the kit, sign in with that account, then rerun the update.
- Otherwise buy the kit, then rerun the update.
- If you no longer need the kit, remove it with
ak kit uninstall <kit>(add--globalfor a global install).
A kit download says the package host is temporarily unavailable
An error containing kit package host is temporarily unavailable
means the host that serves kit packages kept answering with a timeout,
rate-limit, or server error (HTTP 408, 429, or 5xx) through every automatic
retry. This is a service-side outage, not a blocked network and not a bad
package. That step did not change your installed kit files.
When AgentKit already verified the same kit, runtime, and version on this
machine, ak update and ak setup reuse that cached copy and you do not see
this error. You see it only when no usable verified copy exists.
- Wait a few minutes, then rerun the same command.
- If it keeps failing, run
ak doctorand report the failure with the generated support bundle.
A 403 or 404 from the package host, or a size or checksum mismatch, is
different: AgentKit never falls back to the cache for those, because they can
mean the package itself is wrong.
A refresh or update refuses an unreadable ownership record
An error such as native ownership for ... has no recorded hash; refusing refresh means the Kit's native ownership record under
<lifecycle>/.agentkit/ (native-skill-paths.json and
native-skill-hashes.json) is malformed or incomplete. AgentKit refuses rather
than guess which files the Kit owns, and the refusal names the recovery command.
Under --json, it is the remediation with reason ownership.index_unreadable.
ak kit refresh <kit> [--global] --target <runtime> --rebuild-ownership --yesThe command takes a recovery snapshot first, records again the files that still
match the Kit, and keeps and lists the files that differ. If it is interrupted,
rerun the same command. If it refuses with ownership.root_unproven, follow the
ak kit init <kit> [--global] --target <runtime> --fresh reset it names.
Never delete or hand-edit the index files. See
ak kit refresh
for the full behavior.
An untracked hook runtime file stops a Claude Code update
An install made by an older AgentKit release can hold Claude Code hook support
files, such as hooks/lib/ck-config-utils.cjs or hooks/lib/colors.cjs, that
the install record does not list. Before the fix for
agentkit#3529, every
later ak update stopped with
the untracked native hook runtime file "hooks/lib/..." differs from this kit's version.
A build that includes that fix checks the file's exact contents against every
version AgentKit has shipped at that path. When they match, the update first
saves the old copies in a recovery snapshot, then replaces them and continues.
The JSON result lists this under notices with the backup ID and the restore
command, for example ak backups restore <id>. A refresh after such a restore
needs --force. With --no-backup, the notice says no snapshot was taken.
The update still stops when the file holds other content, for example because you edited it or another tool wrote it. Keep your copy somewhere safe if you need it, then run the command the error names; it takes a recovery snapshot before replacing the file. For a global install it looks like this:
ak update --global --target claude-code --force --yesAfterwards, ak doctor --json should report hook_registration as ok.
Check the result
ak --version
ak doctor --json
ak audit --project-dir . --jsonThe CLI version and doctor report confirm binary and environment state. Audit
checks recorded project-native Claude Code Kit content here; use
ak audit --json for user plugins or
--plugin-mode --project-dir ./ak-engineer for the
named project plugin root. Exit 0 is clean and exit 1 means drift or an audit
error. Remember that default doctor output can be unhealthy while the command
exits 0; inspect data.healthy.
Inspect recovery snapshots
Mutating project and global Kit update paths take recovery snapshots. Binary self-update instead uses verified replacement. Use the snapshot ID printed by the failed Kit operation when available:
ak backups list
ak backups show <id>
ak backups verify <id>
ak backups restore <id> --dry-runlist, show, verify, and restore preview are read-only. show or verify
exits 5 if the ID does not exist; verify exits 1 if the snapshot is
corrupt. Do not restore a snapshot that fails verification.
Project update output can say that its snapshot is outside
ak backups restore scope and print a snapshot-files directory. In that case,
follow the printed manual copy path for the affected project files; do not try
to widen restore authority or restore unrelated state.
Restore a verified snapshot
Preview first, then confirm the exact ID:
ak backups restore <id> --dry-run
ak backups restore <id>If ak backups show <id> lists project bundle roots, authorize only those exact
absolute paths with one repeated --allow-root per root:
ak backups restore <id> --allow-root /absolute/projectA broader or different path is rejected.
Use --latest only after ak backups list proves the newest snapshot belongs
to this operation. Restore exit behavior is classified:
| Exit | Meaning |
|---|---|
0 | Preview or restore completed. |
1 | Verification, authority, I/O, or another restore failure. |
2 | Invalid arguments, such as combining an ID with --latest. |
3 | You declined confirmation; nothing was restored. |
4 | Another backup operation holds the lock. |
5 | The snapshot ID is invalid or missing, or no snapshots exist. |
Restore is replace-only: it overwrites captured files, removes exact paths recorded absent and explicitly approved AgentKit plugin trees, and preserves unrelated files created later. A multi-file restore is not transactional, so a host failure can leave an intermediate state; avoid interrupting it and take an appropriate backup before rolling backward when practical.
After restore, repeat ak --version, ak doctor --json, and the applicable
audit. Do not delete backup storage, runtime homes, or ~/.agentkit; those
actions remove the evidence and recovery path you need. Do not use --force as
a routine update retry.
Related pages
Runtime cannot find a Skill or Agent
Verify the runtime, project or global scope, installed content, and supported projection when a successful install is not discoverable.
Configuration problems
Find the effective AgentKit preferences, validate both scopes, and remove only the override that caused the problem.