{"version":"2.1.334","anchor":"repl-script-rewriter-handles-for-infor-of-loop-variables-an","canonical_anchor":"repl-script-rewriter-handles-for-infor-of-loop-variables-an","heading":"REPL scripts reserve the name __replItem and handle for-in and for-of loops differently","tier":"notice","area":"REPL","scope":"individual","heads_up":true,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.334\/e\/repl-script-rewriter-handles-for-infor-of-loop-variables-an","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.334","markdown":"### REPL scripts reserve the name __replItem and handle for-in and for-of loops differently\n\nScripts run through the REPL now fail if they use the name __replItem anywhere, and for-in and for-of loops are rewritten before they run\n\n**What**\n\nClaude Code rewrites scripts run through its REPL feature before running them. That rewriting has changed in two ways:\n\n- `__replItem` is now reserved. A script that contains this name anywhere, even inside a piece of text, is rejected with the message \"REPL: the name __replItem is reserved, also in text. Use another name.\"\n\n- `for...in` and `for...of` loops that use a plain variable name now get their own handling: the loop variable is set again inside the loop body, rather than the loop being wrapped like any other loop.\n\nClaude Code also now takes account of the `in` operator inside the head of a `for` loop when it judges how costly a script is.\n\n**Why**\n\nA REPL script that uses `__replItem` as a name will now stop with an error instead of running. Loops over items are also handled differently from before.\n\n- Area: REPL\n- Names: `__replItem`\n- Tier: You'll notice\n- Useful: 2\/5\n- Signal: 1\/5\n- Scope: individual\n- Heads-up: yes"}