Skip to content

Claude CLI "Not logged in" when spawned from Claude Code VSCode extension on Windows #152

Description

@Mustfazcn

When running caliber refresh from Claude Code VSCode extension terminal (or PowerShell), it fails with "Not logged in · Please run /login" even though claude auth status returns loggedIn: true.

Expected: caliber refresh should successfully analyze changes and update configs.
Actual: Exits with code 1, stdout contains "Not logged in · Please run /login".

Debug findings:

  • claude auth status{"loggedIn": true, "authMethod": "claude.ai"}
  • echo "test" | claude -p → works fine in PowerShell
  • But when Caliber spawns claude -p via child_process.spawn(), Claude's anti-recursion check fires
  • Stripping CLAUDECODE, CLAUDE_CODE_ENTRYPOINT, CLAUDE_CODE_EXECPATH env vars did NOT fix it
  • Related to fix: strip CLAUDECODE env vars from claude subprocess to prevent auth failure #148 but env var stripping alone doesn't resolve on Windows

Steps to reproduce

  1. Open a project in VSCode with Claude Code extension active
  2. Run caliber init → select "Claude Code"
  3. Run caliber refresh from VSCode integrated terminal
  4. Also fails from standalone PowerShell terminal
  5. claude auth status confirms logged in
  6. echo "test" | claude -p works fine manually
  7. But caliber refresh always fails with "Not logged in"

Caliber version

v1.41.1

LLM Provider

Claude Code (seat)

Node.js version

v24.14.0

Operating system

Windows 11 Home 10.0.26200

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions