Skip to content

fix(installer): honor CODEDB_NO_HOOKS + removal marker so hook removal sticks (#658) - #669

Merged
justrach merged 1 commit into
release/0.2.5828from
fix/658-installer-reregister
Jul 9, 2026
Merged

fix(installer): honor CODEDB_NO_HOOKS + removal marker so hook removal sticks (#658)#669
justrach merged 1 commit into
release/0.2.5828from
fix/658-installer-reregister

Conversation

@justrach

@justrach justrach commented Jul 9, 2026

Copy link
Copy Markdown
Owner

The remaining half of #658 (problem c): the installer silently re-added the codedb-block-legacy.sh PreToolUse hook on every run, even after the user removed it (reporter removed it 3×). The scope+redirect half was #663; this makes removal stick.

  • CODEDB_NO_HOOKS=1 at install time skips the PreToolUse hook merge entirely (SessionStart warmup unchanged), and writes a ~/.codedb/no-hooks marker so the opt-out persists across future installs without re-passing the env var.
  • If the marker exists, the merge is skipped regardless of env.
  • Default behavior (no env, no marker) is unchanged.

Verified: installer Python heredoc compiles; bash -n OK; simulated all three scenarios (opt-out creates marker + skips; marker-present later run still skips; baseline unchanged). Produced by a Sonnet agent; independently re-verified.

🤖 Generated with Claude Code

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3eb1a0dccc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread install/install.sh
Comment on lines +352 to +353
if not skip_pretooluse:
merge_hook("PreToolUse", {"matcher": "Bash", "hooks": [{"type": "command", "command": "$HOME/.claude/hooks/codedb-block-legacy.sh"}]})

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Remove existing hook when opt-out is active

When CODEDB_NO_HOOKS=1 is used on a machine that already has the codedb PreToolUse entry in ~/.claude/settings.json, this branch only skips calling merge_hook; it never deletes the existing entry, and the generated hook script only checks the runtime env var, not the new ~/.codedb/no-hooks marker. As a result, the install-time opt-out persists the marker but the legacy-tool blocker still runs in later Claude sessions that do not export CODEDB_NO_HOOKS, so existing users cannot actually disable the hook via the new installer path.

Useful? React with 👍 / 👎.

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

Benchmark Regression Report

Thresholds: 10.00% and 50,000 ns absolute delta

NOISE means the percentage threshold was exceeded, but the absolute delta was too small to fail CI.

Tool Base (ns) Head (ns) Delta Abs Delta (ns) Status
codedb_bundle 67615 68281 +0.98% +666 OK
codedb_changes 12077 12818 +6.14% +741 OK
codedb_context 310652 312455 +0.58% +1803 OK
codedb_deps 345 383 +11.01% +38 NOISE
codedb_edit 41074 41828 +1.84% +754 OK
codedb_find 3064 3051 -0.42% -13 OK
codedb_hot 27910 29132 +4.38% +1222 OK
codedb_outline 18456 17607 -4.60% -849 OK
codedb_read 14280 15023 +5.20% +743 OK
codedb_search 65187 69004 +5.86% +3817 OK
codedb_snapshot 75939 74911 -1.35% -1028 OK
codedb_status 11708 11285 -3.61% -423 OK
codedb_symbol 56971 54804 -3.80% -2167 OK
codedb_tree 23119 21869 -5.41% -1250 OK
codedb_word 12825 12705 -0.94% -120 OK

@justrach
justrach merged commit 7f4fc0f into release/0.2.5828 Jul 9, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant