[FIX] bare origin claude syncs workspace symlinks (plugins, sessions, …)#19
Merged
Merged
Conversation
…sions, …) Launching bare `claude` on origin (CLAUDE_CONFIG_DIR unset) fell through to `command claude` with no _prepare-claude-launch, so ~/.claude's shareable dirs were never migrated into the workspace and symlinked — only the legacy base-5 (projects/memory/agents/commands/todos) were linked. Named/pinned accounts (CLAUDE_CONFIG_DIR set) worked; origin bare launches did not. - _prepare-claude-launch: add --links-only (runs the workspace linker, skips the .claude.json merge). Bare origin reads ~/.claude.json (home), not <accountDir>/.claude.json, so merging there would target the wrong file. - Resolve the account-dir symlink up front: ~/.claude is a symlink and FileManager.contentsOfDirectory(at:) does not traverse a symlinked dir (POSIX EINVAL/ENOTDIR), which would otherwise skip all linking. - claude() wrapper: when CLAUDE_CONFIG_DIR is unset and ~/.claude/metadata.json exists, run `_prepare-claude-launch --account-dir "$HOME/.claude" --links-only` (best-effort, no capture — nothing to reconcile without a .claude.json merge). Tests: --links-only skips the merge; --account-dir follows a symlinked dir; wrapper links workspace for bare origin. Full suite green.
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
Bare
claudeon origin (CLAUDE_CONFIG_DIRunset) never ran the workspace linker, so~/.claude's shareable dirs (plugins,sessions,shell-snapshots,session-env, …) stayed per-account real dirs instead of being shared into the workspace — only the legacy base-5 (projects/memory/agents/commands/todos) were linked. Named/pinned accounts (CLAUDE_CONFIG_DIRset) already worked; origin bare launches did not. This is whypluginsnever became a symlink on a second machine that launches origin directly._prepare-claude-launch --links-only— runs the workspace linker but skips the.claude.jsonmerge. Bare origin reads~/.claude.json(home), not<accountDir>/.claude.json, so merging there would target the wrong file.~/.claudeis a symlink to the origin account dir, andFileManager.contentsOfDirectory(at:)does not traverse a symlinked directory (POSIX EINVAL/ENOTDIR), which would otherwise silently link nothing.claude()wrapper — whenCLAUDE_CONFIG_DIRis unset and~/.claude/metadata.jsonexists, run_prepare-claude-launch --account-dir "$HOME/.claude" --links-only(best-effort; no_capture-claude-exit, since nothing is merged to reconcile).Result: bare origin launches now share the same dirs as
orrery use origin.Test Plan
--links-onlysyncs workspace symlinks without merging.claude.json--account-dirfollows a symlinked account dir (the~/.claudeorigin case)claude()wrapper links workspace for bare origin launch (CLAUDE_CONFIG_DIR unset)bash -nandzsh -nplugins(incl. nested content) through a~/.claude-style symlink; idempotent on re-run🤖 Generated with Claude Code