Skip to content

Commit 27c5ca0

Browse files
chapterjasonclaude
andcommitted
claude-code: chown ~/.cache after upstream installer run (3.0.1)
The official install.sh runs as root with HOME=$USER_HOME and writes into $HOME/.cache (its own state dir, plus $HOME/.cache/node-gyp when native modules compile). Those paths were left root-owned because the chown only covered .claude and .local — which is how downstream tools like web-shell hit EACCES on mkdir ~/.cache/<anything>/. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 0c2ee41 commit 27c5ca0

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

src/claude-code/devcontainer-feature.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"id": "claude-code",
3-
"version": "3.0.0",
3+
"version": "3.0.1",
44
"name": "claude-code",
55
"description": "Installs the latest Claude Code CLI via the official native installer into the remote user's home (~/.claude/local + ~/.local/bin), the layout the auto-updater expects. Declares ~/.claude and ~/.claude.json as persistence targets via the home-persist manifest, so credentials, sessions, and plugins survive rebuilds when home-persist is installed.",
66
"documentationURL": "https://github.com/SoureCode/devcontainer-features/tree/master/src/claude-code",

src/claude-code/install.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,15 @@ if [ ! -x "$USER_HOME/.local/bin/claude" ]; then
1818
exit 1
1919
fi
2020

21+
# The upstream installer runs as root with HOME=$USER_HOME and writes into
22+
# $HOME/.claude, $HOME/.local AND $HOME/.cache (its own state dir plus
23+
# node-gyp from any native-module compile). Chown all three so nothing is
24+
# left root-owned on the remote user's home. .cache is guarded because it
25+
# may not exist on minimal installs.
2126
chown -R "$USER_NAME:$USER_GROUP" "$USER_HOME/.claude" "$USER_HOME/.local"
27+
if [ -d "$USER_HOME/.cache" ]; then
28+
chown -R "$USER_NAME:$USER_GROUP" "$USER_HOME/.cache"
29+
fi
2230

2331
# Declare the HOME paths Claude Code needs persisted. The home-persist feature
2432
# reads every /etc/devcontainer-persist.d/*.json at create time and symlinks

0 commit comments

Comments
 (0)