Skip to content

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

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions