[BUG] TypeError: B.allowedTools is not iterable

Resolved 💬 5 comments Opened Aug 19, 2025 by Heinvv10 Closed Jan 8, 2026

● Environment

  • Platform (select one):
  • Claude CLI version: 1.0.83 (Claude Code)
  • Operating System: Windows 11
  • Terminal: Command Prompt / PowerShell

Bug Description

Claude Code CLI throws a "TypeError: B.allowedTools is not iterable" error when running the claude command in
certain project directories, preventing the CLI from starting. The error occurs consistently in specific
directories while working normally in others within the same parent directory.

Steps to Reproduce

  1. Install Claude Code CLI v1.0.83: npm install -g @anthropic-ai/claude-code
  2. Navigate to a project directory that triggers the error
  3. Run claude command (without any arguments)
  4. Observe the TypeError

Expected Behavior

Claude Code CLI should start normally and enter interactive mode, as it does in other directories.

Actual Behavior

The CLI crashes immediately with the following error:

TypeError: B.allowedTools is not iterable
at Wq1 (file:///[user-path]/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:739:1373)
at M5B (file:///[user-path]/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:858:12199)
at tT0.<anonymous>
(file:///[user-path]/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:3459:116)
at tT0.B [as _actionHandler]
(file:///[user-path]/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:667:528)
at file:///[user-path]/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:671:3127
at tT0._chainOrCall
(file:///[user-path]/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:671:1694)
at tT0._parseCommand
(file:///[user-path]/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:671:3103)
at tT0.parseAsync
(file:///[user-path]/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:668:4195)
at dT8 (file:///[user-path]/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:3489:1224)
at gT8 (file:///[user-path]/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:3446:10158)

Node.js v24.6.0

Additional Context

Affected directories (CLI crashes):

  • Some project directories with existing .claude configuration folders
  • Projects with permission settings in .claude/settings.local.json
  • Approximately 3 out of 5 tested project directories show this issue

Working directories (CLI starts normally):

  • Parent workspace directory
  • Other project directories in the same workspace
  • Newly created directories without existing configuration

Investigation findings:

  1. The error occurs in the Wq1() function at line 739 of cli.js, which contains:

for(let Q of B.allowedTools)

  1. where B.allowedTools is undefined instead of an array.
  2. The function expects B (returned from UQ()) to have an allowedTools property, but in certain directories this

property is missing.

  1. The SDK definition shows allowedTools should default to an empty array:

allowedTools = [], // from sdk.mjs line 105

  1. Attempted workarounds that didn't resolve the issue:
  • Adding "allowedTools": [] to .claude/settings.local.json
  • Removing .claude directories entirely
  • Clearing parent directory configurations
  1. Note: claude --version works in all directories (only shows version), but claude (interactive mode) fails with

this error.

This appears to be a bug in the CLI's configuration initialization where the allowedTools property isn't being
properly initialized in certain project contexts.

View original on GitHub ↗

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