Skip to content

Instantly share code, notes, and snippets.

@fgeierst
Created January 7, 2026 11:16
Show Gist options
  • Select an option

  • Save fgeierst/b5210d4bfe67fa5d3d7f0ff0b5e442e8 to your computer and use it in GitHub Desktop.

Select an option

Save fgeierst/b5210d4bfe67fa5d3d7f0ff0b5e442e8 to your computer and use it in GitHub Desktop.
Copy Claude config from host to devcontainer on initialization
"initializeCommand": "bash -c 'docker run --rm -v \"$HOME:/source:ro\" -v \"claude-code-config-${devcontainerId}:/dest\" --user root node:24 sh -c \"if [ -d /source/.claude ]; then cp -r /source/.claude/* /dest/ 2>/dev/null || true; fi; if [ -f /source/.claude.json ]; then cp /source/.claude.json /dest/ 2>/dev/null || true; fi; chown -R 1000:1000 /dest\"'",
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment