Repository navigation
fix(companion): refresh Claude links in linked worktrees and after sync - #228
Merged
TornquistK merged 2 commits intoDec 2, 2026
Merged
Conversation
mate companion update now reconciles Claude skill and command links in every wrapped Checkout of each linked clone, main worktree first, keeping a linked worktree's existing .claude/skills folder current. mate companion sync runs the same refresh after every completed synchronization and reports only written and failed Checkouts.
…efresh
A clone can be linked to two companions ("Keep both"), so the refresh now
skips a checkout whose projection names another companion. Sync loads its
config through readCompanionConfig and filters current results itself;
the skills folder check reuses isDirectory and runs before the costlier
served-by-main check; keepFolder is now keepExistingFolder.
Tests pin the main-worktree-first order and a sync whose refresh cannot
start.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A skill added to the companion reached only the Registered Checkout. Linked worktrees kept their old
.claude/skills, andmate companion syncrefreshed no links at all.The wrap pass passes no option, so session prepare still withdraws a Mate-only folder. A missing folder is never created: a session may be running there. A clone linked to two companions ("Keep both") keeps each checkout's links with the companion its projection names.
runCompanionSyncCommand syncCompanionGit settleLinked + refreshClaudeLinks # completed syncs only; readCompanionConfig; reports written + failed; warns, never failsreportLinkRefreshmoved tocompanion/link-refresh-report.ts; sync filters outcurrentresults before reporting.commands.mdxdocuments both commands.Evidence
refresh-working-claude-links.test.tsfailedsync.test.tsadds:verify-mate, acme fixture with a bare upstream): a teammate pushes skillacme-team, thenmate companion syncacme-wt's link, a no-change sync restores it.packages/mate-core:bun run test7020 pass / 0 fail; typecheck and format clean; lint shows only an existing warning insrc/runtime/skill-prefix.ts.apps/docs:bun run check0 errors.mate companion updatein the real app (refuses on a prerelease build); a failed refresh, an incomplete sync, command links, an operator's own skill and the other-companion skip are covered by unit tests only.Merge Danger
Door: two-way
Only symlinks under
.claude/skillsand.claude/commandsare written; the next update or wrap reconciles them again.Blast Radius: local
mate companion updateandmate companion syncnow touch every wrapped linked worktree of a linked clone, not only the Registered Checkout. Operator-owned skills are never removed. A checkout served by another companion is left alone.