Skip to content

Instantly share code, notes, and snippets.

@boneskull
Last active November 19, 2025 06:03
Show Gist options
  • Select an option

  • Save boneskull/d71604b8d5379195298028bc876418b9 to your computer and use it in GitHub Desktop.

Select an option

Save boneskull/d71604b8d5379195298028bc876418b9 to your computer and use it in GitHub Desktop.
Command for Cursor to execute Claude Code commands installed via Claude Code plugins

What is this?

This is a command that you can run in Cursor to execute commands installed via Claude Plugins.

Cursor doesn't have any direct support for Claude Code plugins, but this command provides a bridge between them.

Usage

Assuming you have some plugins installed:

  • Put this file in your project's .cursor/commands/, or globally in ~/.cursor/commands/.
  • Start a new chat in Cursor
  • Execute /claude-plugin list
  • Bask in the glory of this awful hack
description argument-hint
Execute a command from any installed Claude plugin
<plugin-name> <command-name> [command-args...]

/claude-plugin Command Launcher

Execute commands from installed Claude plugins that aren't directly accessible in Cursor.

Usage

/claude-plugin <plugin-name> <command-name> [command-arguments...]

How It Works

  1. Locate the plugin: Read ~/.claude/claude-plugins/installed_plugins.json to find the plugin's install path
  2. Find the command: Look for the command file at {installPath}/commands/{command-name}.md
  3. Execute: Load and follow the command's instructions with any additional arguments

Examples

# Run the brainstorm command from superpowers plugin
/claude-plugin superpowers brainstorm "How can we improve error handling?"

# Run the resolve-review-comments command from github plugin
/claude-plugin github resolve-review-comments 123

# Run the hello command from example-plugin
/claude-plugin example-plugin hello

Implementation

When this command is invoked:

  1. Parse arguments:

    • First argument: plugin name (e.g., "superpowers", "github")
    • Second argument: command name (e.g., "brainstorm", "resolve-review-comments")
    • Remaining arguments: pass through to the command
  2. Load plugin registry:

    cat ~/.claude/claude-plugins/installed_plugins.json
    • Extract the installPath for the requested plugin
    • Handle plugin name formats (e.g., "superpowers@superpowers-marketplace")
  3. Locate command file:

    • Construct path: {installPath}/commands/{command-name}.md
    • Verify file exists
  4. Load and execute:

    • Read the command file
    • Pass any remaining arguments to the command
    • Follow the command's instructions exactly

Error Handling

If plugin not found:

❌ Plugin '{plugin-name}' not installed.
Available plugins: {list from installed_plugins.json}

If command not found:

❌ Command '{command-name}' not found in plugin '{plugin-name}'.
Available commands: {list files in installPath/commands/}

If no arguments provided:

❌ Usage: /claude-plugin <plugin-name> <command-name> [args...]

To list installed plugins, use:
  /claude-plugin list

To list commands in a plugin, use:
  /claude-plugin <plugin-name> list

Special Commands

List all plugins

/claude-plugin list

Shows all installed plugins with their versions.

List commands in a plugin

/claude-plugin <plugin-name> list

Shows all available commands in the specified plugin.

Instructions for Claude

When this command is executed:

  1. Extract arguments from the command invocation

  2. Read the installed plugins file:

    cat ~/.claude/claude-plugins/installed_plugins.json
  3. Find the plugin:

    • Look for exact match in the plugins object keys
    • Keys are formatted as: {plugin-name}@{marketplace-name}
    • Extract the installPath field
  4. Handle special commands:

    • If command is "list" and no plugin specified: list all installed plugins
    • If command is "list" and plugin specified: list commands in that plugin
  5. Construct command file path:

    {installPath}/commands/{command-name}.md
    
  6. Read the command file:

    cat {installPath}/commands/{command-name}.md
  7. Execute the command:

    • Load the command content
    • Pass through any additional arguments
    • Follow the command's instructions exactly as if it were invoked directly

Example Execution Flow

User runs:

/claude-plugin github resolve-review-comments 123

Claude executes:

# 1. Load plugin registry
cat ~/.claude/claude-plugins/installed_plugins.json
# Find: "github@boneskull-plugins" with installPath: "~/.claude/claude-plugins/marketplaces/boneskull-plugins/claude-plugins/github"

# 2. Construct command path
# Path: ~/.claude/claude-plugins/marketplaces/boneskull-plugins/claude-plugins/github/commands/resolve-review-comments.md

# 3. Load command
cat ~/.claude/claude-plugins/marketplaces/boneskull-plugins/claude-plugins/github/commands/resolve-review-comments.md

# 4. Execute with argument "123"
# Follow the command's instructions with PR_NUMBER=123

Notes

  • Plugin names in installed_plugins.json include marketplace suffix (e.g., "superpowers@superpowers-marketplace")
  • Match plugin names with or without the marketplace suffix
  • Command names are the filename without .md extension
  • All additional arguments after the command name are passed to the target command
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment