Repository navigation
feat(claude-config-backup): host-prefix the layout and track machine-settings.json - #18
Merged
twistedmelonman merged 1 commit intoOct 28, 2026
Conversation
…settings.json
Each host now writes only <HOST>/cli, <HOST>/desktop and
<HOST>/machine-settings.json, so several machines can share the backup
repo. The overlay is the per-machine --settings file claude-wrapper
passes; it is in no other repo, and on 2026-10-28 ASIAGO's copy lost its
sandbox, hooks, permissions and enabledPlugins keys with no record of
what it held. It gets the same quiescence, JSON and gitleaks gates.
The host label is CLAUDE_CONFIG_BACKUP_HOST, else `hostname -s`
uppercased. Not scutil: inside the Claude Code sandbox it cannot reach
configd and prints placeholder names ("MacBook-Air"), while hostname -s
gives the real name in and out of the sandbox. It must match
^[A-Z0-9][A-Z0-9-]*$, so it is never empty and never holds '/' or '..'.
The script refuses to run on arich-mac, the company machine, detected
by host name or by its "arich" login: company config must not go into
a personal repo.
The first run moves root-level cli/ and desktop/ into <HOST>/ with
git mv, in a commit of its own. If old and new folders both exist it
logs ERROR and changes nothing. The move goes through GIT_BIN so tests
can stub it.
twistedmelonman
deleted the
claude/feat-backup-machine-settings-1fbd36f4
branch
October 28, 2026 20:14
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.
Steps 1 and 2 of dev-env
docs/plans/2026-10-28-machine-settings-sync.md, un-deferred after ASIAGO'smachine-settings.jsonlost itssandbox,hooks,permissionsandenabledPluginskeys on 2026-10-28 with no record of what it held.<HOST>/cli/claude.json,<HOST>/desktop/claude_desktop_config.jsonand now<HOST>/machine-settings.json, with the same quiescence, JSON and gitleaks gates.<HOST>ishostname -s, uppercased, and must match^[A-Z0-9][A-Z0-9-]*$. Notscutil: inside the Claude Code sandbox it cannot reach configd and prints placeholder names.CLAUDE_CONFIG_BACKUP_HOSToverrides it (tests use it).ARICH-MAC*or thearichlogin): company config stays out of this personal repo.cli/anddesktop/move into<HOST>/withgit mv, in a commit of their own. Both layouts present →ERROR, nothing changes.Rollout order matters: ASIAGO must run the migration before any other host runs this script. A different host would otherwise see ASIAGO's root-level files and move them into its own folder. Only ASIAGO runs the job today (plan step 3, other machines, is not started).
Tests:
tests/claude-config-backup.bats23/23 (16 new). Against the old script, 18 of 23 fail.