Add build fallback, manual installation, and config sync#2
Add build fallback, manual installation, and config sync#2vncntt wants to merge 2 commits intopipmc:mainfrom
Conversation
This PR adds robustness improvements for ccind:
1. Build failure fallback:
- When devcontainer up fails (often due to SSH agent forwarding issues
with Dockerfile-with-features), ccind now looks for an existing Docker
image and starts a container directly from it
- This handles the common case where the image was previously built but
rebuilding fails due to SSH issues
2. Manual Claude installation:
- If Claude Code isn't found in the container (common with cached images),
ccind automatically installs it using the official install script
- No more manual intervention needed
3. Config sync from host:
- Copies ~/.claude.json (authentication state)
- Copies ~/.claude/settings.json (user preferences like model selection)
- Copies plugins with path translation (host paths -> container paths)
- Fixes file permissions after docker cp (copies as root, chowns to user)
4. PATH handling for Claude:
- Check both PATH and ~/.local/bin when detecting Claude
- Launch claude with PATH set correctly
Note: This PR includes changes that overlap with PR pipmc#1 (PATH handling).
If PR pipmc#1 is merged first, this PR will need rebasing.
Co-Authored-By: Claude Opus 4.5 <[email protected]>
Code ReviewFound 2 critical issues that need to be fixed before merging: Issue 1: Missing
|
The refactored start_devcontainer() function was missing the --additional-features argument, which meant the Claude Code feature and config mount feature were never installed via the devcontainer feature mechanism. Also reverted config-mount feature version to 0.1.5 (the currently published version) to avoid "feature not found" errors. Co-Authored-By: Claude Opus 4.5 <[email protected]>
Summary
Problem
Build failures: The devcontainer CLI's
--additional-featuresgenerates aDockerfile-with-featuresthat breaks SSH agent forwarding. This causes builds to fail for repos with private git dependencies.Cached images: When using cached images, the
claude-codefeature isn't applied, so Claude isn't installed.Config not syncing: The
claude-config-mountfeature doesn't work when features aren't applied. User settings likemodel: opusaren't transferred, and plugins don't work because their paths point to host locations.Changes
Build failure fallback
devcontainer upfailsvsc-<workspace>-*)Manual Claude installation
curl -fsSL https://claude.ai/install.sh | bashConfig sync
~/.claude.json(authentication state)~/.claude/settings.json(user preferences)installed_plugins.json: Replace host paths with container pathsknown_marketplaces.json: Replace host paths with container pathsmarketplaces/andcache/directoriesdocker cp(files are copied as root)PATH handling
~/.local/binfor Claude detection~/.local/binTest plan
model: opusis preserved)Note
This PR includes PATH handling changes that overlap with PR #1. If PR #1 is merged first, this PR will need rebasing. Alternatively, this PR can be merged independently as it includes all necessary fixes.
🤖 Generated with Claude Code