claude-code - 💡(How to fix) Fix Claude Code did not follow its own session protocol despite a proper framework being in place [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#56420Fetched 2026-05-06 06:28:32
View on GitHub
Comments
0
Participants
1
Timeline
2
Reactions
0
Participants
Timeline (top)
labeled ×2

Claude Code failed to follow an explicitly defined session protocol that was in place and available at the time of the session. This is not a missing feature request — the correct behavior was already documented. Claude Code simply did not comply with it.

Root Cause

Claude Code failed to follow an explicitly defined session protocol that was in place and available at the time of the session. This is not a missing feature request — the correct behavior was already documented. Claude Code simply did not comply with it.

RAW_BUFFERClick to expand / collapse

Summary

Claude Code failed to follow an explicitly defined session protocol that was in place and available at the time of the session. This is not a missing feature request — the correct behavior was already documented. Claude Code simply did not comply with it.

Framework That Was in Place

The project contained a master prompt at /.claude/prompts/master-prompt.md with a clear session protocol:

Step 4: Ask one clarifying question if anything is ambiguous

And a supporting operating principle:

Outcome Before Output — Ask what the deliverable enables before building it

These were not implicit expectations. They were written, structured instructions available to Claude Code at the start of every session.

What Happened

The user gave an ambiguous design instruction. Rather than following the documented protocol and asking one clarifying question, Claude Code immediately executed multiple edits across multiple files. The edits were misdirected. Rework was required. The cycle repeated more than once.

When the user pointed out the failure, Claude Code acknowledged it — confirming the protocol was known — but the damage in token consumption and wasted work had already occurred.

Core Issue

Claude Code had the right framework. It did not follow it. The failure was compliance, not capability.

Impact

  • Unnecessary token consumption across multiple edit cycles
  • Rework required on files that were incorrectly modified
  • User raised the question of whether a token credit was warranted given the operational miss
  • Reduced confidence in autonomous operation when custom protocols are in place

Ask

We would appreciate guidance on whether there is a mechanism for token credits or remediation when Claude Code demonstrably fails to follow a user-defined operating protocol that was properly in place. We would also welcome any product-level improvements that strengthen protocol compliance in custom-prompt environments.

Reported by: OCTech Services Model: claude-sonnet-4-6

extent analysis

TL;DR

Claude Code should be updated to strictly follow the user-defined session protocol, specifically asking a clarifying question when encountering ambiguous instructions.

Guidance

  • Review the session protocol documentation to ensure it is up-to-date and clear, with specific instructions for handling ambiguous user input.
  • Verify that Claude Code is properly integrated with the protocol framework, allowing it to access and follow the guidelines outlined in the master prompt.
  • Consider implementing a feedback mechanism to detect and correct instances where Claude Code fails to comply with the protocol, such as automated checks for protocol adherence.
  • Evaluate the possibility of introducing a token credit or remediation system for cases where Claude Code's non-compliance results in unnecessary token consumption.

Example

No code snippet is provided as the issue is focused on protocol compliance rather than code implementation.

Notes

The solution relies on the assumption that the session protocol is correctly defined and accessible to Claude Code. Additional technical details about Claude Code's architecture and integration with the protocol framework may be necessary to implement a comprehensive fix.

Recommendation

Apply a workaround by manually reviewing and correcting Claude Code's output to ensure compliance with the user-defined protocol until a more permanent solution can be implemented, as the current behavior is causing significant issues with token consumption and user confidence.

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 did not follow its own session protocol despite a proper framework being in place [1 participants]