Problem
Users trying to install packs globally cd ~/.claude && mcs sync instead of running mcs sync --global from anywhere. This is broken:
~/.claude is a real directory, so SyncCommand proceeds as if it were a project root.
ProjectDetector walks up, potentially latching onto weird state or creating ~/.claude/.claude/ garbage.
- Nothing tells the user they took the wrong path — they may believe the install succeeded.
Proposed solution
1. Detect ~/.claude as cwd and redirect
At the start of SyncCommand.perform() (or inside performProject), resolve the effective target path. If it's env.claudeDirectory or anywhere under it, and --global wasn't passed:
It looks like you want to sync global scope.
Use 'mcs sync --global' instead? [Y/n]
- Yes → set
global = true internally, chdir to env.homeDirectory to keep ProjectDetector well-behaved, then proceed.
- No → hard error with the same suggestion in the message.
If --global is passed but cwd happens to be ~/.claude, silently chdir to $HOME before running — no prompt, just avoid the footgun.
2. Scope picker on bare mcs sync (bonus, same root cause)
When mcs sync runs with no --global / --pack / --all flags and ProjectDetector fails to find a project root (no .git/, no CLAUDE.local.md), show a scope picker before the pack picker:
Where to sync?
> This directory (./)
Global (~/.claude)
This kills the cd ~/.claude instinct at the root — users never need to "go somewhere" to configure globally.
Tradeoff
Pure block (error-only) is simpler but less helpful — users who get the error often retry the wrong thing. Offering the right command inline (with a confirmation prompt) converts confusion into learning. Auto-redirect without prompt is friendlier but surprising; explicit confirmation keeps intent clear.
Scope
Sources/mcs/Commands/SyncCommand.swift — add a cwd guard at the top of perform(), before performGlobal / performProject branch. Uses existing Environment.claudeDirectory for the comparison.
Problem
Users trying to install packs globally
cd ~/.claude && mcs syncinstead of runningmcs sync --globalfrom anywhere. This is broken:~/.claudeis a real directory, soSyncCommandproceeds as if it were a project root.ProjectDetectorwalks up, potentially latching onto weird state or creating~/.claude/.claude/garbage.Proposed solution
1. Detect
~/.claudeas cwd and redirectAt the start of
SyncCommand.perform()(or insideperformProject), resolve the effective target path. If it'senv.claudeDirectoryor anywhere under it, and--globalwasn't passed:global = trueinternally, chdir toenv.homeDirectoryto keepProjectDetectorwell-behaved, then proceed.If
--globalis passed but cwd happens to be~/.claude, silently chdir to$HOMEbefore running — no prompt, just avoid the footgun.2. Scope picker on bare
mcs sync(bonus, same root cause)When
mcs syncruns with no--global/--pack/--allflags andProjectDetectorfails to find a project root (no.git/, noCLAUDE.local.md), show a scope picker before the pack picker:This kills the
cd ~/.claudeinstinct at the root — users never need to "go somewhere" to configure globally.Tradeoff
Pure block (error-only) is simpler but less helpful — users who get the error often retry the wrong thing. Offering the right command inline (with a confirmation prompt) converts confusion into learning. Auto-redirect without prompt is friendlier but surprising; explicit confirmation keeps intent clear.
Scope
Sources/mcs/Commands/SyncCommand.swift— add a cwd guard at the top ofperform(), beforeperformGlobal/performProjectbranch. Uses existingEnvironment.claudeDirectoryfor the comparison.