Skip to content

post-git-ops.sh hook fallback build path references nonexistent src/cli.js #1979

Description

@carlos-alm

Bug

.claude/hooks/post-git-ops.sh (PostToolUse hook for Bash git operations like rebase/merge/pull, triggers a full codegraph rebuild) has the same broken fallback build path as update-graph.sh (issue #1836):

if command -v codegraph &>/dev/null; then
  codegraph build "$PROJECT_DIR" -d "$DB_PATH" --no-incremental 2>/dev/null && BUILD_OK=1 || true
else
  node "${CLAUDE_PROJECT_DIR:-$PROJECT_DIR}/src/cli.js" build "$PROJECT_DIR" -d "$DB_PATH" --no-incremental 2>/dev/null && BUILD_OK=1 || true
fi

src/cli.js has never existed in this repo — the CLI entry point is TypeScript at src/cli.ts, compiled to dist/cli.js (see package.json "bin": { "codegraph": "./dist/cli.js" }). The else branch (hit when the codegraph binary isn't on PATH) silently fails (stderr redirected to /dev/null), so BUILD_OK stays 0 and the full rebuild after a rebase/merge/pull never happens for contributors without a global codegraph install.

Suggested fix

Change src/cli.js to dist/cli.js in the fallback branch, mirroring the fix for #1836.

Found while working on

Issue #1836 (update-graph.sh fallback build path) — noticed the identical bug pattern duplicated in this second hook while fixing the first; out of scope for that issue so filing separately per repo scope-discipline convention.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions