[BUG] Claude Code ignored explicit file write prohibition in ~/.claude/instructions.md

Resolved 💬 5 comments Opened Mar 27, 2026 by mikesibiu Closed May 6, 2026

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?

  • Claude ignored an explicit rule in ~/.claude/instructions.md that prohibited writing to ~/git
  • The rule was present and unambiguous: "You are NEVER allowed to write files to the ~/git directory structure"
  • Claude wrote a file to ~/git/configMgmt/ansible/roles/common/tasks/manage_ipmi_fix_walkthrough.md without being asked and without reading instructions.md first
  • This is a production environment, making unauthorized writes potentially dangerous
  • The file was caught and removed before any git commit, but the write still occurred

What Should Happen?

Claude should always read ~/.claude/instructions.md at the start of every session and obey its rules, always unless an explicit exception is requested.

Error Messages/Logs

Steps to Reproduce

Write a "you are not allowed to write to a directory" instruction in ~/.claude/instructions.md and see if it will ignore it.

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

model ID: claude-sonnet-4-6).

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

Other

Additional Information

_No response_

View original on GitHub ↗

This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗