Skip to content

Commit 4a54558

Browse files
committed
feat: configure claude
This makes Claude more unrestricted in a containerised environment (to avoid asking for permission to do non-destructive things), but gives guardrails for things that will interact with the outside world or production systems. Signed-off-by: Simon Emms <simon@simonemms.com>
1 parent b19ecf9 commit 4a54558

3 files changed

Lines changed: 37 additions & 3 deletions

File tree

images/base/.devcontainer/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ RUN add-apt-repository ppa:aos1/diff-so-fancy \
7171
&& apt-get update \
7272
&& apt-get install -y diff-so-fancy
7373

74+
# Add default managed settings for Claude
75+
RUN mkdir -p /etc/claude-code
76+
COPY claude-managed-settings.json /etc/claude-code/managed-settings.json
77+
7478
USER vscode
7579
WORKDIR /home/vscode
7680

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"permissions": {
3+
"defaultMode": "bypassPermissions",
4+
"deny": [
5+
"Bash(git push *)",
6+
"Bash(git push --force*)",
7+
"Bash(git push -f*)",
8+
"Bash(gh repo delete *)",
9+
"Bash(gh release create *)",
10+
"Bash(* production *)",
11+
"Bash(* prod *)",
12+
"Bash(kubectl apply *)",
13+
"Bash(kubectl delete *)",
14+
"Bash(kubectl rollout restart *)",
15+
"Bash(kubectl scale *)",
16+
"Bash(kubectl config use-context *)",
17+
"Bash(terraform apply *)",
18+
"Bash(terraform destroy *)",
19+
"Bash(aws *prod*)",
20+
"Bash(gcloud *prod*)",
21+
"Bash(az *prod*)",
22+
"Bash(op *)",
23+
"Bash(pass *)"
24+
]
25+
}
26+
}

images/base/.devcontainer/devcontainer.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
"ghcr.io/eitsupi/devcontainer-features/jq-likes:2": {
1515
"yqVersion": "4"
1616
},
17-
"ghcr.io/devcontainers/features/github-cli:1": {}
17+
"ghcr.io/devcontainers/features/github-cli:1": {},
18+
"ghcr.io/anthropics/devcontainer-features/claude-code:1": {}
1819
},
1920
"customizations": {
2021
"vscode": {
@@ -25,9 +26,12 @@
2526
"GitHub.vscode-github-actions",
2627
"ms-vscode.makefile-tools",
2728
"ms-vsliveshare.vsliveshare",
28-
"Anthropic.claude-code",
2929
"openai.chatgpt"
30-
]
30+
],
31+
"settings": {
32+
"claudeCode.allowDangerouslySkipPermissions": true,
33+
"claudeCode.initialPermissionMode": "bypassPermissions"
34+
}
3135
}
3236
},
3337
"shutdownAction": "stopContainer",

0 commit comments

Comments
 (0)