feat: pass host ~/.claude/{agents,commands,skills} into the container#4
Merged
Conversation
The installer now detects local agents/commands/skills in the host's ~/.claude
and offers to pass them to the container — mount the live path (default), copy a
snapshot, or skip (CLAUDE_RESOURCES_MODE overrides non-interactively). The choice
is recorded in resources.conf; claude-box mounts the chosen paths read-only at
/host-claude/<name>, and the entrypoint merges them OVER the baked state.
- start-claude.sh: unconditional merge (AFTER the baked cp, not gated by the
first-run guard) of /host-claude/{agents,commands,skills} into ~/.claude/*.
Host files win on name collision; baked-only files (commands/opsx, the openspec
skills) survive because cp merges rather than replaces the directory.
- install.sh: detect non-empty host dirs, prompt mount/copy/skip via /dev/tty
(CLAUDE_RESOURCES_MODE for non-interactive), write resources.conf (live path or
a copied snapshot under ~/.config/claude-standalone/resources/).
- claude-box launcher: source resources.conf and add `-v <path>:/host-claude/<d>:ro`
for each configured resource.
- README / CLAUDE.md: document the passthrough and merge semantics.
Validated on the local build (amd64):
- merge: with fake host agents/commands/skills mounted at /host-claude/*, the real
entrypoint logic produced ~/.claude/agents=[myagent], commands=[mycmd, opsx],
skills=[myskill, openspec-*] — i.e. host files appear AND baked opsx/openspec survive.
- install (HOME-isolated, mode=mount): detects agents+commands, writes correct
live paths to resources.conf, launcher gains the /host-claude mounts.
- install.sh + extracted launcher pass `bash -n`; ./build.sh exit 0.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
afb0ccb to
6a30b68
Compare
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.
What changed
The installer now detects the host's local
~/.claude/{agents,commands,skills}and passes them intothe container, so your own subagents, slash commands, and skills work inside
claude-box.install.sh: detects non-empty~/.claude/{agents,commands,skills}and offers — mount thelive path (default; host edits show up next run), copy a snapshot into
~/.config/claude-standalone/resources/, or skip. Non-interactive override:CLAUDE_RESOURCES_MODE=mount|copy|skip. The choice is written toresources.conf.claude-box: sourcesresources.confand mounts each configured path read-only at/host-claude/<name>.start-claude.sh): merges/host-claude/{agents,commands,skills}over thebaked state — unconditional and after the baked copy (so a resumed HOME still gets them). Host
files win on name collision; baked-only files survive because
cpmerges rather than replaces.Validation (local build, amd64)
agents/commands/skillsmounted at/host-claude/*,the real entrypoint logic produced:
agents: myagent.md(host appears)commands: mycmd.md opsx(host appears and bakedopsxsurvives)skills: myskill openspec-apply-change … openspec-sync-specs(host appears and all bakedopenspec skills survive)
CLAUDE_RESOURCES_MODE=mount): detectsagents+commands, writescorrect live paths to
resources.conf, launcher gains the/host-claudemounts.install.shand the extracted launcher passbash -n;./build.sh→ exit 0.Note
Builds on #3 (auto mode + advisor), already merged to
main; the diff here is the passthrough only.