The installer writes codedb-block-legacy.sh into ~/.claude/hooks/ and merges it into ~/.claude/settings.json PreToolUse on every run (install/install.sh, the merge_hook("PreToolUse", ...) call around L299).
Problems:
- The hook hard-blocks (
exit 2) grep/rg/cat/head/tail/sed/awk/find unconditionally whenever the codedb binary exists — including outside git repos and on files codedb has never indexed.
- It fires before Claude Code's permission evaluation, so it overrides the user's own
permissions.allow.
- Removing the settings entry does not stick — any reinstall/update run silently re-adds it. Removed it three times now.
Suggestions (either would fix it):
- Scope the hook: only block when the cwd's repo toplevel is actually codedb-indexed (
~/.codedb/projects/*/project.txt) and every path argument resolves inside that repo. I run a scoped variant locally and it works well — happy to PR it.
- And/or respect an opt-out: skip the hook merge when e.g.
CODEDB_NO_HOOKS=1, or do not re-add an entry the user has removed.
Related: #344 documented the hook setup, but the unconditional blocking + re-registration behavior is not covered there.
The installer writes
codedb-block-legacy.shinto~/.claude/hooks/and merges it into~/.claude/settings.jsonPreToolUseon every run (install/install.sh, themerge_hook("PreToolUse", ...)call around L299).Problems:
exit 2)grep/rg/cat/head/tail/sed/awk/findunconditionally whenever thecodedbbinary exists — including outside git repos and on files codedb has never indexed.permissions.allow.Suggestions (either would fix it):
~/.codedb/projects/*/project.txt) and every path argument resolves inside that repo. I run a scoped variant locally and it works well — happy to PR it.CODEDB_NO_HOOKS=1, or do not re-add an entry the user has removed.Related: #344 documented the hook setup, but the unconditional blocking + re-registration behavior is not covered there.