Windows: MemoryHealthCheck reports installed memory hooks as unregistered (installer backslash-escapes the config root)

Abierto Apto para principiantes
#3,020 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 5 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
72/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
bash, bun, typescript

Línea de trabajo

Comienza con skills/LifeOS/Tools/InstallEngine.ts y examina rewriteHomeRoot, shellQuoteRoot y rewriteHookRoots; después compara su salida con hookCommandScript en LIFEOS/TOOLS/LifeosUpgrade.ts. Verifica que las rutas raíz de Windows se normalicen con barras oblicuas y que los hooks existentes se redirijan al actualizarlos. Usa la sonda del issue y MemoryHealthCheck.ts para confirmar que los comandos se analizan y se informa de ellos como registrados; trata por separado la extracción de Report.ts attest y los problemas de detección de PATH.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Version

LifeOS 8.761.0 · attestation: unattested (could not extract v8.761.0: tar (child): Cannot connect to C: resolve failed

gzip: stdin: unexpected end of file
tar: Child returned status 128
tar: Error is not recoverable: exiting now)

What is broken

On Windows, MemoryHealthCheck reports MemoryTurnStart, MemoryReviewFire and MemoryHealthGate as "not registered in any settings layer" even though the installer registered them and they run. The installer's rewriteHookRoots → shellQuoteRoot (unquoted position) backslash-escapes every backslash in a Windows config root, so each hook command is written with doubled backslashes: <DRIVE>:\\<HOMEDIR>\\.claude/hooks/<name>.hook.ts. Bash runs that correctly, but hookCommandScript in LIFEOS/TOOLS/LifeosUpgrade.ts treats any backslash as making a command opaque and returns null, so every installer-written hook is invisible to the registration check (and to anything else that attests hooks through that parser). The four memory-write bugs on the same install are already covered by #2568 (closed, fix pending release) and are not refiled here. Separately, Report.ts attest cannot extract the release on Windows: tar reads the drive letter in the archive path as a remote host ("Cannot connect to C: resolve failed"), and collect reports bun and git as "not found" although both are on PATH.

Where (file:line)

skills/LifeOS/Tools/InstallEngine.ts:1322

Repro on a clean tree
1. Install LifeOS 8.761.0 on Windows 11 x64 under Claude Code (Git Bash, bun 1.4.5), default config root (`.claude` in the user profile).
2. Open `settings.json` in the config root: every LifeOS hook command is the config root with doubled backslashes, then `/hooks/<name>.hook.ts`.
3. Run `MemoryHealthCheck.ts`: it warns `settings-hook-absent` for all three memory hooks.
4. Probe (captured below): render `$HOME/.claude/hooks/MemoryTurnStart.hook.ts` through the installer's own `rewriteHookRoots` with the Windows config root, run the result with `bash -c` (exit 0: the hook works), then pass the same string to `hookCommandScript`, which returns `null`. The probe exits 1.
5. Workaround that turns the check green: rewrite each command's root to forward slashes (`<DRIVE>:/<HOMEDIR>/.claude/hooks/...`). Git Bash runs it identically and `hookCommandScript` returns the script path.
Negative control

Probe: bun C:~/AppData/Local/Temp/claude/978c4f609d2e0d95/745f923b-81b5-41a9-a4f1-42748d93b935/scratchpad/probe/hookroot-probe.ts · exit 1 · captured 2026-11-28T20:10:35.661Z

Red looks like: hookCommandScript -> null

installer-rendered command: C:\\Users\\<user>\\.claude/hooks/MemoryTurnStart.hook.ts
runs under bash: exit 0
hookCommandScript -> null
Suggested fix

Smallest fix, at the producer: on win32, convert the config root to forward slashes before shellQuoteRoot quotes it (in rewriteHomeRoot), e.g. const r = process.platform === "win32" ? root.split(sep).join("/") : root. A drive path with forward slashes is valid for Git Bash, cmd and PowerShell, contains no backslash, and hookCommandScript parses it. POSIX output is unchanged. repointHookRoots could apply the same normalisation so existing Windows installs heal on the next update. Relaxing hookCommandScript's backslash rule instead is not recommended; it exists for quote-boundary safety.

Environment
  • OS: Windows (x64)
  • Harness: claude-code
  • bun: not found · git: not found
  • Doctor broken: codex, interceptor, cloudflare, imagemagick, ffmpeg, ytdlp, fabric
Lenguaje dominante
TypeScript
Estrellas
20k
Forks
2.5k
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de danielmiessler/LifeOS

Todos los issues de danielmiessler/LifeOS

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.