Summary
Hook install/status/uninstall paths read the entire pre-commit hook file to check whether it is managed by cdidx.
Evidence
src/CodeIndex/Cli/HookCommandRunner.cs calls File.ReadAllText(ioHookPath) and IsManagedHook(File.ReadAllText(ioHookPath)) when checking existing hooks. There is no file-size cap before reading the hook into memory.
Impact
A large pre-existing hook can make hook commands allocate excessive memory or take longer than necessary, even though cdidx only needs to detect a small managed marker.
Suggested fix
Check length before reading, or stream a bounded prefix/suffix sufficient to detect the managed marker. Keep behavior distinct from the separate atomic hook swap issue.
Summary
Hook install/status/uninstall paths read the entire pre-commit hook file to check whether it is managed by cdidx.
Evidence
src/CodeIndex/Cli/HookCommandRunner.cscallsFile.ReadAllText(ioHookPath)andIsManagedHook(File.ReadAllText(ioHookPath))when checking existing hooks. There is no file-size cap before reading the hook into memory.Impact
A large pre-existing hook can make hook commands allocate excessive memory or take longer than necessary, even though cdidx only needs to detect a small managed marker.
Suggested fix
Check length before reading, or stream a bounded prefix/suffix sufficient to detect the managed marker. Keep behavior distinct from the separate atomic hook swap issue.