Skip to content

Use with vscode Claude Code native mode? #379

Open

Description

@glasser

I like to use the VSCode Claude Code extension's native mode. This seems to kind of work with happy if you put it in for the "Claude Process Wrapper" configuration, but it's a bit janky, especially when it prompts for permissions, and around trying to switch back to local mode. Has anyone done this fully successfully?

Activity

  1. jonnycook commented on Jan 29, 2026

    @jonnycook

    Curious about this as well

  2. walaqi commented on Feb 2, 2026

    @walaqi

    looking forward to the release.

  3. ruushu commented on Feb 10, 2026

    @ruushu

    +1 for VSCode extension support!

    I'm also very interested in using Happy with the VSCode Claude Code extension.

    My use case:

    • Work on VSCode extension during the day at my desk
    • Want to continue the same session from my phone when I'm away
    • Need full session history continuity (--resume equivalent)

    The current workaround (VS Code Tunnel) requires my Mac to stay awake, which isn't ideal.

    Would love to see native VSCode extension integration!

  4. cxhttt233 commented on Feb 12, 2026

    @cxhttt233

    +1

  5. Llugaes commented on Apr 30, 2026

    @Llugaes

    Hit this with 2.1.122 Windows extension + happy-coder@1.1.8 today.
    Wanted to share a concrete failure mode and trace in case it helps.

    Setup

    • Cursor (VS Code fork) with Anthropic's claude-code extension 2.1.122 (bundles native claude.exe, no cli.js)
    • happy-coder@1.1.8 installed globally
    • settings.json: "claudeCode.claudeProcessWrapper": "<path-to-happy.mjs>"

    Symptom

    Extension spawns happy.mjs via SDK query. happy exits immediately with:

    From claude: <ext-dir>\resources\native-binary\claude.exe:1
    MZx
    
    SyntaxError: Invalid or unexpected token
        at wrapSafe (node:internal/modules/cjs/loader:1692:18)
        at Module._compile (node:internal/modules/cjs/loader:1735:20)
        at Object..js (node:internal/modules/cjs/loader:1893:10)
        at Module.load (node:internal/modules/cjs/loader:1481:32)
        at Module._load (node:internal/modules/cjs/loader:1300:12)
        at TracingChannel.traceSync (node:diagnostics_channel:328:14)
        at wrapModuleLoad (node:internal/modules/cjs/loader:245:24)
        at Module.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:154:5)
        at node:internal/main/run_main_module:33:47
    Node.js v24.12.0
    

    The MZ is the PE header of claude.exe being parsed as JavaScript — i.e. node <path-to-claude.exe> was invoked somewhere.

    What's notable

    cli-1.1.7 changelog says "detect Claude Code native binary (2.1.113+)", and scripts/claude_version_utils.cjs → runClaudeCli() indeed has an .exe branch that spawns the binary directly (no Node involvement):

    const isJsFile = cliPath.endsWith('.js') || cliPath.endsWith('.cjs');
    if (isJsFile) {
        import(importUrl);
    } else {
        const child = spawn(cliPath, args, { stdio: 'inherit', env: process.env });
    }

    So happy's own launcher handles native binary correctly. The node <exe> invocation must be happening on a different code path.

    Hypothesis

    When the extension's wrapper invocation hits happy, happy dispatches to runClaude() (happy CLI default branch, index-q9G4ktSK.mjs:10682) — the full session orchestration, not a transparent pass-through. runClaude ultimately invokes @anthropic-ai/claude-agent-sdk's query() (imported at index-q9G4ktSK.mjs:14, called at :1239). The SDK has its own spawn logic for claude, and I suspect that path still does spawn('node', [claudePath, ...]) unconditionally — which explodes when claudePath is a native .exe.

    This would match what @glasser originally described as "a bit janky" — it's not just permission prompts; core invocation breaks on any Windows / macOS arm64 / Linux box with @anthropic-ai/claude-code >= 2.1.113.

    Secondary concern

    Even setting the MZ error aside: dispatching extension-invoked happy to the full runClaude() orchestration seems wrong — it assumes TTY, interactive auth, daemon ensure, session create, etc. A VS Code extension wrapper invocation is non-interactive and expects claude stream-json protocol on stdio. Maybe wrapper mode warrants a dedicated code path that stays transparent and defers mobile sync to a side-channel?

    Environment

    • Windows 11, Node v24.12.0
    • happy-coder@1.1.8
    • @anthropic-ai/claude-code@2.1.123 (native installer, binary distribution)
    • VS Code extension 2.1.122 (bundles its own native binary)

    Happy to test patches / gather more traces if useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    • Status
      Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions