Skip to content

Conversation

@ajauch
Copy link

@ajauch ajauch commented Oct 13, 2025

<<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
Copy link
Author

ajauch commented Oct 14, 2025

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.

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