From Copycat
Analyze external Claude Code config repos to find useful patterns, rules, and techniques worth adopting into CCGM
How this command is triggered — by the user, by Claude, or both
Slash command
/copycat:copycat <github-url-or-local-path>This command is limited to the following tools:
The summary Claude sees in its command listing — used to decide when to auto-load this command
# /copycat - Analyze External Claude Config Repos Analyzes a Claude Code configuration repo (CLAUDE.md collections, dotfiles, modular config systems) and identifies patterns, rules, commands, and techniques worth incorporating into CCGM. Walks you through findings interactively. --- ## Input --- ## Phase 0: Parse Arguments and Acquire Repo Extract the target from arguments. Accepts: - **GitHub URL**: `https://github.com/owner/repo` or `owner/repo` shorthand - **Local path**: `/path/to/repo` or `~/path/to/repo` If no argument is provided, use AskUserQuestion to ask: > "What Claude ...
Analyzes a Claude Code configuration repo (CLAUDE.md collections, dotfiles, modular config systems) and identifies patterns, rules, commands, and techniques worth incorporating into CCGM. Walks you through findings interactively.
$ARGUMENTS
Extract the target from arguments. Accepts:
https://github.com/owner/repo or owner/repo shorthand/path/to/repo or ~/path/to/repoIf no argument is provided, use AskUserQuestion to ask:
"What Claude Code config repo should I analyze? Provide a GitHub URL (e.g.,
owner/repo) or a local path."
If GitHub URL or shorthand:
# Clone to a temp directory
TMPDIR=$(mktemp -d)
git clone --depth 1 "https://github.com/${OWNER_REPO}.git" "$TMPDIR/target-repo" 2>&1
TARGET="$TMPDIR/target-repo"
If local path:
TARGET="<provided-path>"
# Verify it exists
ls "$TARGET" >/dev/null 2>&1
Store the target path for all subsequent phases. Note the repo name for display purposes.
Map the target repo's structure. Run these in parallel using Bash:
# CLAUDE.md files (root and nested)
find "$TARGET" -name "CLAUDE.md" -o -name "claude.md" 2>/dev/null
# Rules files
find "$TARGET" -name "*.md" -path "*/rules/*" 2>/dev/null
find "$TARGET" -name "*.md" -path "*/.claude/rules/*" 2>/dev/null
# Command files
find "$TARGET" -name "*.md" -path "*/commands/*" 2>/dev/null
find "$TARGET" -name "*.md" -path "*/.claude/commands/*" 2>/dev/null
# Hook files
find "$TARGET" -name "*.py" -path "*/hooks/*" -o -name "*.sh" -path "*/hooks/*" -o -name "*.js" -path "*/hooks/*" 2>/dev/null
# Settings files
find "$TARGET" -name "settings.json" -o -name "settings.local.json" 2>/dev/null
# MCP config
find "$TARGET" -name "mcp.json" -o -name ".mcp.json" 2>/dev/null
# Any module manifests (if modular like CCGM)
find "$TARGET" -name "module.json" -o -name "manifest.json" 2>/dev/null
# README for context
cat "$TARGET/README.md" 2>/dev/null | head -200
# Repo structure overview
find "$TARGET" -maxdepth 3 -not -path "*/.git/*" -not -path "*/node_modules/*" | head -100
# Any install/setup scripts
find "$TARGET" -maxdepth 2 \( -name "install*" -o -name "setup*" -o -name "start*" -o -name "init*" \) -not -path "*/.git/*" 2>/dev/null
Read the current CCGM module list for comparison:
# List all CCGM modules
ls ~/code/ccgm/modules/ 2>/dev/null || ls modules/ 2>/dev/null
# List all CCGM rule files
find ~/.claude/rules/ -name "*.md" 2>/dev/null | sort
# List all CCGM commands
find ~/.claude/commands/ -name "*.md" 2>/dev/null | sort
Build a mental model of:
Launch analysis agents in parallel using the Agent tool. Set model to sonnet for all agents.
Each agent receives:
Read ALL rule files, CLAUDE.md files, and behavioral instruction files in the target repo.
For each rule/instruction found, extract:
For CCGM comparison, read the corresponding CCGM rule files when they exist to make an informed comparison. Do not guess - read the actual content.
Return a structured list sorted by recommendation (NEW first, then BETTER, then MERGE, then INTERESTING, then SKIP).
Read ALL command/skill files in the target repo.
For each command found, extract:
Return a structured list sorted by recommendation.
Analyze all hook files, settings configurations, and MCP server configs.
For hooks:
For settings:
For MCP:
Return findings with adoption recommendations.
Look at the target repo holistically for patterns CCGM could learn from:
Return a narrative analysis, not a list.
Once all agents return, compile findings into a ranked report.
Score each finding on two axes:
Sort findings into:
High Priority (Impact >= 4, any Effort): Items that would meaningfully improve CCGM. These are worth the effort regardless.
Quick Wins (Impact >= 2, Effort <= 2): Easy to adopt with clear benefit. Do these as a batch.
Worth Considering (Impact >= 3, Effort >= 3): Good ideas that need more thought or design work before adopting.
Reference Only (Impact <= 2 or SKIP/INTERESTING): Not worth acting on now, but good to know about.
Present findings to the user group by group, starting with High Priority.
For each group, present a summary table:
## High Priority Findings
| # | Topic | Source | Recommendation | Impact | Effort |
|---|-------|--------|----------------|--------|--------|
| 1 | {topic} | {file in target repo} | NEW | 5 | 2 |
| 2 | {topic} | {file in target repo} | BETTER | 4 | 1 |
Then for each finding, show:
After presenting each group, ask with AskUserQuestion:
"Which of these should I act on? (Enter numbers, 'all', 'none', or 'next' to see the next group)"
Options:
For each approved finding, create a GitHub issue in the CCGM repo:
gh issue create \
--title "copycat: {brief description of the improvement}" \
--body "$(cat <<'ISSUE_EOF'
## Source
Identified by `/copycat` analysis of `{target-repo-name}`.
## Finding
{Description of what the target repo does and why it's worth adopting}
## Current CCGM State
{What CCGM currently does in this area, or "No coverage"}
## Proposed Change
{Specific action: new module, edit to existing rule, new command, etc.}
## Source Reference
{Path to the relevant file in the target repo}
ISSUE_EOF
)"
After creating all issues, present a summary:
## Copycat Analysis Complete
**Source**: {target-repo-name} ({url-or-path})
**Findings**: {total count}
**Issues created**: {count} ({list issue numbers})
**Skipped**: {count}
### Created Issues
- #{number}: {title}
- #{number}: {title}
...
These issues are ready for implementation. Run them through the normal workflow
(branch, implement, PR, merge) or batch them with `/mawf`.
If a temp directory was created for cloning:
rm -rf "$TMPDIR"
Some repos are just one large CLAUDE.md. Treat it as a monolithic rules file - Agent 1 does the heavy lifting, other agents may have nothing to analyze. That's fine.
Not all repos follow .claude/ conventions. Adapt discovery to whatever structure exists. Common patterns:
.cursorrules or .windsurfrules files (Cursor/Windsurf config - still useful, different format)CLAUDE.md onlyprompts/ or instructions/ directoriesIf the repo has > 50 config files, limit Agent analysis to the 30 most recently modified files. Note the truncation in the output.
If analysis reveals nothing worth adopting, say so directly. Don't fabricate recommendations to fill space.
npx claudepluginhub lucasmccomb/ccgm --plugin copycat