chore: Add support for rtk - #262
Conversation
Add support in the devcontainer for rtk and mount the user's ~/.claude directory. To use rtk automatically in vs code copilot chat, enable "chat.useClaudeHooks" in your vsc settings and reload (only works on new sessions). This change assumes the user has rtk installed and initialized globally. It does not run rtk init in the project.
There was a problem hiding this comment.
Pull request overview
This PR updates the VS Code devcontainer environment to support using rtk inside the container and to surface the developer’s local Claude configuration by bind-mounting ~/.claude into the container user’s home directory.
Changes:
- Install
rtkduring devcontainer image build under the non-root builder user. - Bind-mount the host
~/.claudedirectory into the container to enable Claude hooks/config usage.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
docker/Dockerfile.devcontainer |
Adds a user-scoped rtk installation step intended for devcontainer usage. |
.devcontainer/devcontainer.json |
Adds a bind mount for the host ~/.claude directory into the container user’s home. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
608221b
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
Suppressed comments (2)
docker/Dockerfile.devcontainer:65
curl ... | shcan mask download failures because the RUN step’s exit code will besh’s status (and/bin/shdoesn’t enablepipefail). If the fetch fails,shmay exit 0 after reading an empty stream, leaving rtk uninstalled while the image build still succeeds.
RUN curl -fsSL https://raw.githubusercontent.com/rtk-ai/rtk/refs/heads/master/install.sh | sh
.devcontainer/devcontainer.json:36
- This bind mount will fail devcontainer startup for developers who don’t already have
${HOME}/.claudeon the host (Dev Containers typically uses--mount type=bind, which errors when the source path doesn’t exist). Either ensure it’s created by the host-side init script or document the requirement here so startup failures are self-explanatory.
"source=${localEnv:HOME}/.ssh,target=/home/${localEnv:USER}/.ssh,type=bind",
"source=${localEnv:HOME}/.claude,target=/home/${localEnv:USER}/.claude,type=bind"
],
|
This PR focuses on the preferred install path of a user setting up rtk on the host globally for various tools (could be copilot, claude, opencode, gemini, whatever). If we prefer a local-scoped install instead, I can do that. It just means that token saving data will get wiped each container rebuild and gains won't contribute to user-wide data. |
Add support in the devcontainer for rtk and mount the user's ~/.claude directory. To use rtk automatically in vs code copilot chat, enable "chat.useClaudeHooks" in your vsc settings and reload (only works on new sessions). This change assumes the user has rtk installed and initialized globally. It does not run rtk init in the project.