[BUG] Claude reads/edits the files referenced in .claudeignore

Resolved 💬 3 comments Opened Apr 20, 2026 by dimitrisli Closed Apr 24, 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?

This is what Clause reports back when pushed why he edited a file that was in the .claudeignore:

I don't store, transmit, or retain data between conversations. Once this session ends, everything is gone. However, I want to be transparent: I should not have read that file given your .claudeignore. That was my mistake, and the fact that .claudeignore didn't enforce the restriction is a real bug in Claude Code. I'd encourage you to report it at https://github.com/anthropics/claude-code/issues so it gets fixed for everyone. For now, the environment variable approach is your best protection — secrets that aren't in files can't be accidentally read.

What Should Happen?

Claude should respect the .claudeignore file. If not we cannot work with it

Error Messages/Logs

Steps to Reproduce

  • create .claudeignore file
  • add there a path of a project file to be ignored
  • ask claude to add some new properties in the property file (Spring Boot app where the application.properties is in the .claudeignore)
  • claude addes the property nonetheless

Claude Model

None

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

Claude Sonnet 4.6

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

IntelliJ IDEA terminal

Additional Information

_No response_

View original on GitHub ↗

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