JavaScript REPL Tool#
What's wrong with this entry?
A new built-in tool that lets Claude execute JavaScript code in a persistent VM context with programmatic access to Claude Code tools (Read, Write, Edit, Glob, Grep, Bash).
Usage: Claude can now run JavaScript directly to perform file operations, chain tool calls, and compute results. Variables persist across multiple REPL invocations within the same conversation.
- Supports top-level
awaitfor async operations - State persists across calls — variables defined in one REPL call remain accessible in subsequent calls
- Provides
registerTool(),unregisterTool(),listTools(), andgetTool()for dynamic tool management - Includes a
haiku(prompt, schema?)function for lightweight model sampling - Includes
shQuote(s)for safe shell string quoting import/requireare not available (VM context is sealed); use the built-in tool functions for file and shell operations- REPL VM state is cleared on
/compact— a notification informs you: "Your REPL VM state has been cleared as part of this compaction" - Includes a replay mechanism for validating REPL execution determinism across compaction boundaries
REPL tool registration with "Execute JavaScript code with access to Claude Code tools" description (search for "Execute JavaScript")
Strings lifted out of the shipped bundle, so the claim above can be checked against them.