Skip to content

feat: Windows support via Git Bash #32

@nmhjklnm

Description

@nmhjklnm

Summary

Full Windows support for cac. Claude Code on Windows requires Git for Windows, so Git Bash (MINGW64) is always available.

Approach

Adapt the existing bash cac script to work in Git Bash, rather than rewriting in PowerShell or Node.js.

Core changes needed

Item Problem Solution
/dev/tcp Not available in MINGW bash _tcp_check() helper using node -e "require('net').connect(...)"
python3 May not exist on Windows Replace with node -e (guaranteed available)
Wrapper Need claude.cmd not bash _write_wrapper generates claude.cmd on Windows
Shims ioreg/ifconfig/cat shims not needed Skip on Windows — fingerprint-hook.js handles everything
RC files No .bashrc in native context Write to Git Bash ~/.bashrc + set Windows system PATH via registry
Platform _detect_platform returns unsupported Add win32-x64 support
openssl Not default on Windows Git for Windows bundles OpenSSL

What already works cross-platform

  • fingerprint-hook.js — already has Windows wmic/reg interception
  • cac-dns-guard.js — pure Node.js, fully cross-platform
  • relay.js — pure Node.js
  • NODE_OPTIONS --require / BUN_OPTIONS --preload — cross-platform

Testing

Need a Windows machine or VM with:

  • Git for Windows installed
  • Claude Code installed (irm https://claude.ai/install.ps1 | iex)
  • npm available

Files to modify

  • src/utils.sh_tcp_check(), _detect_platform, _write_path_to_rc
  • src/templates.sh_write_wrapper Windows branch, skip shims
  • src/cmd_setup.sh_ensure_initialized Windows branch
  • src/cmd_claude.sh — Windows binary download support
  • package.jsonbin field for Windows

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions