Skip to content

BUG: Plugin commands clobber Claude Code built-ins by registering at root namespace instead of /posthog:* #23

@njm-pikl

Description

@njm-pikl

Summary

The PostHog plugin registers all 13 of its slash commands at the root namespace (e.g. /insights, /errors, /search) rather than under a plugin-scoped prefix (e.g. /posthog:insights). This shadows Claude Code's built-in commands and any other plugin command sharing the same name.

Reproduction

  1. Install the PostHog plugin in Claude Code via the official marketplace
  2. Type /insights in the prompt
  3. The PostHog command fires instead of Claude Code's built-in /insights

Affected commands

All 13 files in commands/ register top-level slash commands. Several are very likely to collide with Claude Code built-ins or other plugins:

  • /insights — collides with Claude Code's built-in
  • /search — collides with Claude Code's built-in
  • /docs — collides with multiple plugins
  • /logs, /query — generic enough to collide with anything

Full list: actions, dashboards, docs, errors, experiments, flags, insights, llm-analytics, logs, query, search, surveys, workspace.

Root cause

Each command file declares an unprefixed name: in its frontmatter. Example from commands/insights.md:

https://github.com/PostHog/ai-plugin/blob/main/commands/insights.md

---                                                                                                                                                                                                                 
name: insights
description: Query PostHog analytics and insights
argument-hint: [query]                                                                                                                                                                                                
---

There's no posthog: prefix, so Claude Code registers the command at root namespace.

Convention

Comparable plugins have installed namespaces under the plugin name:

  • superpowers:brainstorming, superpowers:executing-plans
  • vercel-plugin:deploy, vercel-plugin:env
  • sentry:getIssues, sentry:seer
  • figma:figma-use, figma:figma-implement-design

PostHog is the outlier.

Suggested fix

Rename each command's name: field (or the file itself) to be plugin-scoped:

  ---                                                                                                                                                                                                                   
  name: posthog:insights              
  description: Query PostHog analytics and insights                                                                                                                                                                     
  argument-hint: [query]                                                                                                                                                                                              
  ---                                                                                                                                                                                                                   
         

This stops the clobber immediately and follows the marketplace convention. Users who want quick access can still alias /insights/posthog:insights in their own settings.

Minor unrelated bug

Every command file has a duplicated bare name: line outside the frontmatter — likely an artifact of scripts/generate-gemini-commands.sh. The awk filter (/^name:/ && !printed { printed=1; next }) tries to strip it from the Gemini output but the source .md still ships it.

Example:

  ---                                                                                                                                                                                                                 
  name: insights                                 
  description: Query PostHog analytics and insights                                                                                                                                                                   
  argument-hint: [query]                                                                                                                                                                                                
  ---
  name: insights              ← duplicated, should be removed                                                                                                                                                           
                                                                                                                                                                                                                        
  # Insights                                     
  ...        

Worth cleaning up while you're touching these files.

Environment

  • Claude Code v2.1.104
  • PostHog plugin v1.0.3 from claude-plugins-official marketplace
  • macOS 26.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions