Personal_AI_Infrastructure icon indicating copy to clipboard operation
Personal_AI_Infrastructure copied to clipboard

fresh install on windows, not working , Hooks Not Running

Open Stou-dev opened this issue 1 month ago • 0 comments

SessionStart hooks are not executing automatically when starting a new Claude session on Windows, despite being correctly configured in settings.json.

Also, docs/QUICKSTART.md file doesnt exist !

Expected Behavior

When running claude to start a new session, the SessionStart hooks should execute automatically, specifically:

  1. load-core-context.ts should run
  2. CORE skill context should be injected via system-reminder
  3. User should see behavioral changes (response format, personality settings)

Actual Behavior

  • Starting a new Claude session shows no indication that hooks ran
  • CORE context is not loaded automatically
  • No visible or behavioral changes

Root Cause

Two issues with Windows hook configuration:

Issue 1: Unix-style path format

The setup script generated Unix-style paths that don't work on Windows: "command": "/c/Users/username/.claude/Hooks/load-core-context.ts"

This is Git Bash / WSL path notation (/c/...).

Issue 2: Missing interpreter on Windows

TypeScript files can't execute directly on Windows. The shebang #!/usr/bin/env bun only works on Unix systems.

Hook commands generated by setup: "command": "/c/Users/username/.claude/Hooks/load-core-context.ts"

Manual workaround that works: "command": "bun C:/Users/username/.claude/Hooks/load-core-context.ts"

Evidence

  1. Hook Works When Run Manually

PS C:\Users\username.claude\Hooks> bun run load-core-context.ts ✅ Read 10381 characters from CORE SKILL.md ✅ CORE context injected into session

  1. Generated settings.json Configuration

{ "hooks": { "SessionStart": [ { "hooks": [ { "type": "command", "command": "/c/Users/username/.claude/Hooks/load-core-context.ts" } ] } ] } }

  1. All Hooks Affected

All hook paths generated by setup wizard use the same Unix-style format:

  • /c/Users/username/.claude/Hooks/load-core-context.ts
  • /c/Users/username/.claude/Hooks/initialize-session.ts
  • /c/Users/username/.claude/Hooks/capture-all-events.ts
  • etc.

Steps to Reproduce

  1. Install PAI on Windows via bootstrap script
  2. Check .claude/settings.json
  3. Observe Unix-style paths (/c/...) in hook commands
  4. Run claude to start new session
  5. Observe: hooks don't execute

Additional Context

Hook Script Header

#!/usr/bin/env bun

import { readFileSync, existsSync } from 'fs'; import { join } from 'path'; import { PAI_DIR, SKILLS_DIR } from './lib/pai-paths';

Questions

  1. Does Claude Code respect shebangs on Windows?
  2. Should hooks be invoked as bun run
  3. Are there any logs showing hook execution failures?
  4. Should the setup script detect Windows and use proper path format?

Thank you!

Stou-dev avatar Dec 28 '25 23:12 Stou-dev