[BUG] Claude refuses to write code to convert two-character country names to the country's full name

Resolved 💬 3 comments Opened May 3, 2026 by DominoTree Closed Jun 2, 2026

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?

I have tried several methods but always end up with this happening in just about any context. This seems to (usually) specifically trigger when it gets to countries whose names begin with the letter I but I have seen it get farther at least once.

What Should Happen?

Claude should write code or use libraries to convert country codes to full names.

Error Messages/Logs

❯ Write code in Go to change a country's two-character code to its full name.

∴ Thinking…

   I'm creating a Go function that maps ISO 3166-1 alpha-2 country codes to their full country names, using a
  straightforward lookup approach.
  ⎿  API Error: {"type":"error","error":{"details":null,"type":"invalid_request_error","message":"Output
     blocked by content filtering policy"},"request_id":"req_011CagHSkRQtQdR78HCEJjew"}

✻ Churned for 12s

❯ Write code in Go to change a country's two-character code to its full name.

∴ Thinking…

   I'm considering whether to use the biter777/countries library or just implement a simple map for converting
  ISO 3166-1 alpha-2 codes to country names—the map approach seems more straightforward for this use case.
  ⎿  API Error: {"type":"error","error":{"details":null,"type":"invalid_request_error","message":"Output
     blocked by content filtering policy"},"request_id":"req_011CagHUQuiFKugjeMefuwmP"}

✻ Brewed for 11s

❯ Write code in Go to change a country's two-character code to its full name.

∴ Thinking…

   I'll create a Go program with a hardcoded map of ISO 3166-1 alpha-2 country codes mapped to their full
  names, then write a simple function to look up countries by their code.
  ⎿  API Error: {"type":"error","error":{"details":null,"type":"invalid_request_error","message":"Output
     blocked by content filtering policy"},"request_id":"req_011CagHXgNih5dD99SJUDy2x"}

✻ Crunched for 12s

Steps to Reproduce

Start a session and submit this instruction:
Write code in Go to change a country's two-character code to its full name.

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.126

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

_No response_

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗