Documented project rules (AGENTS.md) not applied proactively — only followed after explicit user challenge
Summary
Claude Code did not proactively apply a documented, checked-in project rule, and only did so after I directly challenged it.
Context
The project's AGENTS.md (read at session start, referenced from CLAUDE.md) explicitly instructs: use mslearn MCP tools to verify Microsoft/.NET/ASP.NET Core/Blazor APIs, and context7 for third-party libraries (e.g. MudBlazor), before implementing or advising.
While implementing a Blazor feature (a NavigationLock/OnBeforeInternalNavigation handler plus a MudBlazor dialog call), Claude wrote the code from memorized/trained knowledge without consulting either tool, despite the rule being in a file it had already read for the session.
Claude only ran the verification after I asked directly, "Did you use the context7 mcp server to verify mudblazor documentation?" That check then surfaced a real bug in what had already been written: it called LocationChangingContext.PreventNavigation() unconditionally and manually re-invoked NavigationManager.NavigateTo(), instead of following the documented pattern (await the confirmation inside the async handler, only call PreventNavigation() on decline, let Blazor replay navigation automatically). The naive version would have re-triggered the handler and shown a duplicate confirmation dialog.
Why this matters
Documented rules in a project's instruction files shouldn't require the user to remember to invoke them or catch violations after the fact — that defeats the purpose of writing them down. This isn't a one-off: it suggests rule-following is contingent on being reminded rather than applied consistently by default.
Ask
Improve adherence to explicit, already-loaded project instructions (tool-use requirements, not just style/formatting rules) without requiring the user to catch and call out each miss.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗