Follow Discord
Sweep 22 Sep 2026 · 17:19Z Build v2.1.280 501 read Stable v2.1.267 Latest v2.1.280 Next v2.1.280 Feeds RSS JSON llms.txt Unofficial
Claude Code v2.1.271 ·

Error.hasInstance cross-realm polyfill made more precise

A Node VM sandbox polyfill for Error instance checks now only overrides behavior for the base Error class

TierUnder the hoodhow much it should matter to you
Useful1my rating, 1 to 5
Signal1worth watching, 1 to 5
AreaElsewherewhat it touches
KindInternal Changesin v2.1.271,
Under the hood

A Node VM sandbox polyfill for Error instance checks now only overrides behavior for the base Error class

What

Claude Code runs some code inside a Node VM context (an isolated JavaScript sandbox), which needs a workaround so instanceof Error checks work correctly across that boundary. That workaround now only kicks in when the check is against Error itself; checks against subclasses of Error fall back to JavaScript's normal built-in behavior instead of being overridden.

Why

The previous version overrode the check unconditionally, which could give wrong answers for custom error subclasses. Narrowing it to just Error makes instance checks behave correctly in more cases.

See this entry in the whole of v2.1.271 →

Feedback