feat(#768): pre-populate settings.json permissions.allow/deny for Claude Code (#819)

* feat(#768): pre-populate settings.json permissions.allow/deny for Claude Code

Adds mergeClaudePermissions() to bin/install.js which non-destructively
appends GSD's known-safe tool-call patterns to permissions.allow and
defense-in-depth credential-file patterns to permissions.deny during
Claude Code installs. Merge is idempotent (no duplicates on reinstall)
and additive (existing user entries preserved). Uninstall removes only
the exact GSD-owned entries.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* chore: update changeset pr number to 819

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Tom Boucher
2026-06-07 18:56:20 -04:00
committed by GitHub
parent a3aa0ae142
commit dc7f1557c6
5 changed files with 437 additions and 2 deletions

View File

@@ -817,6 +817,35 @@ See [docs/manual-update.md](manual-update.md) for a step-by-step manual update p
When a workflow fails in a non-obvious way, run `/gsd-forensics` to generate a diagnostic report covering git history anomalies, artifact integrity, and state inconsistencies. Output goes to `.planning/forensics/`.
### Pre-populated Permissions (Claude Code)
Since v1.3.1, the installer pre-populates `~/.claude/settings.json` (or
`settings.local.json` for local installs) with the core permissions GSD needs:
```json
{
"permissions": {
"allow": [
"Bash(npx gsd-core *)",
"Read(.planning/*)",
"Write(.planning/*)",
"Read(STATE.md)",
"Write(STATE.md)"
],
"deny": [
"Read(.env)",
"Read(.env.*)",
"Read(.secrets)"
]
}
}
```
These entries eliminate first-run approval prompts for GSD's own tool calls. The
merge is non-destructive — your existing permissions are preserved and GSD entries
are only appended. Uninstalling GSD removes exactly these entries and preserves
any others.
### Executor Subagent Gets "Permission denied" on Bash Commands
Add the required patterns to `~/.claude/settings.json`. Core patterns needed for all stacks: