How to review and roll back an update
Look at what an update will change before you apply it, and return to the previous versions if it breaks something. This guide uses a repository with a committed .agents/lock.yaml. update has no dry-run flag, so the review uses lock --upgrade and sync --check instead.
Prerequisites
- A repository with
.agents/config.yamland.agents/lock.yamlcommitted, and no uncommitted changes to either file. - At least one remote Git source. Directory sources are never locked, so you cannot review or roll them back this way.
1. Move the lock without touching files
Work on a branch, then move the locks to the current commits of their refs:
git switch -c update-agent-resources
agent-marketplace lock --upgradeExpected output:
Locks: 1 changedLocks: 0 changed means nothing upstream moved, and you can stop here. The default scope also covers your user and personal-local locks, so the count can be higher than one. To move one registry only, add --registry <url>.
2. Review the change
See which commits moved:
git diff -- .agents/lock.yamlEach changed commit: line marks a registry that moved. Under it, a resource with a new content_digest changed content, a new name entry is a resource added upstream, and a removed name entry is a resource that disappeared or was renamed. Read the registry's changelog for the commit range.
Then see which harness files a sync would write or remove:
agent-marketplace sync --checkTypical output:
sync: 2 out of sync (2 writes)
→ /home/alex/project/.claude/skills
+ foo
+ keep
Error: 2 outputs out of sync+ marks a file sync will write and - a file it will remove. The list includes every selected resource from a moved registry, even one whose content did not change, because each commit gets its own cache folder. Use the content_digest lines from the diff to tell real content changes apart. A - line for a resource you still select usually means it was renamed or removed upstream; see how to handle a renamed or removed resource.
3. Apply and commit
agent-marketplace sync
agent-marketplace statusExpected sync output:
Installed 2 Removed 0 Malformed 0 Errors 0
→ /home/alex/project/.claude/skills (2 written)Check the WARNINGS section of status for selected but not found. Try the updated resources in your harness, then commit the lock and open a pull request so reviewers see the same diff:
git add .agents/lock.yaml
git commit -m "Update agent resources"agent-marketplace update does steps 1 and 3 in one command. Use it when you do not need to review first.
4. Roll back
To undo an update that you have not committed, restore the lock and sync:
git checkout HEAD -- .agents/lock.yaml
agent-marketplace syncExpected output:
Installed 2 Removed 0 Malformed 0 Errors 0
→ /home/alex/project/.claude/skills (2 written)To undo an update that is already committed, revert the commit and sync:
git revert <commit>
agent-marketplace syncConfirm that the files now match the restored lock:
agent-marketplace sync --lockedExpected output:
Installed 0 Removed 0 Malformed 0 Errors 0Teammates return to the old versions with a plain sync after they pull the revert.
Roll back your user-wide resources
~/.agents/lock.yaml is not in Git. Copy it before you update, and copy it back to roll back:
cp ~/.agents/lock.yaml ~/.agents/lock.yaml.before-update
agent-marketplace update --scope user
# to roll back:
cp ~/.agents/lock.yaml.before-update ~/.agents/lock.yaml
agent-marketplace syncOrganization resources follow the organization lock, which only its administrator can change.
Troubleshooting
sync --checkorsync --lockedreportslock.snapshot-unavailableafter a rollback: the old commit is no longer in your cache, for example afteragent-marketplace gc. A plainsyncfetches it again. If the registry rewrote its history and the commit no longer exists, you cannot return to it; pin a tag or another commit instead.sync --checklists nothing butLocks: 1 changed: the moved registry provides none of your selected resources. Commit the lock anyway so every machine records the same commit.