[FEATURE] Add rules support to Plugins

Open 💬 31 comments Opened Dec 16, 2025 by hhopkins95

Preflight Checklist

  • [x] I have searched existing requests and this feature hasn't been requested yet
  • [x] This is a single feature request (not multiple features)

Problem Statement

It would be nice to have context that is automatically loaded for plugins. A rules folder seems like a good solution

Proposed Solution

Any rules directory within an activated plugin will be treated similarly to .claude/rules project folders

Alternative Solutions

_No response_

Priority

Medium - Would be very helpful

Feature Category

Other

Use Case Example

_No response_

Additional Context

_No response_

View original on GitHub ↗

31 Comments

github-actions[bot] · 6 months ago

This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

knksmith57 · 5 months ago

+1 this would be super useful to us

ricardochaves · 5 months ago

+1
For distribution within the company, this is perfect, everything in one place.

vendeesign · 4 months ago

+1

chrissonntag · 4 months ago

+1

robertojosephernest · 4 months ago

+1

maxritter · 4 months ago

#1

serkan-ozal · 4 months ago

+1

GregoireGauriot · 4 months ago

+1

iauniverse · 4 months ago

+1

kubrickcode · 3 months ago

+1

bvallelunga · 3 months ago

+1

stefanasseg · 2 months ago

We absolutely need rules in CC Plugins so that we can get rid of our ugly install script that symlinks rules into ~/.claude/rules to distribute general rules that we have defined within our team. I can already package skills and agents and MCP servers and hooks in a plugin, so the only thing that's still missing is rules, and at that point we can finally properly distribute everything using plugins and get rid of all our custom distribution mechanisms we've built so far.

Thank you!

saadings · 2 months ago

+1

ekropotin · 2 months ago

We need this too

majaklajic · 2 months ago

+1

mxriverlynn · 2 months ago

please? 🙏🏻 🥹 i really need this for my plugin

Zamoar · 2 months ago

+1

juanpablo-santos · 2 months ago

rules support inside plugins would be super useful for us too

DaleAuto · 2 months ago

This feature is really useful. Any plan to release?

Yevhenii-Yatchenko · 2 months ago

I'd glad deliver rules to claude code via plugings.

Please consider supporting this.

ptrikutam · 2 months ago

+1 this would be incredibly useful for our team as well!

mxt-mischa · 1 month ago

This would be really useful for our organisation as well :)

zhddoge-ai · 1 month ago

+1

Rauf00 · 1 month ago

+1

bohorquezod · 1 month ago

Related issue with partial workaround: #39925

metda11 · 1 month ago

+1

eleonoradrykina · 24 days ago

+1 please

pkvillanueva · 23 days ago

+1

bragancalucas · 23 days ago

Any news related to this? Rules not being bundlable inside plugins is a huge bummer :(

jbarker-uwcu · 22 days ago

Our team needs this for context we want always present. E.g. a python-style-guide plugin to install with rules.

Workaround is using a SessionStart hook to copy it:

hooks/hooks.json

{
  "description": "Copies bundled rules into the user's rules dir on session start",
  "hooks": {
    "SessionStart": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "bash \"${CLAUDE_PLUGIN_ROOT}/hooks/copy-rules.sh\"",
            "timeout": 30
          }
        ]
      }
    ]
  }
}

hooks/copy-rules.sh

#!/usr/bin/env bash
set -euo pipefail

# Resolve the plugin root from the script's own location
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PLUGIN_ROOT="$(dirname "$SCRIPT_DIR")"
SRC="$PLUGIN_ROOT/rules"
DEST="$HOME/.claude/rules"

mkdir -p "$DEST"

# Namespace the copied files. Files already named after the plugin are copied verbatim so the prefix isn't doubled.
PLUGIN="python-style-guide"
if [ -d "$SRC" ]; then
  for f in "$SRC"/*.md; do
    [ -e "$f" ] || continue
    name="$(basename "$f")"
    case "$name" in
      "$PLUGIN"*) cp -f "$f" "$DEST/$name" ;;
      *)          cp -f "$f" "$DEST/$PLUGIN-$name" ;;
    esac
  done
fi

echo '{"continue": true, "suppressOutput": true}'