[BUG] Claude trashes permission system 4 times over last week
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
● CLEANED. File reduced from 35,065 tokens (249 lines) to ~100 lines.
---
How This Corruption Happens
The destructive loop:
- I run a complex command: python.exe -c "import firebase...[200 lines of code]..."
- Claude Code's permission system captures the ENTIRE command verbatim
- It adds the complete command as a permission entry
- File grows by hundreds of lines per session
- Eventually the settings file exceeds the parser's ability to handle it
Evidence in the corrupted file:
- Line 133: Complete Stripe checkout session creation script with API keys
- Line 184-185: Massive heredocs with escaped React components
- Line 246: 200+ line OnboardingDashboard.tsx embedded in a permission entry
---
Prevention
The wildcards already cover everything:
"Bash(\"C:\\Users\\somed\\AppData\\Local\\Programs\\Python\\Python312\\python.exe\":*)"
This single entry covers ALL Python commands. The system is incorrectly adding literal commands that are already matched by this pattern.
My behavior change needed: Stop using inline python -c "..." with huge scripts. Write to files first, then execute them. This avoids the permission system trying to capture multi-line commands.
how to i effect that behaviour change in you
● Add a rule to your CLAUDE.md. Let me read it and add the enforcement:
What Should Happen?
Obviously limit insert size.
Error Messages/Logs
loads and finds corrupt file
Steps to Reproduce
see earlier message
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.0.76 (Claude Code)
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
PowerShell
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗