Skip to content

Windows: Claude hook installer creates extensionless hook files causing OpenWith dialog in Cursor #929

Closed

Description

@bsahafian

Version

codebase-memory-mcp 0.8.1

Platform

Windows 10 x64

Install channel

GitHub release archive / install.sh / install.ps1

Binary variant

standard

What happened, and what did you expect?

Summary

On Windows, installing codebase-memory-mcp creates extensionless hook files under:

%USERPROFILE%\.claude\hooks

Example:

cbm-code-discovery-gate
cbm-session-reminder

These files are Bash scripts (#!/bin/bash) without any executable extension.

When Cursor starts a new Agent, it scans the Claude hooks directory.

When Cursor starts a new Agent, the Windows "How do you want to open this file?" dialog appears.

Selecting Cursor opens one of the hook files (for example cbm-session-reminder) in the editor.

Removing or renaming %USERPROFILE%\.claude\hooks immediately eliminates the issue.


Environment

  • OS: Windows 10 x64
  • Cursor: 3.10.17
  • codebase-memory-mcp: 0.8.1
  • Claude Code: Not installed / Not used

Steps to reproduce

  1. Install codebase-memory-mcp on Windows using the installer.
  2. Verify that the installer creates:
%USERPROFILE%\.claude\hooks\

containing extensionless Bash scripts.

  1. Open Cursor.
  2. Create a new Agent.

Expected behavior

If Claude Code is not installed or the platform is Windows:

  • do not install Bash hook files
  • or install Windows-compatible hooks (.cmd / .ps1)
  • or skip Claude hook installation entirely.

No OpenWith dialog should appear.


Actual behavior

Windows opens:

How do you want to open this file?

If Cursor is selected, the hook source file itself is opened in the editor.

For example:

  • cbm-code-discovery-gate
  • cbm-session-reminder

Suspected cause

The installer creates extensionless Bash hook files under %USERPROFILE%\.claude\hooks.

These files appear to trigger the OpenWith dialog during Cursor Agent startup on Windows.

I cannot say whether the underlying bug is in Cursor or in the installer, but the problem disappears as soon as the hook directory is removed or renamed.


Workaround

Renaming either of these fixes the issue immediately:

%USERPROFILE%\.claude

or

%USERPROFILE%\.claude\hooks

Since I do not use Claude Code, disabling the directory completely resolves the problem.


Suggestion

The Windows installer should detect the platform and either:

  • skip Claude hook installation,
  • generate Windows-native hook files,
  • or only install Claude hooks if Claude Code is actually installed.

Reproduction

  1. Install codebase-memory-mcp on Windows using the official installer.

  2. Ensure the installer creates hook files under:

    %USERPROFILE%.claude\hooks

    such as:

    • cbm-code-discovery-gate
    • cbm-session-reminder
  3. Open Cursor.

  4. Open any project.

  5. Click New Agent (or start a new Agent session).

  6. Windows immediately displays the "How do you want to open this file?" dialog.

  7. If "Cursor" is selected in the dialog, Cursor opens the hook file itself (for example cbm-session-reminder) instead of continuing normally.

  8. Rename either:

    %USERPROFILE%.claude

    or

    %USERPROFILE%.claude\hooks

  9. Restart Cursor.

  10. Create another new Agent.

  11. The OpenWith dialog no longer appears.

Logs


Diagnostics trajectory (memory / performance / leak issues)


Project scale (if relevant)

No response

Confirmations

  • I searched existing issues and this is not a duplicate.
  • My reproduction uses shareable code (a dummy snippet or a public OSS repository), not proprietary code.

Activity

  1. added
    windowsWindows-specific issues
    editor/integrationEditor compatibility and CLI integration
    ux/behaviorDisplay bugs, docs, adoption UX
    priority/highNeeds near-term maintainer attention; high-impact bug, regression, safety issue, or release blocker.
    on Jul 7, 2026
  2. DeusData commented on Jul 7, 2026

    @DeusData
    Owner

    Thanks for the Windows hook report. Triage: high-priority Windows/editor integration bug under #394/#395.

    Extensionless hook files causing an Open With dialog is a real install UX failure. The fix should keep Unix behavior unchanged while installing Windows-executable wrappers and covering the Windows hook path in smoke tests.

  3. added this to the 0.9.1-rc milestone on Jul 8, 2026
  4. DeusData commented on Jul 12, 2026

    @DeusData
    Owner

    Fixed on main by b1502bf (merged in da4c006, PR #1057), shipping in v0.9.1.

    On Windows, all three Claude hook scripts (cbm-code-discovery-gate, cbm-session-reminder, cbm-subagent-reminder) now install as .cmd files with native cmd syntax instead of extensionless bash shims — and the installer removes the old extensionless twins on upgrade, so re-running codebase-memory-mcp install (or update) after upgrading eliminates the Open-With dialog trigger even for existing installs. Unix behavior is byte-identical.

    Since you hit this through Cursor scanning the hooks dir without even using Claude Code: after upgrading, one codebase-memory-mcp install run should clear it. If the dialog still appears afterwards, check %USERPROFILE%\.claude\hooks for any remaining extensionless files and let me know what's in there — but the upgrade path is covered by a regression test, so I expect it clean. Thanks for the precise repro with the exact scan trigger.

  5. added a commit that references this issue on Jul 12, 2026
    b1502bf
  6. added 2 commits that reference this issue on Jul 15, 2026
    1a213b2
    9c38108
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingeditor/integrationEditor compatibility and CLI integrationpriority/highNeeds near-term maintainer attention; high-impact bug, regression, safety issue, or release blocker.ux/behaviorDisplay bugs, docs, adoption UXwindowsWindows-specific issues

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions