{"id":25074,"library":"claude-code-win32","title":"claude-code-win32","description":"Claude Code plugin for Windows that transparently transpiles Bash commands to PowerShell equivalents. v0.1.1 (March 2025) — hooks manifest fix. Fast-path passes POSIX-safe commands (git, npm, grep) straight to Git Bash; rewrites Unix idioms (xdg-open, pbcopy, uname, df, free) to PowerShell; denies impossible commands (sudo, apt, chmod) with Windows-native hints. MSYS path translation (/c/… → C:/…), PS 5.1 vs PS 7 awareness, internal error safety. TypeScript types included. Requires Node >=20. Active development, GitHub-only.","status":"active","version":"0.1.1","language":"javascript","source_language":"en","source_url":"https://github.com/hmennen90/claude-code-win32","tags":["javascript","claude","claude-code","claude-code-plugin","claude-plugin","windows","win32","bash","powershell","typescript"],"install":[{"cmd":"npm install claude-code-win32","lang":"bash","label":"npm"},{"cmd":"yarn add claude-code-win32","lang":"bash","label":"yarn"},{"cmd":"pnpm add claude-code-win32","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM-only; package does not expose CommonJS. Use dynamic import() if needed in CJS context.","wrong":"const transpile = require('claude-code-win32')","symbol":"transpile","correct":"import { transpile } from 'claude-code-win32'"},{"note":"Default export is not available from main entry. Use named import or import from /transpiler subpath.","wrong":"import transpile from 'claude-code-win32'","symbol":"transpile (default import)","correct":"import transpile from 'claude-code-win32/transpiler'"},{"note":"Subpath export 'chain' provides low-level chain parsing and command processing functions.","wrong":"import { processCommand } from 'claude-code-win32'","symbol":"processCommand","correct":"import { processCommand } from 'claude-code-win32/chain'"},{"note":"Path translation utilities are in 'claude-code-win32/paths' subpath export.","wrong":"import { translatePath } from 'claude-code-win32'","symbol":"translatePath","correct":"import { translatePath } from 'claude-code-win32/paths'"},{"note":"The classifier (passthrough/rewrite/deny) is in its own subpath export.","wrong":"import { classifyCommand } from 'claude-code-win32'","symbol":"builtin classifyCommand","correct":"import { classifyCommand } from 'claude-code-win32/classifier'"},{"note":"The standalone hook binary is 'claude-code-win32-hook', not the package name. Requires node >=20.","wrong":"npx claude-code-win32","symbol":"claude-code-win32-hook binary","correct":"npx claude-code-win32-hook"}],"quickstart":{"code":"// Install plugin in Claude Code REPL\n// /plugin marketplace add hmennen90/claude-code-win32\n// /plugin install claude-code-win32@claude-code-win32\n// /reload-plugins\n\n// Or install from npm and use programmatically\nimport { transpile } from 'claude-code-win32';\n\n// Example: transpile a Bash command string for Windows\nconst bashCmd = `xdg-open \"https://example.com\" && echo done`;\nconst result = transpile(bashCmd, { preferPowerShell: true });\n\n/*\nresult.type: \"rewrite\" | \"deny\" | \"passthrough\"\nresult.command: the transformed PowerShell command (if rewrite)\nresult.hint: denial hint (if deny)\nresult.segments: per-command classification results\n*/\n\nconsole.log(result);\n// => {\n//   type: 'rewrite',\n//   command: 'Start-Process \"https://example.com\"; if ($?) { Write-Output \"done\" }',\n//   segments: [\n//     { command: 'xdg-open \"https://example.com\"', classification: 'rewrite', replacement: 'Start-Process \"https://example.com\"' },\n//     { command: 'echo done', classification: 'passthrough' }\n//   ]\n// }\n","lang":"typescript","description":"Shows how to import and use the transpile function to convert a Bash command with && chaining to PowerShell."},"warnings":[{"fix":"Update to v0.1.1 via /plugin update claude-code-win32@claude-code-win32 and /reload-plugins.","message":"v0.1.0 shipped a redundant hooks field in plugin.json causing 'Duplicate hooks file detected' error on /reload-plugins.","severity":"breaking","affected_versions":"0.1.0"},{"fix":"Use import() or dynamic import. If using CommonJS, set \"type\": \"module\" or use .mjs extension.","message":"Package is ESM-only. require() will throw an error.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Delete ~/.claude/plugins/claude-code-win32.state.json or wait 24h for auto-refresh.","message":"The plugin auto-detects PowerShell version and caches it for 24h under ~/.claude/plugins/claude-code-win32.state.json. If you install PS 7 after detection, the cached PS 5.1 may cause denial of &&/||.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Use absolute Windows paths (C:/...) or quote paths that should not be translated. Check segment classification output.","message":"MSYS path translation is boundary-aware but may incorrectly translate paths in edge cases like /c/ in the middle of a word (e.g., 'mac/classic').","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Only rely on the main 'transpile' export for stability. For subpath exports, pin exact version in package.json.","message":"The subpath exports are not documented in README as stable API; they may change in minor versions without notice.","severity":"deprecated","affected_versions":">=0.1.0"},{"fix":"Use icacls or Set-Acl in PowerShell. The denial hint will suggest the equivalent.","message":"chmod commands are denied instead of translated. On Windows, file permissions are managed via icacls, not chmod.","severity":"gotcha","affected_versions":">=0.1.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Update to v0.1.1 which removes the redundant hooks field.","cause":"v0.1.0 plugin.json included a hooks field alongside the auto-loaded hooks/hooks.json.","error":"ERROR [Bash tool]: Duplicate hooks file detected"},{"fix":"Use dynamic import(): async () => { const mod = await import('claude-code-win32'); }","cause":"Package is ESM-only; CommonJS require() is not supported.","error":"ERR_REQUIRE_ESM: require() of ES Module /path/to/node_modules/claude-code-win32/index.js from /path/to/app.js not supported."},{"fix":"Ensure Node >=20. Use the main export instead: import { transpile } from 'claude-code-win32'.","cause":"Subpath exports may not be resolved if the package is symlinked or in a monorepo with older Node versions.","error":"Error: Cannot find module 'claude-code-win32/paths'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}