Skip to content

Add Native Windows Support - #7

Open
ajauch wants to merge 3 commits into
mpociot:mainfrom
ajauch:main
Open

Add Native Windows Support#7
ajauch wants to merge 3 commits into
mpociot:mainfrom
ajauch:main

Conversation

@ajauch

@ajauch ajauch commented Oct 13, 2025

Copy link
Copy Markdown

<<NOTE: This content was created by Claude Code>>

Summary

This PR adds native Windows support to the Claude Code Slack Bot. The Claude Code SDK now works on Windows, but
the npm package still includes an outdated preinstall script that blocks Windows installations. This PR adds a
workaround for installation and fixes several runtime bugs discovered during testing on Windows.

Changes

  1. Installation Workaround (.npmrc)
  • Added .npmrc with ignore-scripts=true to bypass the outdated Windows platform check in the Claude Code SDK's
    preinstall script
  • The SDK itself works fine on Windows; only the install-time check is outdated
  • This is a temporary workaround until the upstream SDK updates its platform check
  1. Cross-Platform Path Resolution (src/claude-handler.ts)
  • Fixed: Hardcoded macOS path for permission MCP server
  • Changed: From absolute path /Users/marcelpociot/Experiments/claude-code-slack/src/permission-mcp-server.ts
  • To: Dynamic resolution using path.join(__dirname, 'permission-mcp-server.ts')
  • Impact: Works correctly on Windows, macOS, and Linux
  1. POSIX Shell Support (.env)
  • Added: Documentation for SHELL environment variable requirement
  • The Claude Code SDK requires a POSIX shell (bash) to execute commands
  • Windows users need to set SHELL=C:\Program Files\Git\usr\bin\bash.exe (or path to their bash installation)
  • Git Bash is commonly installed on Windows development machines
  1. MCP Server Startup Fix (src/permission-mcp-server.ts)
  • Fixed: Main module detection that wasn't working on Windows with tsx
  • Changed: From import.meta.url === file://${process.argv[1]}
  • To: process.argv[1]?.includes('permission-mcp-server')
  • Impact: Permission prompt MCP server now starts correctly on all platforms
  1. MCP Tool Discovery (src/claude-handler.ts)
  • Removed: Restrictive allowedTools array that was blocking MCP tools
  • Impact: SDK now automatically allows all tools from configured MCP servers

Testing

Tested on Windows 11 with:

  • Node.js v22.16.0
  • Git Bash for POSIX shell compatibility
  • npm install successfully bypasses platform check
  • Bot runs and responds to Slack messages correctly
  • Permission prompt MCP server functions properly

Files Changed

  • .npmrc (new) - npm configuration to skip install scripts
  • src/claude-handler.ts - Fixed hardcoded path and removed tool restrictions
  • src/permission-mcp-server.ts - Fixed main module detection
  • CLAUDE.md - Updated documentation with Windows support details
  • README.md - Added Windows support note
  • changelog.md (new) - Detailed changelog of all fixes

Compatibility

All changes maintain backward compatibility with macOS and Linux. The code uses cross-platform Node.js APIs and
conditional logic to support all platforms.

Notes

  • Changes are minimal and isolated to maintain merge compatibility with upstream
  • No architectural changes were made per branch guidelines
  • This enables the bot to run natively on Windows without WSL or Docker

Made changes to get the bot to work correctly on windows.  See changelog.md for summary.
Added top level description of change for Windows support.
Fixed numbering.
@ajauch

ajauch commented Oct 14, 2025

Copy link
Copy Markdown
Author

This addresses both of the issues I've opened:

#5
and
#6

I've tested this on my Windows laptop but I don't have a Mac so you'll want to re-test to make sure I didn't break anything there.

hmshb added a commit to hmshb/rapidus-squad that referenced this pull request May 23, 2026
…le-vendor LLM

Items 6–10 of the second-pass audit punch list, applied to the plan and the
demo tour. Scope cuts make Foundation feasible in 3 weeks; the new pieces fill
gaps that were correctness/clarity holes, not new features.

mpociot#6 Foundation scope cut: admin UI trimmed to 4 screens (Repos, Channels, Users,
   Audit); linear-mcp deferred to v1.x (beta partner uses GitHub Issues +
   Notion for docs).
mpociot#7 Adversarial test split: A1–A8 gate every release CI (~8 min); A9–A20 run
   nightly against main and fail on regression. Cuts release CI from ~25 min
   to ~10 min without losing the load-bearing controls.
mpociot#8 New §9 sub-section "Iterative PR review": (repo, branch)-keyed Claude
   session resumed across review cycles, GitHub-comment webhook surfaces in
   the PR's Slack thread but Casey only acts on a Slack 👍 from the customer
   user (prevents a compromised GitHub account from puppeting Casey), 0.2
   quota units per follow-up, @casey reset escape hatch. New §6 threat row
   for the puppet-via-PR-comment scenario.
mpociot#9 audit_events schema committed in v1 as a stable contract; external
   SIEM/Splunk/S3 sink remains post-v1 but the shape is fixed so v1.x adds
   the pipe without a breaking migration.
mpociot#10 v1 = Anthropic direct only. Egress proxy allowlists api.anthropic.com
    (SPKI-pinned). Bedrock/Vertex env vars dropped from .env.example and
    README; multi-vendor LLM deferred to v1.x as an ops change (egress
    allowlist + pin-set extension), not a code change.

Plus internal-consistency sweep: audit banner item (7), §6 sandbox-escape row,
§10 admin UI mocks (Connectors, System Health, branch-protection label),
§13 MCP-pinning bullet, §5 connector typology + v1 connector table — all
brought in line with the punch-list changes. Demo files (01-install,
09b-guardrails) updated to match plan: branch-protection webhook + 25h
freshness, bare-clone + worktree-per-branch sandbox model.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant