claude-code
claude-code copied to clipboard
[BUG] Write Tool Freezes Due to Content Filter False Positive
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
- Open Claude Code in a git repository
- Ask Claude to create a GitHub Code of Conduct file (CODE_OF_CONDUCT.md)
- Claude begins processing but then freezes indefinitely
- 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
- 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.
- 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.
Found 2 possible duplicate issues:
- https://github.com/anthropics/claude-code/issues/4379
- 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
Keep open until you address one of these issues
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"}