StopOrchestrator missing TranscriptParser module - Stop hooks fail on fresh install
Description
Performing a clean-slate install of PAI v2.3.0 on a fresh machine with Claude Code produces an error on every Stop hook:
Stop hook error: Failed with non-blocking status code: error: Cannot find module '../skills/CORE/Tools/TranscriptParser' from '/home/user/.claude/hooks/StopOrchestrator.hook.ts'
Root Cause
StopOrchestrator.hook.ts and its handlers import from a module that doesn't exist:
// StopOrchestrator.hook.ts:56
import { parseTranscript } from '../skills/CORE/Tools/TranscriptParser';
// handlers/voice.ts:14
import type { ParsedTranscript } from '../../skills/CORE/Tools/TranscriptParser';
// handlers/capture.ts:15
import type { ParsedTranscript, StructuredResponse } from '../../skills/CORE/Tools/TranscriptParser';
The directory skills/CORE/Tools/ exists but contains only:
FeatureRegistry.tsInference.tsSessionProgress.tsSkillSearch.ts
TranscriptParser.ts was never created or was accidentally omitted from the distribution.
Affected Files
hooks/StopOrchestrator.hook.tshooks/handlers/voice.tshooks/handlers/capture.tshooks/handlers/tab-state.tshooks/handlers/SystemIntegrity.ts
Environment
- PAI version: v2.3.0 (clean-slate install)
- Platform: Ubuntu 24.04 / WSL2
- Claude Code: Latest
Related Issues
This follows a pattern of phantom references in PAI:
- #362 - pai-history-system missing metadata-extraction.ts
- #353 - observability.ts library referenced but absent
- #377 - pai-hook-system pack missing observability.ts
Proposed Fix
Create skills/CORE/Tools/TranscriptParser.ts that exports:
parseTranscript(path: string): ParsedTranscriptParsedTranscriptinterfaceStructuredResponseinterface
I can submit a PR with the implementation.
Update: This is an Installation Bug, Not a Missing File
After further investigation, I discovered that TranscriptParser.ts does exist in the repo at:
Releases/v2.3/.claude/skills/CORE/Tools/TranscriptParser.ts
The actual bug: The AI-assisted installation method (recommended in README) does not copy this file to the user's machine.
I installed PAI on a fresh Ubuntu 24.04/WSL2 machine using the recommended method:
"Give this URL to your DA assistant and say 'Walk me through installing PAI and customize it for me.'"
The installation completed but TranscriptParser.ts was not present in ~/.claude/skills/CORE/Tools/, causing the Stop hook errors.
Root cause: The AI-assisted installation process doesn't copy all files from Releases/v2.3/.claude/ to the user's installation.
Workaround: Manually copy the file from the repo:
cp Releases/v2.3/.claude/skills/CORE/Tools/TranscriptParser.ts ~/.claude/skills/CORE/Tools/
The fix should be in the installation process/documentation, not adding a missing file.
Fix Deployed
This issue has been resolved in commit e75b18f.
Root Cause
TranscriptParser.ts was present in the Releases/v2.3 directory but was not included in any Pack. When users install via the Pack system (the recommended method), the file was missing, causing all Stop hooks to fail.
The affected files that import TranscriptParser:
StopOrchestrator.hook.tshandlers/voice.tshandlers/capture.tshandlers/tab-state.tshandlers/SystemIntegrity.ts
Fix
Added TranscriptParser.ts to the pai-hook-system pack at src/skills/CORE/Tools/TranscriptParser.ts. This is the correct location since:
- TranscriptParser is a hook utility (used only by Stop hooks)
- It depends on
hooks/lib/identity.tswhich is already in the hook-system pack
For Users Experiencing This Issue
Option 1: Re-install the hook-system pack
Pull the latest version and reinstall pai-hook-system.
Option 2: Manual fix Copy the TranscriptParser.ts file manually:
# From the release directory
cp ~/.claude/Releases/v2.3/.claude/skills/CORE/Tools/TranscriptParser.ts ~/.claude/skills/CORE/Tools/
Pattern Note
This is the fourth instance (#362, #353, #377, #417) of missing files in Pack distributions. We should add Pack validation to the release process to catch missing dependencies before release.