Claude Settings Audit
Analyze this repository and generate recommended Claude Code settings.json permissions for read-only commands.
Phase 1: Detect Tech Stack
Run these commands to detect the repository structure:
ls -la
find . -maxdepth 2 \( -name "*.toml" -o -name "*.json" -o -name "*.lock" -o -name "*.yaml" -o -name "*.yml" -o -name "Makefile" -o -name "Dockerfile" -o -name "*.tf" \) 2>/dev/null | head -50
Check for these indicator files:
| Category |
Files to Check |
| Python |
pyproject.toml, setup.py, requirements.txt, Pipfile, poetry.lock, uv.lock |
| Node.js |
package.json, package-lock.json, yarn.lock, pnpm-lock.yaml |
| Go |
go.mod, go.sum |
| Rust |
Cargo.toml, Cargo.lock |
| Ruby |
Gemfile, Gemfile.lock |
| Java |
pom.xml, build.gradle, build.gradle.kts |
| Build |
Makefile, Dockerfile, docker-compose.yml |
| Infra |
*.tf files, kubernetes/, helm/ |
| Monorepo |
lerna.json, nx.json, turbo.json, pnpm-workspace.yaml |
Phase 2: Detect Services
Check for service integrations:
| Service |
Detection |
| Sentry |
sentry-sdk in deps, @sentry/* packages, .sentryclirc, sentry.properties |
| Linear |
Linear config files, .linear/ directory |
Read dependency files to identify frameworks:
package.json → check dependencies and devDependencies
pyproject.toml → check [project.dependencies] or [tool.poetry.dependencies]
Gemfile → check gem names
Cargo.toml → check [dependencies]
Phase 3: Check Existing Settings
cat .claude/settings.json 2>/dev/null || echo "No existing settings"
Phase 4: Generate Recommendations
Build the allow list by combining:
Baseline Commands (Always Include)
[
"Bash(ls:*)",
"Bash(pwd:*)",
"Bash(find:*)",
"Bash(file:*)",
"Bash(stat:*)",
"Bash(wc:*)",
"Bash(head:*)",
"Bash(tail:*)",
"Bash(cat:*)",
"Bash(tree:*)",
"Bash(git status:*)",
"Bash(git log:*)",
"Bash(git diff:*)",
"Bash(git show:*)",
"Bash(git branch:*)",
"Bash(git remote:*)",
"Bash(git tag:*)",
"Bash(git stash list:*)",
"Bash(git rev-parse:*)",
"Bash(gh pr view:*)",
"Bash(gh pr list:*)",
"Bash(gh pr checks:*)",
"Bash(gh pr diff:*)",
"Bash(gh issue view:*)",
"Bash(gh issue list:*)",
"Bash(gh run view:*)",
"Bash(gh run list:*)",
"Bash(gh run logs:*)",
"Bash(gh repo view:*)",
"Bash(gh api:*)"
]
Stack-Specific Commands
Only include commands for tools actually detected in the project.
Python (if any Python files or config detected)
| If Detected |
Add These Commands |
| Any Python |
python --version, python3 --version |
poetry.lock |
poetry show, poetry env info |
uv.lock |
uv pip list, uv tree |
Pipfile.lock |
pipenv graph |
requirements.txt (no other lock) |
pip list, pip show, pip freeze |
Node.js (if package.json detected)
| If Detected |
Add These Commands |
| Any Node.js |
node --version |
pnpm-lock.yaml |
pnpm list, pnpm why |
yarn.lock |
yarn list, yarn info, yarn why |
package-lock.json |
npm list, npm view, npm outdated |
TypeScript (tsconfig.json) |
tsc --version |
Other Languages
| If Detected |
Add These Commands |
go.mod |
go version, go list, go mod graph, go env |
Cargo.toml |
rustc --version, cargo --version, cargo tree, cargo metadata |
Gemfile |
ruby --version, bundle list, bundle show |
pom.xml |
java --version, mvn --version, mvn dependency:tree |
build.gradle |
java --version, gradle --version, gradle dependencies |
Build Tools
| If Detected |
Add These Commands |
Dockerfile |
docker --version, docker ps, docker images |
docker-compose.yml |
docker-compose ps, docker-compose config |
*.tf files |
terraform --version, terraform providers, terraform state list |
Makefile |
make --version, make -n |
Skills (for mpuig-skills plugin)
If mpuig-skills plugin is installed, include:
[
"Skill(mpuig-skills:commit)",
"Skill(mpuig-skills:create-pr)",
"Skill(mpuig-skills:code-review)",
"Skill(mpuig-skills:find-bugs)",
"Skill(mpuig-skills:iterate-pr)",
"Skill(mpuig-skills:claude-settings-audit)",
"Skill(mpuig-skills:agents-md)"
]
WebFetch Domains
Always Include
[
"WebFetch(domain:docs.github.com)",
"WebFetch(domain:cli.github.com)"
]
Framework-Specific
| If Detected |
Add Domains |
| Python |
docs.python.org |
| Django |
docs.djangoproject.com |
| Flask |
flask.palletsprojects.com |
| FastAPI |
fastapi.tiangolo.com |
| Pydantic |
docs.pydantic.dev |
| pytest |
docs.pytest.org |
| React |
react.dev |
| Next.js |
nextjs.org |
| Vue |
vuejs.org |
| Express |
expressjs.com |
| Rails |
guides.rubyonrails.org, api.rubyonrails.org |
| Go |
pkg.go.dev |
| Rust |
docs.rs, doc.rust-lang.org |
| Docker |
docs.docker.com |
| Kubernetes |
kubernetes.io |
| Terraform |
registry.terraform.io |
MCP Server Suggestions
MCP servers are configured in .mcp.json (not settings.json). Check for existing config:
cat .mcp.json 2>/dev/null || echo "No existing .mcp.json"
Sentry MCP (if Sentry SDK detected)
Add to .mcp.json (replace {org-slug} and {project-slug} with your Sentry organization and project slugs):
{
"mcpServers": {
"sentry": {
"type": "http",
"url": "https://mcp.sentry.dev/mcp/{org-slug}/{project-slug}"
}
}
}
Linear MCP (if Linear usage detected)
Add to .mcp.json:
{
"mcpServers": {
"linear": {
"command": "npx",
"args": ["-y", "@linear/mcp-server"],
"env": {
"LINEAR_API_KEY": "${LINEAR_API_KEY}"
}
}
}
}
Note: Never suggest GitHub MCP. Always use gh CLI commands for GitHub.
Output Format
Present your findings as:
- Summary Table - What was detected
- Recommended settings.json - Complete JSON ready to copy
- MCP Suggestions - If applicable
- Merge Instructions - If existing settings found
Example output structure:
## Detected Tech Stack
| Category | Found |
|----------|-------|
| Languages | Python 3.x |
| Package Manager | poetry |
| Frameworks | Django, Celery |
| Services | Sentry |
| Build Tools | Docker, Make |
## Recommended .claude/settings.json
\`\`\`json
{
"permissions": {
"allow": [
// ... grouped by category with comments
],
"deny": []
}
}
\`\`\`
## Recommended .mcp.json (if applicable)
If you use Sentry or Linear, add the MCP config to `.mcp.json`...
Important Rules
What to Include
- Only READ-ONLY commands that cannot modify state
- Only tools that are actually used by the project (detected via lock files)
- Standard system commands (ls, cat, find, etc.)
- The
:* suffix allows any arguments to the base command
What to NEVER Include
- Absolute paths - Never include user-specific paths like
/home/user/scripts/foo or /Users/name/bin/bar
- Custom scripts - Never include project scripts that may have side effects (e.g.,
./scripts/deploy.sh)
- Alternative package managers - If the project uses pnpm, do NOT include npm/yarn commands
- Commands that modify state - No install, build, run, write, or delete commands
Package Manager Rules
Only include the package manager actually used by the project:
| If Detected |
Include |
Do NOT Include |
pnpm-lock.yaml |
pnpm commands |
npm, yarn |
yarn.lock |
yarn commands |
npm, pnpm |
package-lock.json |
npm commands |
yarn, pnpm |
poetry.lock |
poetry commands |
pip (unless also has requirements.txt) |
uv.lock |
uv commands |
pip, poetry |
Pipfile.lock |
pipenv commands |
pip, poetry |
If multiple lock files exist, include only the commands for each detected manager.
1---2name: claude-settings-audit-33description: Analyze a repository to generate recommended Claude Code settings.json permissions. Use when setting up a new project, auditing existing settings, or determining which read-only bash commands to allow. Detects tech stack, build tools, and monorepo structure.4---56# Claude Settings Audit78Analyze this repository and generate recommended Claude Code `settings.json` permissions for read-only commands.910## Phase 1: Detect Tech Stack1112Run these commands to detect the repository structure:1314```bash15ls -la16find . -maxdepth 2 \( -name "*.toml" -o -name "*.json" -o -name "*.lock" -o -name "*.yaml" -o -name "*.yml" -o -name "Makefile" -o -name "Dockerfile" -o -name "*.tf" \) 2>/dev/null | head -5017```1819Check for these indicator files:2021| Category | Files to Check |22|----------|---------------|23| **Python** | `pyproject.toml`, `setup.py`, `requirements.txt`, `Pipfile`, `poetry.lock`, `uv.lock` |24| **Node.js** | `package.json`, `package-lock.json`, `yarn.lock`, `pnpm-lock.yaml` |25| **Go** | `go.mod`, `go.sum` |26| **Rust** | `Cargo.toml`, `Cargo.lock` |27| **Ruby** | `Gemfile`, `Gemfile.lock` |28| **Java** | `pom.xml`, `build.gradle`, `build.gradle.kts` |29| **Build** | `Makefile`, `Dockerfile`, `docker-compose.yml` |30| **Infra** | `*.tf` files, `kubernetes/`, `helm/` |31| **Monorepo** | `lerna.json`, `nx.json`, `turbo.json`, `pnpm-workspace.yaml` |3233## Phase 2: Detect Services3435Check for service integrations:3637| Service | Detection |38|---------|-----------|39| **Sentry** | `sentry-sdk` in deps, `@sentry/*` packages, `.sentryclirc`, `sentry.properties` |40| **Linear** | Linear config files, `.linear/` directory |4142Read dependency files to identify frameworks:43- `package.json` → check `dependencies` and `devDependencies`44- `pyproject.toml` → check `[project.dependencies]` or `[tool.poetry.dependencies]`45- `Gemfile` → check gem names46- `Cargo.toml` → check `[dependencies]`4748## Phase 3: Check Existing Settings4950```bash51cat .claude/settings.json 2>/dev/null || echo "No existing settings"52```5354## Phase 4: Generate Recommendations5556Build the allow list by combining:5758### Baseline Commands (Always Include)5960```json61[62 "Bash(ls:*)",63 "Bash(pwd:*)",64 "Bash(find:*)",65 "Bash(file:*)",66 "Bash(stat:*)",67 "Bash(wc:*)",68 "Bash(head:*)",69 "Bash(tail:*)",70 "Bash(cat:*)",71 "Bash(tree:*)",72 "Bash(git status:*)",73 "Bash(git log:*)",74 "Bash(git diff:*)",75 "Bash(git show:*)",76 "Bash(git branch:*)",77 "Bash(git remote:*)",78 "Bash(git tag:*)",79 "Bash(git stash list:*)",80 "Bash(git rev-parse:*)",81 "Bash(gh pr view:*)",82 "Bash(gh pr list:*)",83 "Bash(gh pr checks:*)",84 "Bash(gh pr diff:*)",85 "Bash(gh issue view:*)",86 "Bash(gh issue list:*)",87 "Bash(gh run view:*)",88 "Bash(gh run list:*)",89 "Bash(gh run logs:*)",90 "Bash(gh repo view:*)",91 "Bash(gh api:*)"92]93```9495### Stack-Specific Commands9697Only include commands for tools actually detected in the project.9899#### Python (if any Python files or config detected)100101| If Detected | Add These Commands |102|-------------|-------------------|103| Any Python | `python --version`, `python3 --version` |104| `poetry.lock` | `poetry show`, `poetry env info` |105| `uv.lock` | `uv pip list`, `uv tree` |106| `Pipfile.lock` | `pipenv graph` |107| `requirements.txt` (no other lock) | `pip list`, `pip show`, `pip freeze` |108109#### Node.js (if package.json detected)110111| If Detected | Add These Commands |112|-------------|-------------------|113| Any Node.js | `node --version` |114| `pnpm-lock.yaml` | `pnpm list`, `pnpm why` |115| `yarn.lock` | `yarn list`, `yarn info`, `yarn why` |116| `package-lock.json` | `npm list`, `npm view`, `npm outdated` |117| TypeScript (`tsconfig.json`) | `tsc --version` |118119#### Other Languages120121| If Detected | Add These Commands |122|-------------|-------------------|123| `go.mod` | `go version`, `go list`, `go mod graph`, `go env` |124| `Cargo.toml` | `rustc --version`, `cargo --version`, `cargo tree`, `cargo metadata` |125| `Gemfile` | `ruby --version`, `bundle list`, `bundle show` |126| `pom.xml` | `java --version`, `mvn --version`, `mvn dependency:tree` |127| `build.gradle` | `java --version`, `gradle --version`, `gradle dependencies` |128129#### Build Tools130131| If Detected | Add These Commands |132|-------------|-------------------|133| `Dockerfile` | `docker --version`, `docker ps`, `docker images` |134| `docker-compose.yml` | `docker-compose ps`, `docker-compose config` |135| `*.tf` files | `terraform --version`, `terraform providers`, `terraform state list` |136| `Makefile` | `make --version`, `make -n` |137138### Skills (for mpuig-skills plugin)139140If mpuig-skills plugin is installed, include:141142```json143[144 "Skill(mpuig-skills:commit)",145 "Skill(mpuig-skills:create-pr)",146 "Skill(mpuig-skills:code-review)",147 "Skill(mpuig-skills:find-bugs)",148 "Skill(mpuig-skills:iterate-pr)",149 "Skill(mpuig-skills:claude-settings-audit)",150 "Skill(mpuig-skills:agents-md)"151]152```153154### WebFetch Domains155156#### Always Include157```json158[159 "WebFetch(domain:docs.github.com)",160 "WebFetch(domain:cli.github.com)"161]162```163164#### Framework-Specific165166| If Detected | Add Domains |167|-------------|-------------|168| **Python** | `docs.python.org` |169| **Django** | `docs.djangoproject.com` |170| **Flask** | `flask.palletsprojects.com` |171| **FastAPI** | `fastapi.tiangolo.com` |172| **Pydantic** | `docs.pydantic.dev` |173| **pytest** | `docs.pytest.org` |174| **React** | `react.dev` |175| **Next.js** | `nextjs.org` |176| **Vue** | `vuejs.org` |177| **Express** | `expressjs.com` |178| **Rails** | `guides.rubyonrails.org`, `api.rubyonrails.org` |179| **Go** | `pkg.go.dev` |180| **Rust** | `docs.rs`, `doc.rust-lang.org` |181| **Docker** | `docs.docker.com` |182| **Kubernetes** | `kubernetes.io` |183| **Terraform** | `registry.terraform.io` |184185### MCP Server Suggestions186187MCP servers are configured in `.mcp.json` (not `settings.json`). Check for existing config:188189```bash190cat .mcp.json 2>/dev/null || echo "No existing .mcp.json"191```192193#### Sentry MCP (if Sentry SDK detected)194195Add to `.mcp.json` (replace `{org-slug}` and `{project-slug}` with your Sentry organization and project slugs):196```json197{198 "mcpServers": {199 "sentry": {200 "type": "http",201 "url": "https://mcp.sentry.dev/mcp/{org-slug}/{project-slug}"202 }203 }204}205```206207#### Linear MCP (if Linear usage detected)208209Add to `.mcp.json`:210```json211{212 "mcpServers": {213 "linear": {214 "command": "npx",215 "args": ["-y", "@linear/mcp-server"],216 "env": {217 "LINEAR_API_KEY": "${LINEAR_API_KEY}"218 }219 }220 }221}222```223224**Note**: Never suggest GitHub MCP. Always use `gh` CLI commands for GitHub.225226## Output Format227228Present your findings as:2292301. **Summary Table** - What was detected2312. **Recommended settings.json** - Complete JSON ready to copy2323. **MCP Suggestions** - If applicable2334. **Merge Instructions** - If existing settings found234235Example output structure:236237```markdown238## Detected Tech Stack239240| Category | Found |241|----------|-------|242| Languages | Python 3.x |243| Package Manager | poetry |244| Frameworks | Django, Celery |245| Services | Sentry |246| Build Tools | Docker, Make |247248## Recommended .claude/settings.json249250\`\`\`json251{252 "permissions": {253 "allow": [254 // ... grouped by category with comments255 ],256 "deny": []257 }258}259\`\`\`260261## Recommended .mcp.json (if applicable)262263If you use Sentry or Linear, add the MCP config to `.mcp.json`...264```265266## Important Rules267268### What to Include269- Only READ-ONLY commands that cannot modify state270- Only tools that are actually used by the project (detected via lock files)271- Standard system commands (ls, cat, find, etc.)272- The `:*` suffix allows any arguments to the base command273274### What to NEVER Include275- **Absolute paths** - Never include user-specific paths like `/home/user/scripts/foo` or `/Users/name/bin/bar`276- **Custom scripts** - Never include project scripts that may have side effects (e.g., `./scripts/deploy.sh`)277- **Alternative package managers** - If the project uses pnpm, do NOT include npm/yarn commands278- **Commands that modify state** - No install, build, run, write, or delete commands279280### Package Manager Rules281282Only include the package manager actually used by the project:283284| If Detected | Include | Do NOT Include |285|-------------|---------|----------------|286| `pnpm-lock.yaml` | pnpm commands | npm, yarn |287| `yarn.lock` | yarn commands | npm, pnpm |288| `package-lock.json` | npm commands | yarn, pnpm |289| `poetry.lock` | poetry commands | pip (unless also has requirements.txt) |290| `uv.lock` | uv commands | pip, poetry |291| `Pipfile.lock` | pipenv commands | pip, poetry |292293If multiple lock files exist, include only the commands for each detected manager.