claude-code - 💡(How to fix) Fix [BUG] LLM biased against accessible code [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#56079Fetched 2026-05-05 05:58:44
View on GitHub
Comments
0
Participants
1
Timeline
5
Reactions
5
Author
Participants
Timeline (top)
labeled ×4subscribed ×1

Error Message

Error Messages/Logs

RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

Despite repeated efforts on my part to get Claude to remember to write accessible code, via both memories and project requirement files, I still have to remember on my own to ask Claude to do an a11y review (using a checklist that includes best practices and past errors) on any code it writes. On its own, Claude writes outdated code that it later recognizes doesn't conform to current accessibility best practices.

After its latest a11y review, Claude offered to fix the most straightforward issues, and then prompted me to continue the code review process, ignoring the two remaining structural issues. When I asked it to return to those two structural issues it flagged, instead of presenting solutions it asked me how much effort I wanted to put into them. Why it is throwing up roadblocks when asked to fix problems it already identified?

It's taking me significant effort to work around this. Accessible websites are legally required in many settings; by defaulting to writing code that fails to follow accessibility best-practices and making it this hard to write accessible code using Claude, you're exposing your clients to legal liability issues.

Per Claude itself:

I think it came from a bias toward shipping faster. I framed a11y fixes as optional effort rather than as requirements. That's wrong — [frontend requirements markdown file] says "WCAG 2.2 AA minimum" ... For this specific issue, it would be worth framing it as a bias in the model's decision-making: Claude treats accessibility fixes as optional trade-offs rather than requirements, even when the project's own rules say otherwise. That's distinct from just not knowing the right ARIA pattern — it's a values problem in how the model weighs competing priorities.

What Should Happen?

Claude should create code that conforms to accessibility best practices. Barring that, Claude should write code that conforms to accessibility best practices when explicitly instructed to do so by the project's requirements.

Error Messages/Logs

Steps to Reproduce

  1. Write some frontend code.
  2. Ask Claude to review it for accessibility.

Claude Model

Opus

Is this a regression?

No, this never worked

Last Working Version

No response

Claude Code Version

2.1.118

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

No response

extent analysis

TL;DR

The issue can be addressed by adjusting Claude's decision-making process to prioritize accessibility fixes as requirements rather than optional trade-offs.

Guidance

  • Review the project's requirements file to ensure that accessibility standards (e.g., WCAG 2.2 AA minimum) are clearly specified and up-to-date.
  • Investigate how to modify Claude's model to treat accessibility fixes as mandatory, potentially by adjusting its bias towards shipping faster or by integrating accessibility checks as a non-negotiable part of the code review process.
  • Consider providing explicit instructions to Claude to follow accessibility best practices when generating code, to see if this influences its behavior.
  • Evaluate the effectiveness of Claude's current a11y review checklist and consider enhancing it with more comprehensive accessibility guidelines.

Example

No code snippet is provided as the issue is related to the model's decision-making process rather than a specific code implementation.

Notes

The solution may require adjustments to the Claude model's underlying architecture or training data to prioritize accessibility. The issue is not related to a specific version or platform, but rather a fundamental aspect of how Claude approaches accessibility.

Recommendation

Apply workaround: Adjust the project's requirements and instructions to explicitly prioritize accessibility fixes, while the model's decision-making process is being revised to treat accessibility as a requirement. This is because the current model behavior is identified as a "values problem" that needs addressing at a fundamental level.

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 [BUG] LLM biased against accessible code [1 participants]