Computer use in CLI fails: @ant/computer-use-swift native module missing from npm package

Status Closed — not planned
Maintainer reply None cached
Activity 5 comments · opened Mar 31, 2026 · closed Jun 7, 2026

Summary

Computer use in CLI (v2.1.88) fails with Cannot read properties of undefined (reading 'registerEscape'). The root cause is that the @ant/computer-use-swift native package is not included in the npm distribution.

Environment

  • macOS Darwin 24.6.0 (Apple Silicon)
  • Claude Code v2.1.88 (installed via npm/homebrew)
  • Claude Desktop app installed and working (computer use works fine in Desktop)
  • Pro plan, authenticated via claude.ai
  • Ghostty terminal (also reproduced in Terminal.app)
  • Screen Recording & Accessibility permissions granted

Steps to Reproduce

  1. Install Claude Code CLI v2.1.88
  2. Enable computer-use via /mcp
  3. Ask Claude to take a screenshot or perform any computer use action

Error

Cannot read properties of undefined (reading 'registerEscape')

Root Cause Analysis

The CLI source (swiftLoader.ts) calls require('@ant/computer-use-swift') to load the native module. However:

  • @ant/computer-use-swift does not exist in the CLI's node_modules/
  • No computer_use.node binary is bundled in the npm package
  • The only .node native binaries shipped are sharp-darwin-arm64.node and audio-capture.node

The native module does exist inside the Desktop app at:

/Applications/Claude.app/Contents/Resources/app.asar.unpacked/node_modules/@ant/claude-swift/build/Release/computer_use.node

And it loads fine when tested directly:

const m = require('/Applications/Claude.app/.../computer_use.node');
// m.computerUse.hotkey.registerEscape exists and works

The @ant/computer-use-swift/js/index.js supports a COMPUTER_USE_SWIFT_NODE_PATH env var override, but since the entire @ant/computer-use-swift package is missing from the CLI distribution, this codepath is never reached.

Expected Behavior

The @ant/computer-use-swift native module (or at minimum computer_use.node with its JS wrapper) should be included in the CLI npm package, or the CLI should locate it from the Desktop app installation.

View original on GitHub ↗

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