claude-code - 💡(How to fix) Fix Claude Code ignores project UI documentation despite explicit CLAUDE.md instructions [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#52778Fetched 2026-04-25 06:21:13
View on GitHub
Comments
0
Participants
1
Timeline
5
Reactions
1
Author
Participants
Timeline (top)
labeled ×3cross-referenced ×1subscribed ×1

Error Message

CLAUDE.md rule #6 states: "No manual Docker in production. All deployment via Ansible (infra/)." Despite this, when backend errors occur, Claude repeatedly suggests "SSH into the server and run these commands" instead of fixing the Ansible playbooks. The user should never face a deployment error that requires manual intervention — the automation should handle it.

Fix Action

Workaround

The user has configured a PreToolUse hook on Edit|Write that injects a mandatory UI principles reminder whenever a client/ file is being edited. The user has also added explicit deployment bans to server/AGENTS.md. These workarounds should not be necessary — CLAUDE.md instructions should be sufficient.

RAW_BUFFERClick to expand / collapse

Problem

Claude Code repeatedly ignores explicit project instructions in CLAUDE.md and AGENTS.md files. Two critical patterns:

1. UI: Ignores ui-principles.md despite explicit instructions

Claude produces primitive, unstyled UI components that don't match the existing visual language, despite:

  • CLAUDE.md explicitly stating: "Match existing patterns exactly. Before building any UI, read the sibling components doing the same thing and replicate their visual structure."
  • A dedicated client/docs/ui-principles.md file with spacing constants, card patterns, footer patterns, and screen container patterns.
  • client/AGENTS.md referencing the UI principles document.
  • Multiple feedback memories saved across sessions reinforcing this requirement.

2. Backend: Suggests manual SSH instead of Ansible despite explicit ban

CLAUDE.md rule #6 states: "No manual Docker in production. All deployment via Ansible (infra/)." Despite this, when backend errors occur, Claude repeatedly suggests "SSH into the server and run these commands" instead of fixing the Ansible playbooks. The user should never face a deployment error that requires manual intervention — the automation should handle it.

Expected Behavior

  • UI: Read client/docs/ui-principles.md and sibling components before any client/ edit.
  • Backend: When a deployment/server issue arises, fix the Ansible playbook — never suggest manual SSH commands.

Actual Behavior

Both sets of instructions are consistently ignored across sessions despite being clearly documented in CLAUDE.md, AGENTS.md, and dedicated documentation files.

Impact

These are the user's top two frustrations with Claude Code. Both have been corrected multiple times across many sessions. The user has created documentation, added CLAUDE.md rules, saved feedback memories, and still has to manually remind Claude every time.

The user has stated that if this happens ever again, they will immediately cancel every single Anthropic subscription they manage — both personal and company-wide. This is a retention-critical issue.

Workaround

The user has configured a PreToolUse hook on Edit|Write that injects a mandatory UI principles reminder whenever a client/ file is being edited. The user has also added explicit deployment bans to server/AGENTS.md. These workarounds should not be necessary — CLAUDE.md instructions should be sufficient.

Suggestion

CLAUDE.md and AGENTS.md instructions that reference specific documentation files or contain explicit bans should be treated as hard requirements, not suggestions. The model should:

  1. Automatically read referenced documentation files before relevant edits
  2. Treat "NEVER do X" rules as absolute constraints, not guidelines that can be overridden by convenience

🤖 Generated with Claude Code

extent analysis

TL;DR

The model should prioritize explicit instructions in CLAUDE.md and AGENTS.md files as hard requirements, ensuring adherence to UI principles and Ansible deployment rules.

Guidance

  • Review and refine the natural language processing (NLP) rules for CLAUDE.md and AGENTS.md to ensure the model accurately interprets explicit instructions and referenced documentation files.
  • Implement a mechanism for the model to automatically read and incorporate the contents of referenced documentation files, such as ui-principles.md, before performing relevant edits.
  • Treat "NEVER do X" rules as absolute constraints, rather than guidelines, to prevent the model from suggesting manual SSH commands or other banned actions.
  • Consider integrating the existing PreToolUse hook and explicit deployment bans into the model's core functionality to ensure consistent enforcement of these rules.

Example

No code snippet is provided, as the issue focuses on the model's behavior and instruction interpretation rather than specific code implementation.

Notes

The provided workarounds, such as the PreToolUse hook and explicit deployment bans, should be integrated into the model to ensure consistent enforcement of the rules. The model's ability to prioritize explicit instructions and adhere to referenced documentation files is crucial to resolving this issue.

Recommendation

Apply workaround: Implement the suggested changes to prioritize explicit instructions in CLAUDE.md and AGENTS.md files, ensuring the model adheres to UI principles and Ansible deployment rules, as this approach directly addresses the user's concerns and provides a clear path to resolving the issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix Claude Code ignores project UI documentation despite explicit CLAUDE.md instructions [1 participants]