You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This directory contains the configuration templates for Claude Code settings and permissions. The configuration uses a **layered merging system** that combines base settings with role-specific and ecosystem-specific permissions.
3
+
This directory contains the configuration templates for Claude Code settings and permissions. The configuration uses a **layered merging system** that combines roles (base settings + safety rules) with stacks (per-topic permissions and sandbox config).
1.**Base role** (`roles/base.jsonc`): settings, permissions, and sandbox extracted
97
+
2.**Active role** (`roles/$ROLE.jsonc`): settings deep-merged on top of base. Permissions and sandbox arrays concatenated (not deep-merged, which would replace arrays)
98
+
3.**Stacks** (`stacks/*.jsonc`, sorted alphabetically): permissions and sandbox arrays concatenated
99
+
4.**Deduplication**: all arrays sorted and deduplicated
100
+
5.**Local keys**: `model`, `enabledPlugins`, `extraKnownMarketplaces` preserved from existing `~/.claude/settings.json`
101
+
6.**Validation and write**
80
102
81
-
The filename pattern `permissions.*.json` is auto-discovered (excluding base, personal, and work files).
103
+
## Common Tasks
82
104
83
-
### Add an "always ask" rule
105
+
### Add a new stack
84
106
85
-
Use `ask` for commands that should always prompt for confirmation (useful for destructive but sometimes-needed operations):
107
+
Create `claude/stacks/foo.jsonc`:
86
108
87
-
```json
109
+
```jsonc
88
110
{
89
-
"allow": ["Bash(cleanup-tool)"],
90
-
"ask": ["Bash(cleanup-tool --force)"],
91
-
"deny": []
111
+
// Foo tool
112
+
"permissions": {
113
+
"allow": [
114
+
"Bash(foo:*)"
115
+
]
116
+
},
117
+
// Optional: sandbox config
118
+
"sandbox": {
119
+
"network": {
120
+
"allowedHosts": ["foo.example.com"]
121
+
},
122
+
"filesystem": {
123
+
"allowWrite": ["~/.foo"]
124
+
}
125
+
}
92
126
}
93
127
```
94
128
95
-
### Add a deny rule
129
+
Then regenerate: `./claudeconfig.sh`
96
130
97
-
Add to `permissions.json` (applies to all roles):
131
+
### Add a network host
98
132
99
-
```json
100
-
{
101
-
"allow": [],
102
-
"deny": ["Bash(dangerous-command:*)"]
103
-
}
133
+
Find the relevant stack file and add to `sandbox.network.allowedHosts`. For example, to allow a new npm registry:
134
+
135
+
Edit `claude/stacks/node.jsonc` and add to `allowedHosts`, then `./claudeconfig.sh`.
136
+
137
+
### Add a filesystem write path
138
+
139
+
Same pattern: find the relevant stack and add to `sandbox.filesystem.allowWrite`.
140
+
141
+
### Add a skill permission
142
+
143
+
Edit `claude/stacks/skills.jsonc` and add to `permissions.allow`:
144
+
145
+
```jsonc
146
+
"Skill(plugin-name:skill-name)"
104
147
```
105
148
106
149
### Check current permissions state
@@ -121,17 +164,10 @@ claude-permissions --raw
121
164
122
165
### Find and clean up duplicates
123
166
124
-
The `claude-permissions cleanup` command removes project-local permissions that duplicate global settings:
0 commit comments