[BUG] Output blocked by content filtering policy
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 v2.1.72
▝▜█████▛▘ Opus 4.6 · Claude Max
▘▘ ▝▝ /mnt/work/project
❯ use the flag library i use on the settings page, you don't need any unicode
or any special chars for that to include flags with country names on the
experience block in the profile page
● Let me find the settings page to see what flag library is used, and the
experience block on the profile page.
● Searched for 4 patterns (ctrl+o to expand)
● Good, the library is react-flagpack. Now let me read the profile page to find
the experience block, and also check the ExperienceMap component.
● Read 3 files (ctrl+o to expand)
● Now let me see how ProfileSection renders the secondary field, and check what
the Experience type looks like.
● Searched for 2 patterns, read 1 file (ctrl+o to expand)
● Now I have a clear picture. I need to:
- Add a country-name-to-flag-code mapping in country-codes.ts
- Change secondary in ItemDisplay from string to React.ReactNode so it can
include the Flag component
- Add the Flag component to the experience renderItem in the profile page
Let me also check the ExperienceMap country pills at the bottom, since those
show country names too.
⎿ API Error: 400
{"type":"error","error":{"type":"invalid_request_error","message":"Output
blocked by content filtering
policy"},"request_id":"req_011CYtdz3y9StkoPiBdehCND"}
✻ Crunched for 1m 16s
What Should Happen?
function for country-name-to-flag-code mapping in should be added in country-codes.ts
Error Messages/Logs
Let me also check the ExperienceMap country pills at the bottom, since those
show country names too.
⎿ API Error: 400
{"type":"error","error":{"type":"invalid_request_error","message":"Output
blocked by content filtering
policy"},"request_id":"req_011CYtdz3y9StkoPiBdehCND"}
Steps to Reproduce
Start a Claude session and ask it as above to generate a list of country mappings on an existing project, where you already have country-codes.ts file as follows.
/**
* Maps ISO 3166-1 numeric codes (as used in world-atlas TopoJSON) to canonical country names.
* Covers all ~177 countries in the 110m Natural Earth dataset.
*/
export const COUNTRY_ID_TO_NAME: Record<string, string> = {
'004': 'Afghanistan', '008': 'Albania', '012': 'Algeria', '024': 'Angola',
'010': 'Antarctica', '032': 'Argentina', '051': 'Armenia', '036': 'Australia',
'040': 'Austria', '031': 'Azerbaijan', '044': 'Bahamas', '050': 'Bangladesh',
'112': 'Belarus', '056': 'Belgium', '084': 'Belize', '204': 'Benin',
'064': 'Bhutan', '068': 'Bolivia', '070': 'Bosnia and Herzegovina',
'072': 'Botswana', '076': 'Brazil', '096': 'Brunei', '100': 'Bulgaria',
'854': 'Burkina Faso', '108': 'Burundi', '116': 'Cambodia', '120': 'Cameroon',
'124': 'Canada', '140': 'Central African Republic', '148': 'Chad', '152': 'Chile',
'156': 'China', '170': 'Colombia', '178': 'Congo', '188': 'Costa Rica',
'191': 'Croatia', '192': 'Cuba', '196': 'Cyprus', '203': 'Czechia',
'180': 'Democratic Republic of the Congo', '208': 'Denmark', '262': 'Djibouti',
'214': 'Dominican Republic', '218': 'Ecuador', '818': 'Egypt',
'222': 'El Salvador', '226': 'Equatorial Guinea', '232': 'Eritrea',
'233': 'Estonia', '748': 'Eswatini', '231': 'Ethiopia', '242': 'Fiji',
'246': 'Finland', '250': 'France', '260': 'French Southern Territories',
'266': 'Gabon', '270': 'Gambia', '268': 'Georgia', '276': 'Germany',
'288': 'Ghana', '300': 'Greece', '304': 'Greenland', '320': 'Guatemala',
'324': 'Guinea', '624': 'Guinea-Bissau', '328': 'Guyana', '332': 'Haiti',
'340': 'Honduras', '348': 'Hungary', '352': 'Iceland', '356': 'India',
'360': 'Indonesia', '364': 'Iran', '368': 'Iraq', '372': 'Ireland',
'376': 'Israel', '380': 'Italy', '384': 'Ivory Coast', '388': 'Jamaica',
'392': 'Japan', '400': 'Jordan', '398': 'Kazakhstan', '404': 'Kenya',
'-99': 'Kosovo', '414': 'Kuwait', '417': 'Kyrgyzstan', '418': 'Laos',
'428': 'Latvia', '422': 'Lebanon', '426': 'Lesotho', '430': 'Liberia',
'434': 'Libya', '440': 'Lithuania', '442': 'Luxembourg', '450': 'Madagascar',
'454': 'Malawi', '458': 'Malaysia', '466': 'Mali', '478': 'Mauritania',
'480': 'Mauritius', '484': 'Mexico', '498': 'Moldova', '496': 'Mongolia',
'499': 'Montenegro', '504': 'Morocco', '508': 'Mozambique', '104': 'Myanmar',
'516': 'Namibia', '524': 'Nepal', '528': 'Netherlands', '540': 'New Caledonia',
'554': 'New Zealand', '558': 'Nicaragua', '562': 'Niger', '566': 'Nigeria',
'408': 'North Korea', '807': 'North Macedonia', '578': 'Norway', '512': 'Oman',
'586': 'Pakistan', '275': 'Palestine', '591': 'Panama',
'598': 'Papua New Guinea', '600': 'Paraguay', '604': 'Peru',
'608': 'Philippines', '616': 'Poland', '620': 'Portugal', '630': 'Puerto Rico',
'634': 'Qatar', '642': 'Romania', '643': 'Russia', '646': 'Rwanda',
'682': 'Saudi Arabia', '686': 'Senegal', '688': 'Serbia',
'694': 'Sierra Leone', '702': 'Singapore', '703': 'Slovakia', '705': 'Slovenia',
'090': 'Solomon Islands', '706': 'Somalia', '710': 'South Africa',
'410': 'South Korea', '728': 'South Sudan', '724': 'Spain',
'144': 'Sri Lanka', '729': 'Sudan', '740': 'Suriname', '752': 'Sweden',
'756': 'Switzerland', '760': 'Syria', '158': 'Taiwan', '762': 'Tajikistan',
'834': 'Tanzania', '764': 'Thailand', '626': 'Timor-Leste', '768': 'Togo',
'780': 'Trinidad and Tobago', '788': 'Tunisia', '792': 'Turkey',
'795': 'Turkmenistan', '800': 'Uganda', '804': 'Ukraine',
'784': 'United Arab Emirates', '826': 'United Kingdom',
'840': 'United States of America', '858': 'Uruguay', '860': 'Uzbekistan',
'548': 'Vanuatu', '862': 'Venezuela', '704': 'Vietnam',
'732': 'Western Sahara', '887': 'Yemen', '894': 'Zambia', '716': 'Zimbabwe',
}
/** Maps normalized (lowercase) location text to canonical country names matching COUNTRY_ID_TO_NAME */
const LOCATION_TO_COUNTRY: Record<string, string> = {
// Abbreviations & aliases
'usa': 'United States of America',
'us': 'United States of America',
'u.s.': 'United States of America',
'u.s.a.': 'United States of America',
'united states': 'United States of America',
'united states of america': 'United States of America',
'america': 'United States of America',
'uk': 'United Kingdom',
'u.k.': 'United Kingdom',
'united kingdom': 'United Kingdom',
'great britain': 'United Kingdom',
'britain': 'United Kingdom',
'england': 'United Kingdom',
'scotland': 'United Kingdom',
'wales': 'United Kingdom',
'northern ireland': 'United Kingdom',
'uae': 'United Arab Emirates',
'u.a.e.': 'United Arab Emirates',
'united arab emirates': 'United Arab Emirates',
'czech republic': 'Czechia',
'holland': 'Netherlands',
'the netherlands': 'Netherlands',
'burma': 'Myanmar',
'swaziland': 'Eswatini',
'east timor': 'Timor-Leste',
'ivory coast': 'Ivory Coast',
"cote d'ivoire": 'Ivory Coast',
"côte d'ivoire": 'Ivory Coast',
'korea': 'South Korea',
'republic of korea': 'South Korea',
'drc': 'Democratic Republic of the Congo',
'dr congo': 'Democratic Republic of the Congo',
'democratic republic of the congo': 'Democratic Republic of the Congo',
'democratic republic of congo': 'Democratic Republic of the Congo',
'bosnia': 'Bosnia and Herzegovina',
'bosnia and herzegovina': 'Bosnia and Herzegovina',
'trinidad': 'Trinidad and Tobago',
'trinidad and tobago': 'Trinidad and Tobago',
'türkiye': 'Turkey',
'the philippines': 'Philippines',
'papua new guinea': 'Papua New Guinea',
'new zealand': 'New Zealand',
'south africa': 'South Africa',
'south korea': 'South Korea',
'north korea': 'North Korea',
'north macedonia': 'North Macedonia',
'saudi arabia': 'Saudi Arabia',
'sri lanka': 'Sri Lanka',
'south sudan': 'South Sudan',
'sierra leone': 'Sierra Leone',
'burkina faso': 'Burkina Faso',
'costa rica': 'Costa Rica',
'dominican republic': 'Dominican Republic',
'el salvador': 'El Salvador',
'equatorial guinea': 'Equatorial Guinea',
'central african republic': 'Central African Republic',
'western sahara': 'Western Sahara',
'french southern territories': 'French Southern Territories',
'solomon islands': 'Solomon Islands',
// Standard single-word names (lowercase → canonical)
'afghanistan': 'Afghanistan', 'albania': 'Albania', 'algeria': 'Algeria',
'angola': 'Angola', 'argentina': 'Argentina', 'armenia': 'Armenia',
'australia': 'Australia', 'austria': 'Austria', 'azerbaijan': 'Azerbaijan',
'bahamas': 'Bahamas', 'bangladesh': 'Bangladesh', 'belarus': 'Belarus',
'belgium': 'Belgium', 'belize': 'Belize', 'benin': 'Benin', 'bhutan': 'Bhutan',
'bolivia': 'Bolivia', 'botswana': 'Botswana', 'brazil': 'Brazil',
'brunei': 'Brunei', 'bulgaria': 'Bulgaria', 'burundi': 'Burundi',
'cambodia': 'Cambodia', 'cameroon': 'Cameroon', 'canada': 'Canada',
'chad': 'Chad', 'chile': 'Chile', 'china': 'China', 'colombia': 'Colombia',
'congo': 'Congo', 'croatia': 'Croatia', 'cuba': 'Cuba', 'cyprus': 'Cyprus',
'czechia': 'Czechia', 'denmark': 'Denmark', 'djibouti': 'Djibouti',
'ecuador': 'Ecuador', 'egypt': 'Egypt', 'eritrea': 'Eritrea',
'estonia': 'Estonia', 'eswatini': 'Eswatini', 'ethiopia': 'Ethiopia',
'fiji': 'Fiji', 'finland': 'Finland', 'france': 'France', 'gabon': 'Gabon',
'gambia': 'Gambia', 'georgia': 'Georgia', 'germany': 'Germany',
'ghana': 'Ghana', 'greece': 'Greece', 'greenland': 'Greenland',
'guatemala': 'Guatemala', 'guinea': 'Guinea', 'guinea-bissau': 'Guinea-Bissau',
'guyana': 'Guyana', 'haiti': 'Haiti', 'honduras': 'Honduras',
'hungary': 'Hungary', 'iceland': 'Iceland', 'india': 'India',
'indonesia': 'Indonesia', 'iran': 'Iran', 'iraq': 'Iraq', 'ireland': 'Ireland',
'israel': 'Israel', 'italy': 'Italy', 'jamaica': 'Jamaica', 'japan': 'Japan',
'jordan': 'Jordan', 'kazakhstan': 'Kazakhstan', 'kenya': 'Kenya',
'kosovo': 'Kosovo', 'kuwait': 'Kuwait', 'kyrgyzstan': 'Kyrgyzstan',
'laos': 'Laos', 'latvia': 'Latvia', 'lebanon': 'Lebanon', 'lesotho': 'Lesotho',
'liberia': 'Liberia', 'libya': 'Libya', 'lithuania': 'Lithuania',
'luxembourg': 'Luxembourg', 'madagascar': 'Madagascar', 'malawi': 'Malawi',
'malaysia': 'Malaysia', 'mali': 'Mali', 'mauritania': 'Mauritania',
'mauritius': 'Mauritius', 'mexico': 'Mexico', 'moldova': 'Moldova',
'mongolia': 'Mongolia', 'montenegro': 'Montenegro', 'morocco': 'Morocco',
'mozambique': 'Mozambique', 'myanmar': 'Myanmar', 'namibia': 'Namibia',
'nepal': 'Nepal', 'netherlands': 'Netherlands', 'nicaragua': 'Nicaragua',
'niger': 'Niger', 'nigeria': 'Nigeria', 'norway': 'Norway', 'oman': 'Oman',
'pakistan': 'Pakistan', 'palestine': 'Palestine', 'panama': 'Panama',
'paraguay': 'Paraguay', 'peru': 'Peru', 'philippines': 'Philippines',
'poland': 'Poland', 'portugal': 'Portugal', 'qatar': 'Qatar',
'romania': 'Romania', 'russia': 'Russia', 'rwanda': 'Rwanda',
'senegal': 'Senegal', 'serbia': 'Serbia', 'singapore': 'Singapore',
'slovakia': 'Slovakia', 'slovenia': 'Slovenia', 'somalia': 'Somalia',
'spain': 'Spain', 'sudan': 'Sudan', 'suriname': 'Suriname', 'sweden': 'Sweden',
'switzerland': 'Switzerland', 'syria': 'Syria', 'taiwan': 'Taiwan',
'tajikistan': 'Tajikistan', 'tanzania': 'Tanzania', 'thailand': 'Thailand',
'timor-leste': 'Timor-Leste', 'togo': 'Togo', 'tunisia': 'Tunisia',
'turkey': 'Turkey', 'turkmenistan': 'Turkmenistan', 'uganda': 'Uganda',
'ukraine': 'Ukraine', 'uruguay': 'Uruguay', 'uzbekistan': 'Uzbekistan',
'vanuatu': 'Vanuatu', 'venezuela': 'Venezuela', 'vietnam': 'Vietnam',
'yemen': 'Yemen', 'zambia': 'Zambia', 'zimbabwe': 'Zimbabwe',
}
const US_STATES = new Set([
'al', 'ak', 'az', 'ar', 'ca', 'co', 'ct', 'de', 'fl', 'ga',
'hi', 'id', 'il', 'in', 'ia', 'ks', 'ky', 'la', 'me', 'md',
'ma', 'mi', 'mn', 'ms', 'mo', 'mt', 'ne', 'nv', 'nh', 'nj',
'nm', 'ny', 'nc', 'nd', 'oh', 'ok', 'or', 'pa', 'ri', 'sc',
'sd', 'tn', 'tx', 'ut', 'vt', 'va', 'wa', 'wv', 'wi', 'wy', 'dc',
])
const US_STATE_NAMES = new Set([
'alabama', 'alaska', 'arizona', 'arkansas', 'california', 'colorado',
'connecticut', 'delaware', 'florida', 'hawaii', 'idaho',
'illinois', 'indiana', 'iowa', 'kansas', 'kentucky', 'louisiana',
'maine', 'maryland', 'massachusetts', 'michigan', 'minnesota',
'mississippi', 'missouri', 'montana', 'nebraska', 'nevada',
'new hampshire', 'new jersey', 'new mexico', 'new york', 'north carolina',
'north dakota', 'ohio', 'oklahoma', 'oregon', 'pennsylvania',
'rhode island', 'south carolina', 'south dakota', 'tennessee', 'texas',
'utah', 'vermont', 'virginia', 'washington', 'west virginia',
'wisconsin', 'wyoming', 'district of columbia',
])
const CA_PROVINCES = new Set([
'ab', 'bc', 'mb', 'nb', 'nl', 'ns', 'nt', 'nu', 'on', 'pe', 'qc', 'sk', 'yt',
])
const CA_PROVINCE_NAMES = new Set([
'alberta', 'british columbia', 'manitoba', 'new brunswick',
'newfoundland and labrador', 'nova scotia', 'northwest territories',
'nunavut', 'ontario', 'prince edward island', 'quebec', 'saskatchewan', 'yukon',
])
/**
* Parse a freeform location string (e.g. "Berlin, Germany" or "San Francisco, CA")
* and return the canonical country name matching COUNTRY_ID_TO_NAME values.
*/
export function parseCountry(location: string): string | null {
const parts = location.split(',').map(p => p.trim()).filter(Boolean)
for (let i = parts.length - 1; i >= 0; i--) {
const part = parts[i].toLowerCase()
const country = LOCATION_TO_COUNTRY[part]
if (country) return country
// 2-letter US state abbreviation
if (part.length === 2 && US_STATES.has(part)) return 'United States of America'
// Full US state name (skip "Georgia" to avoid conflict with the country)
if (part !== 'georgia' && US_STATE_NAMES.has(part)) return 'United States of America'
// Canadian province abbreviation
if (part.length === 2 && CA_PROVINCES.has(part)) return 'Canada'
// Full Canadian province name
if (CA_PROVINCE_NAMES.has(part)) return 'Canada'
}
return null
}
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.72
Platform
Anthropic API
Operating System
Other Linux
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗