Analyzed: March 31, 2026 leak snapshot

What REPL mode changes

REPL mode changes the tool surface shown to the model. When enabled, Claude Code can hide several primitive tools and expose REPLTool instead. The point is not to remove capability, but to wrap those capabilities in a different execution model.

Enablement logic

src/tools/REPLTool/constants.ts shows the exact rules:
  • CLAUDE_CODE_REPL=0 forces it off
  • CLAUDE_REPL_MODE=1 forces it on
  • otherwise it defaults on only for Anthropic internal interactive CLI entrypoints
The code comment is explicit that SDK entrypoints are excluded because SDK consumers often depend on direct primitive tool calls.

Hidden primitive tools

The REPL_ONLY_TOOLS set includes:
  • read
  • write
  • edit
  • glob
  • grep
  • bash
  • notebook edit
  • agent
When REPL mode is active and the REPL tool is present, these are hidden from direct model use.

Why this exists

The comment in constants.ts explains the design: REPL mode forces Claude to use REPL for batch operations rather than mixing low-level primitives directly into the normal tool stream. That is both a prompt-shaping and execution-shaping decision.