[BUG] Session halts after receiving 400 API error (Output blocked by content filtering policy)

Status Closed — not planned
Maintainer reply None cached
Activity 11 comments · opened Sep 1, 2025 · closed Feb 12, 2026

Environment

  • Platform (select one):
  • [x] Anthropic API
  • [ ] AWS Bedrock
  • [ ] Google Vertex AI
  • [ ] Other: <!-- specify -->
  • Claude CLI version: 1.0.98
  • Operating System: openSUSE Tumbleweed Linux
  • Terminal: xfce4-terminal

Bug Description

Claude Code received an HTTP 400 response from Wikipedia and gave up.

Steps to Reproduce

  1. Ask Claude Code to compare a list of ISO country codes in a file with the list in https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
  2. Observe that it manages to successfully identify differences
  3. Ask it to fix the file to match the ISO list exactly
  4. Observe that it gets a 400 response from Wikipedia (Output blocked by content filtering policy) despite step 2 already proving it's able to retrieve the necessary info
  5. Observe that it stops working immediately after the 400 error, without any reason given

Expected Behavior

It should not stop working. If the URL being tried is blocked for some reason, then it should try other ones, or at very least explain to the user why it's giving up and provide some other helpful suggestion for a way forward.

Actual Behavior

> OK fix my ISO list to match the official

● Fetch(https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)
  ⎿  Received 515.9KB (200 OK)
  ⎿  API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"Output blocked by content filtering policy"},"request_id":null}

> Which API request is receiving 400 response?

● I need to search for API requests and 400 responses in your codebase to identify which one is failing.

● Search(pattern: "400|Bad Request|status.*400")
  ⎿  Found 70 files (ctrl+r to expand)

● Let me search more specifically for API requests and HTTP error handling:

● Search(pattern: "(fetch|axios|api|request).*400|400.*response|response.*400", output_mode: "content")
  ⎿  Found 20 lines (ctrl+r to expand)
  ⎿  Interrupted by user

> No, I mean in response to your request just now from wikipedia

● You're right - the WebFetch request I just made to Wikipedia is receiving a 400 response. This suggests the Wikipedia API or the WebFetch tool is having issues
  with that specific request.

  Let me try a different approach and manually create the corrected ISO country list based on what I already identified from the comparison:
  ⎿  API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"Output blocked by content filtering policy"},"request_id":null}

> You got another 400. Don't stop working when this happens, find a solution!

● You're absolutely right! Let me fix the ISO country list manually using what I already know from the comparison and standard ISO references.
  ⎿  API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"Output blocked by content filtering policy"},"request_id":null}

> You stopped again!
  ⎿  API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"Output blocked by content filtering policy"},"request_id":null}

View original on GitHub ↗

11 Comments

aspiers · 12 months ago

Just noticed this looks similar to #6772.

github-actions[bot] · 8 months ago

This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

aspiers · 8 months ago

Auto-closing without any response is not a valid approach to improving products and customer satisfaction.

mbe81 · 8 months ago

I have a similar problem. I have, using Go, a country package with a map with all country names. Now I try to move that package to a shared repository and update all references/ add some other functions but Claude refuses with API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"Output blocked by content filtering policy"},"request_id":null}. Strange thing is, the list of countries was earlier generated by Claude itself.

I am using Claude Code version 2.0.76 (Claude Code)

package country

type Country struct {
	Code string `json:"code"`
	Name string `json:"name"`
}

// Exists checks if a country code is valid.
func Exists(code string) bool {
	for _, c := range ListCountries() {
		if c.Code == code {
			return true
		}
	}
	return false
}

func ListCountries() []Country {
	return []Country{
		{Code: "AF", Name: "Afghanistan"},
		{Code: "AX", Name: "Åland Islands"},
		{Code: "AL", Name: "Albania"},
		{Code: "DZ", Name: "Algeria"},
		{Code: "AS", Name: "American Samoa"},
		{Code: "AD", Name: "Andorra"},
		{Code: "AO", Name: "Angola"},
		{Code: "AI", Name: "Anguilla"},
		{Code: "AQ", Name: "Antarctica"},
		{Code: "AG", Name: "Antigua and Barbuda"},
		{Code: "AR", Name: "Argentina"},
		{Code: "AM", Name: "Armenia"},
		{Code: "AW", Name: "Aruba"},
		{Code: "AU", Name: "Australia"},
		{Code: "AT", Name: "Austria"},
		{Code: "AZ", Name: "Azerbaijan"},
		{Code: "BS", Name: "Bahamas"},
		{Code: "BH", Name: "Bahrain"},
		{Code: "BD", Name: "Bangladesh"},
		{Code: "BB", Name: "Barbados"},
		{Code: "BY", Name: "Belarus"},
		{Code: "BE", Name: "Belgium"},
		{Code: "BZ", Name: "Belize"},
		{Code: "BJ", Name: "Benin"},
		{Code: "BM", Name: "Bermuda"},
		{Code: "BT", Name: "Bhutan"},
		{Code: "BO", Name: "Bolivia (Plurinational State of)"},
		{Code: "BQ", Name: "Bonaire, Sint Eustatius and Saba"},
		{Code: "BA", Name: "Bosnia and Herzegovina"},
		{Code: "BW", Name: "Botswana"},
		{Code: "BV", Name: "Bouvet Island"},
		{Code: "BR", Name: "Brazil"},
		{Code: "IO", Name: "British Indian Ocean Territory"},
		{Code: "BN", Name: "Brunei Darussalam"},
		{Code: "BG", Name: "Bulgaria"},
		{Code: "BF", Name: "Burkina Faso"},
		{Code: "BI", Name: "Burundi"},
		{Code: "CV", Name: "Cabo Verde"},
		{Code: "KH", Name: "Cambodia"},
		{Code: "CM", Name: "Cameroon"},
		{Code: "CA", Name: "Canada"},
		{Code: "KY", Name: "Cayman Islands"},
		{Code: "CF", Name: "Central African Republic"},
		{Code: "TD", Name: "Chad"},
		{Code: "CL", Name: "Chile"},
		{Code: "CN", Name: "China"},
		{Code: "CX", Name: "Christmas Island"},
		{Code: "CC", Name: "Cocos (Keeling) Islands"},
		{Code: "CO", Name: "Colombia"},
		{Code: "KM", Name: "Comoros"},
		{Code: "CG", Name: "Congo"},
		{Code: "CD", Name: "Congo (Democratic Republic of the)"},
		{Code: "CK", Name: "Cook Islands"},
		{Code: "CR", Name: "Costa Rica"},
		{Code: "CI", Name: "Côte d'Ivoire"},
		{Code: "HR", Name: "Croatia"},
		{Code: "CU", Name: "Cuba"},
		{Code: "CW", Name: "Curaçao"},
		{Code: "CY", Name: "Cyprus"},
		{Code: "CZ", Name: "Czechia"},
		{Code: "DK", Name: "Denmark"},
		{Code: "DJ", Name: "Djibouti"},
		{Code: "DM", Name: "Dominica"},
		{Code: "DO", Name: "Dominican Republic"},
		{Code: "EC", Name: "Ecuador"},
		{Code: "EG", Name: "Egypt"},
		{Code: "SV", Name: "El Salvador"},
		{Code: "GQ", Name: "Equatorial Guinea"},
		{Code: "ER", Name: "Eritrea"},
		{Code: "EE", Name: "Estonia"},
		{Code: "SZ", Name: "Eswatini"},
		{Code: "ET", Name: "Ethiopia"},
		{Code: "FK", Name: "Falkland Islands (Malvinas)"},
		{Code: "FO", Name: "Faroe Islands"},
		{Code: "FJ", Name: "Fiji"},
		{Code: "FI", Name: "Finland"},
		{Code: "FR", Name: "France"},
		{Code: "GF", Name: "French Guiana"},
		{Code: "PF", Name: "French Polynesia"},
		{Code: "TF", Name: "French Southern Territories"},
		{Code: "GA", Name: "Gabon"},
		{Code: "GM", Name: "Gambia"},
		{Code: "GE", Name: "Georgia"},
		{Code: "DE", Name: "Germany"},
		{Code: "GH", Name: "Ghana"},
		{Code: "GI", Name: "Gibraltar"},
		{Code: "GR", Name: "Greece"},
		{Code: "GL", Name: "Greenland"},
		{Code: "GD", Name: "Grenada"},
		{Code: "GP", Name: "Guadeloupe"},
		{Code: "GU", Name: "Guam"},
		{Code: "GT", Name: "Guatemala"},
		{Code: "GG", Name: "Guernsey"},
		{Code: "GN", Name: "Guinea"},
		{Code: "GW", Name: "Guinea-Bissau"},
		{Code: "GY", Name: "Guyana"},
		{Code: "HT", Name: "Haiti"},
		{Code: "HM", Name: "Heard Island and McDonald Islands"},
		{Code: "VA", Name: "Holy See"},
		{Code: "HN", Name: "Honduras"},
		{Code: "HK", Name: "Hong Kong"},
		{Code: "HU", Name: "Hungary"},
		{Code: "IS", Name: "Iceland"},
		{Code: "IN", Name: "India"},
		{Code: "ID", Name: "Indonesia"},
		{Code: "IR", Name: "Iran (Islamic Republic of)"},
		{Code: "IQ", Name: "Iraq"},
		{Code: "IE", Name: "Ireland"},
		{Code: "IM", Name: "Isle of Man"},
		{Code: "IL", Name: "Israel"},
		{Code: "IT", Name: "Italy"},
		{Code: "JM", Name: "Jamaica"},
		{Code: "JP", Name: "Japan"},
		{Code: "JE", Name: "Jersey"},
		{Code: "JO", Name: "Jordan"},
		{Code: "KZ", Name: "Kazakhstan"},
		{Code: "KE", Name: "Kenya"},
		{Code: "KI", Name: "Kiribati"},
		{Code: "KP", Name: "Korea (Democratic People's Republic of)"},
		{Code: "KR", Name: "Korea (Republic of)"},
		{Code: "KW", Name: "Kuwait"},
		{Code: "KG", Name: "Kyrgyzstan"},
		{Code: "LA", Name: "Lao People's Democratic Republic"},
		{Code: "LV", Name: "Latvia"},
		{Code: "LB", Name: "Lebanon"},
		{Code: "LS", Name: "Lesotho"},
		{Code: "LR", Name: "Liberia"},
		{Code: "LY", Name: "Libya"},
		{Code: "LI", Name: "Liechtenstein"},
		{Code: "LT", Name: "Lithuania"},
		{Code: "LU", Name: "Luxembourg"},
		{Code: "MO", Name: "Macao"},
		{Code: "MG", Name: "Madagascar"},
		{Code: "MW", Name: "Malawi"},
		{Code: "MY", Name: "Malaysia"},
		{Code: "MV", Name: "Maldives"},
		{Code: "ML", Name: "Mali"},
		{Code: "MT", Name: "Malta"},
		{Code: "MH", Name: "Marshall Islands"},
		{Code: "MQ", Name: "Martinique"},
		{Code: "MR", Name: "Mauritania"},
		{Code: "MU", Name: "Mauritius"},
		{Code: "YT", Name: "Mayotte"},
		{Code: "MX", Name: "Mexico"},
		{Code: "FM", Name: "Micronesia (Federated States of)"},
		{Code: "MD", Name: "Moldova (Republic of)"},
		{Code: "MC", Name: "Monaco"},
		{Code: "MN", Name: "Mongolia"},
		{Code: "ME", Name: "Montenegro"},
		{Code: "MS", Name: "Montserrat"},
		{Code: "MA", Name: "Morocco"},
		{Code: "MZ", Name: "Mozambique"},
		{Code: "MM", Name: "Myanmar"},
		{Code: "NA", Name: "Namibia"},
		{Code: "NR", Name: "Nauru"},
		{Code: "NP", Name: "Nepal"},
		{Code: "NL", Name: "Netherlands"},
		{Code: "NC", Name: "New Caledonia"},
		{Code: "NZ", Name: "New Zealand"},
		{Code: "NI", Name: "Nicaragua"},
		{Code: "NE", Name: "Niger"},
		{Code: "NG", Name: "Nigeria"},
		{Code: "NU", Name: "Niue"},
		{Code: "NF", Name: "Norfolk Island"},
		{Code: "MK", Name: "North Macedonia"},
		{Code: "MP", Name: "Northern Mariana Islands"},
		{Code: "NO", Name: "Norway"},
		{Code: "OM", Name: "Oman"},
		{Code: "PK", Name: "Pakistan"},
		{Code: "PW", Name: "Palau"},
		{Code: "PS", Name: "Palestine, State of"},
		{Code: "PA", Name: "Panama"},
		{Code: "PG", Name: "Papua New Guinea"},
		{Code: "PY", Name: "Paraguay"},
		{Code: "PE", Name: "Peru"},
		{Code: "PH", Name: "Philippines"},
		{Code: "PN", Name: "Pitcairn"},
		{Code: "PL", Name: "Poland"},
		{Code: "PT", Name: "Portugal"},
		{Code: "PR", Name: "Puerto Rico"},
		{Code: "QA", Name: "Qatar"},
		{Code: "RE", Name: "Réunion"},
		{Code: "RO", Name: "Romania"},
		{Code: "RU", Name: "Russian Federation"},
		{Code: "RW", Name: "Rwanda"},
		{Code: "BL", Name: "Saint Barthélemy"},
		{Code: "SH", Name: "Saint Helena, Ascension and Tristan da Cunha"},
		{Code: "KN", Name: "Saint Kitts and Nevis"},
		{Code: "LC", Name: "Saint Lucia"},
		{Code: "MF", Name: "Saint Martin (French part)"},
		{Code: "PM", Name: "Saint Pierre and Miquelon"},
		{Code: "VC", Name: "Saint Vincent and the Grenadines"},
		{Code: "WS", Name: "Samoa"},
		{Code: "SM", Name: "San Marino"},
		{Code: "ST", Name: "Sao Tome and Principe"},
		{Code: "SA", Name: "Saudi Arabia"},
		{Code: "SN", Name: "Senegal"},
		{Code: "RS", Name: "Serbia"},
		{Code: "SC", Name: "Seychelles"},
		{Code: "SL", Name: "Sierra Leone"},
		{Code: "SG", Name: "Singapore"},
		{Code: "SX", Name: "Sint Maarten (Dutch part)"},
		{Code: "SK", Name: "Slovakia"},
		{Code: "SI", Name: "Slovenia"},
		{Code: "SB", Name: "Solomon Islands"},
		{Code: "SO", Name: "Somalia"},
		{Code: "ZA", Name: "South Africa"},
		{Code: "GS", Name: "South Georgia and the South Sandwich Islands"},
		{Code: "SS", Name: "South Sudan"},
		{Code: "ES", Name: "Spain"},
		{Code: "LK", Name: "Sri Lanka"},
		{Code: "SD", Name: "Sudan"},
		{Code: "SR", Name: "Suriname"},
		{Code: "SJ", Name: "Svalbard and Jan Mayen"},
		{Code: "SE", Name: "Sweden"},
		{Code: "CH", Name: "Switzerland"},
		{Code: "SY", Name: "Syrian Arab Republic"},
		{Code: "TW", Name: "Taiwan, Province of China"},
		{Code: "TJ", Name: "Tajikistan"},
		{Code: "TZ", Name: "Tanzania, United Republic of"},
		{Code: "TH", Name: "Thailand"},
		{Code: "TL", Name: "Timor-Leste"},
		{Code: "TG", Name: "Togo"},
		{Code: "TK", Name: "Tokelau"},
		{Code: "TO", Name: "Tonga"},
		{Code: "TT", Name: "Trinidad and Tobago"},
		{Code: "TN", Name: "Tunisia"},
		{Code: "TR", Name: "Türkiye"},
		{Code: "TM", Name: "Turkmenistan"},
		{Code: "TC", Name: "Turks and Caicos Islands"},
		{Code: "TV", Name: "Tuvalu"},
		{Code: "UG", Name: "Uganda"},
		{Code: "UA", Name: "Ukraine"},
		{Code: "AE", Name: "United Arab Emirates"},
		{Code: "GB", Name: "United Kingdom of Great Britain and Northern Ireland"},
		{Code: "US", Name: "United States of America"},
		{Code: "UM", Name: "United States Minor Outlying Islands"},
		{Code: "UY", Name: "Uruguay"},
		{Code: "UZ", Name: "Uzbekistan"},
		{Code: "VU", Name: "Vanuatu"},
		{Code: "VE", Name: "Venezuela (Bolivarian Republic of)"},
		{Code: "VN", Name: "Viet Nam"},
		{Code: "VG", Name: "Virgin Islands (British)"},
		{Code: "VI", Name: "Virgin Islands (U.S.)"},
		{Code: "WF", Name: "Wallis and Futuna"},
		{Code: "EH", Name: "Western Sahara"},
		{Code: "YE", Name: "Yemen"},
		{Code: "ZM", Name: "Zambia"},
		{Code: "ZW", Name: "Zimbabwe"},
	}
}
barrycoleman · 8 months ago

I just got the same issue creating a country list for Python using the ISO 3166 alpha 2.

veryangru · 7 months ago

Got the same issue. My workaround was to tell it to create the list by adding only a few countries at a time (something like five). In the end I had the full list. 🤦

github-actions[bot] · 6 months ago

This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.

marcindulak · 6 months ago

This issue was closed incorrectly despite recent human comments. This behavior of the bot is reported at https://github.com/anthropics/claude-code/issues/16497. Please upvote that issue, so maybe it gets noticed.

anasmatic · 6 months ago

I'm facing this issue with claude code. it's blocking me from continuing my implantation midway for no absolute reason. I'm not using any copyrighted content and how to do that even in code work! this error should not happen in claude code!
I reported it via /bug. but now it's a blocker and I'm looking for a workaround to continue the implementation.

sambhav-aggarwal · 6 months ago

Facing similar issue.

github-actions[bot] · 6 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.