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

オープン 初心者向け
#3,020 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 5 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
72/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
bash, bun, typescript

調査の方向性

skills/LifeOS/Tools/InstallEngine.ts から始め、rewriteHomeRoot、shellQuoteRoot、rewriteHookRoots を調べ、その出力を LIFEOS/TOOLS/LifeosUpgrade.ts の hookCommandScript と比較します。Windows のルートがスラッシュ区切りに正規化され、更新時に既存のフックが新しい参照先へ向けられることを確認してください。issue のプローブと MemoryHealthCheck.ts を使用して、コマンドが解析され、登録済みとして報告されることを確認します。Report.ts attest の抽出と PATH 検出の問題は、それぞれ別に対応してください。

索引モデルが issue の本文から書いたものです。

説明

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
主要言語
TypeScript
スター
20k
フォーク
2.5k
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

danielmiessler/LifeOS のほかの issue

danielmiessler/LifeOS の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。