Skip to content

feat: pass host ~/.claude/{agents,commands,skills} into the container#4

Merged
intech merged 1 commit into
mainfrom
feat/host-resources-passthrough
Jun 13, 2026
Merged

feat: pass host ~/.claude/{agents,commands,skills} into the container#4
intech merged 1 commit into
mainfrom
feat/host-resources-passthrough

Conversation

@intech

@intech intech commented Jun 13, 2026

Copy link
Copy Markdown
Member

What changed

The installer now detects the host's local ~/.claude/{agents,commands,skills} and passes them into
the 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 the
    live 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 to resources.conf.
  • claude-box: sources resources.conf and mounts each configured path read-only at
    /host-claude/<name>.
  • Entrypoint (start-claude.sh): merges /host-claude/{agents,commands,skills} over the
    baked 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 cp merges rather than replaces.

Validation (local build, amd64)

  • Merge (the key assertion): with fake host agents/commands/skills mounted at /host-claude/*,
    the real entrypoint logic produced:
    • agents: myagent.md (host appears)
    • commands: mycmd.md opsx (host appears and baked opsx survives)
    • skills: myskill openspec-apply-change … openspec-sync-specs (host appears and all baked
      openspec skills survive)
  • install (HOME-isolated, CLAUDE_RESOURCES_MODE=mount): detects agents+commands, writes
    correct live paths to resources.conf, launcher gains the /host-claude mounts.
  • install.sh and the extracted launcher pass bash -n; ./build.sh → exit 0.

Note

Builds on #3 (auto mode + advisor), already merged to main; the diff here is the passthrough only.

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>
@intech intech force-pushed the feat/host-resources-passthrough branch from afb0ccb to 6a30b68 Compare June 13, 2026 13:15
@intech intech merged commit 526d588 into main Jun 13, 2026
3 checks passed
@intech intech deleted the feat/host-resources-passthrough branch June 13, 2026 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant