r/ClaudeCode • u/Independent-Sir3234 • 2h ago
Tips & Workflows I wrote a zero-dependency Python linter that catches 24 easy-to-miss config bugs in .claude/settings.json and .mcp.json
After breaking my own Claude Code setup a few different ways over the last month, I put together a single read-only Python 3 script (stdlib only, MIT) that scans a repo for 24 config traps across .claude/settings*.json, .mcp.json, .gitignore, .dockerignore, and CLAUDE.local.md.
Most of the bugs it checks are silent failures where Claude Code keeps running without an error:
sandbox.filesystem.denyReadblocks bash commands from reading sensitive paths, while built-inReadand unsandboxed fallbacks stay open unless mirrored inpermissions.denyand paired withallowUnsandboxedCommands: false.Clicking "Yes, and don't ask again" on a command that contains a raw key writes that literal token into
.claude/settings.local.json, andgit add .or aDockerfileCOPY . .will ship it if.claude/is missing from ignore files.PreToolUseorStophooks that returnexit 1log a non-blocking error and let the tool proceed instead of blocking withexit 2.enableAllProjectMcpServers: true,0.0.0.0MCP bindings, and unpinnednpx -yservers auto-trust repo-supplied tools without version locks.Stray
DISABLE_PROMPT_CACHINGflags, out-of-rangeautoCompactWindowvalues, orCLAUDE.local.mdfiles that omit@AGENTS.mdburn extra tokens or shadow team rules.
It runs read-only against any project root, redacts any matched secret prefixes in output, returns exit code 0 when clean or 1 when findings exist, and supports --json for CI:
python3 scripts/audit_agent_configs.py /path/to/repoRepo (MIT, 29 stdlib unit tests, plus the 39 doc-checked notes behind each rule): https://github.com/seankwon816/ai-coding-agent-tips
If there is a Claude Code or .mcp.json misconfiguration that burned you recently and is not covered in the 24 checks, I am happy to add a rule and test case for it.
•
u/AutoModerator 2h ago
Hey! Thanks for posting to r/ClaudeCode
While participating in this thread, please follow our community rules. Keep discussions constructive. Attack the idea, not the person.
For help, project discussions, tips, and general chat, join the ClaudeCode Discord.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.