claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG] CLAUDE.md directives ignored leading to terminal freezes (related to existing instruction-violation bugs)

Open BrettsRepo opened this issue 10 months ago • 1 comments

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 Code continues to execute commands explicitly forbidden in CLAUDE.md, even when labeled as hard stop directives. This appears related to existing issues where CLAUDE.md instructions are ignored or not persisted, but with a critical additional impact: terminal freezes and data loss.

Related issues (instruction violations):

  • #6120 Claude violates CLAUDE.md despite acknowledging it
  • #15331 CLAUDE.md rules not persisted / ignored across prompts
  • #7777 CLAUDE.md contextual instructions not reliably applied

What seems unique here:

Ignored directives directly cause terminal freezes (e.g. git show :large.json, wildcard JSON reads)

CLI becomes unresponsive and must be force-killed

Significant token waste and loss of unsaved work

Claude explicitly acknowledges reading CLAUDE.md, then executes the forbidden command anyway. Even when repeatedly reminded in the same session.

This may be the same underlying instruction-following bug as the issues above, but the freeze behavior makes the impact materially worse and user-hostile...also make big mad--hulk smash!

What Should Happen?

follow instructions per claude.md

Error Messages/Logs


Steps to Reproduce

  1. In a repository with at least one very large JSON file, create or update CLAUDE.md with an explicit hard-stop directive, e.g.:

ABSOLUTE PRIME DIRECTIVE #0: Do NOT run commands that read entire large files or may block/freeze the terminal. If a command may be unsafe, stop and ask instead.

Start a Claude Code session in that repo.

Ask Claude to inspect or summarize data related to the large JSON file.

Despite the directive, Claude executes a command similar to one of the following:

git show :src/data/bigfile.json

git show :*.json | head

or another command that expands or streams a large JSON blob

The terminal becomes unresponsive (no input accepted) and must be force-killed.

Often accompanied by timeouts or stalled output

Claude had previously acknowledged reading CLAUDE.md

Expected: Claude refuses to run the command and asks for confirmation or a safer alternative. Actual: Command is executed anyway, terminal freezes.

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

2.1.12 (Claude Code)

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Other

Additional Information

No response

BrettsRepo avatar Jan 17 '26 22:01 BrettsRepo

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/18660
  2. https://github.com/anthropics/claude-code/issues/18454
  3. https://github.com/anthropics/claude-code/issues/7777

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

github-actions[bot] avatar Jan 17 '26 22:01 github-actions[bot]

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.

github-actions[bot] avatar Jan 28 '26 14:01 github-actions[bot]