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

[BUG] Write Tool Freezes Due to Content Filter False Positive

Open dwsmith1983 opened this issue 1 month ago • 3 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 freezes/hangs when attempting to write a CODE_OF_CONDUCT.md file for a GitHub repos. The API returns "Output blocked by content filtering policy" but Claude Code does not surface this error to the user, appearing to simply freeze.

What Should Happen?

We should be able to create GitHub code of conduct covenants easily with Claude.

Error Messages/Logs

The API returns a content filter block, but Claude Code doesn't handle it gracefully:

  2025-12-29T13:03:15.491Z [ERROR] Error streaming, falling back to non-streaming mode: {"type":"error","error":{"details":null,"type":"invalid_request_error","message":"Output blocked by content filtering policy"},"request_id":"req_011CWb2Lu2X5EMxhMkRNA81m"}

  2025-12-29T13:03:25.173Z [ERROR] Error in non-streaming fallback: 400 {"type":"error","error":{"type":"invalid_request_error","message":"Output blocked by content filtering policy"},"request_id":null}

  2025-12-29T13:03:25.174Z [ERROR] Error: Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"Output blocked by content filtering policy"},"request_id":null}

Steps to Reproduce

  1. Open Claude Code in a git repository
  2. Ask Claude to create a GitHub Code of Conduct file (CODE_OF_CONDUCT.md)
  3. Claude begins processing but then freezes indefinitely
  4. No error message is displayed to the user

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

v2.0.76

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

  1. Content Filter False Positive: Standard CODE_OF_CONDUCT.md content (based on Contributor Covenant) is being incorrectly flagged by the content filtering policy. This is legitimate open-source community documentation.
  2. Poor Error Handling: When the API returns this error, Claude Code does not display any message to the user. It simply freezes, making debugging impossible without manually inspecting ~/.claude/debug/ logs.

dwsmith1983 avatar Dec 29 '25 13:12 dwsmith1983

Found 2 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/4379
  2. https://github.com/anthropics/claude-code/issues/6948

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 Dec 29 '25 13:12 github-actions[bot]

Keep open until you address one of these issues

dwsmith1983 avatar Dec 30 '25 00:12 dwsmith1983

same problem?

❯ write CODE_OF_CONDUCT.md
  ⎿ API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"Output blocked by
    content filtering policy"},"request_id":"req_011CX1b1V9z451LhCAFMZ2fh"}

gianlucamazza avatar Jan 11 '26 12:01 gianlucamazza