[FEATURE] Automatic prompt pattern detection with skill suggestions
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
When using Claude Code regularly, I often find myself typing similar prompts for recurring tasks. Examples include:
- "Run tests and fix any failures"
- "Review this file for security issues"
- "Add error handling to this function"
- "Create a PR with conventional commit format"
Currently, there's no way for Claude Code to recognize these patterns and suggest turning them into reusable skills. Users must manually identify repetitive workflows and create skills themselves, which means many optimization opportunities are missed.
Proposed Solution
Add an optional feature that:
- Tracks prompt patterns across sessions (with user opt-in for privacy)
- Detects repetitive prompts using similarity analysis (semantic or keyword-based)
- Suggests skill creation when a pattern threshold is met (e.g., "You've run similar prompts 5 times this week. Would you like to create a skill?")
- Auto-generates skill drafts based on the detected pattern, which users can review and customize before saving
Proposed UX flow:
Claude: I noticed you frequently ask me to "run tests and fix type errors." Would you like to create a skill for this? (Y/n)
User: y
Claude: Created skill at .claude/commands/fix-tests.md You can now run this with /fix-tests
Describe alternatives you've considered
Alternative Solutions
- Manual skill creation: Works but requires users to proactively identify patterns
- Shell history analysis: External tooling could parse history, but lacks semantic understanding
- Session-only suggestions: Detecting patterns within a single session (less useful but simpler to implement and avoids persistence concerns)
Priority
Critical - Blocking my work
Feature Category
CLI commands and flags
Use Case Example
Persona: Sarah, a senior engineer who uses Claude Code daily for code reviews
Current experience (without pattern detection):
Over the past two weeks, Sarah has typed variations of the same prompt dozens of times:
Week 1:
- "Review this file for security vulnerabilities and suggest fixes"
- "Check this code for security issues"
- "Look for security problems in the changes"
Week 2:
- "Review for security vulnerabilities"
- "Security review this file please"
- "Check for OWASP top 10 issues in this code"
Sarah doesn't realize she's repeating herself. Each time, she types the prompt from scratch, sometimes forgetting to include important criteria she mentioned before (like "OWASP top 10").
Proposed experience (with pattern detection):
After the 5th similar prompt, Claude Code surfaces a suggestion:
┌─────────────────────────────────────────────────────────────────┐
│ 💡 Pattern detected │
│ │
│ You've made 5 similar requests for security reviews this week. │
│ │
│ Suggested skill: /security-review │
│ │
│ Draft prompt: │
│ "Review the specified code for security vulnerabilities, │
│ including OWASP top 10 issues. Suggest fixes with code │
│ examples." │
│ │
│ [Create skill] [Customize first] [Dismiss] [Don't suggest this] │
└─────────────────────────────────────────────────────────────────┘
Sarah selects "Customize first" and adds her preferred output format. Claude Code saves the skill:
# .claude/commands/security-review.md
---
description: Review code for security vulnerabilities
---
Review the current file or specified code for security vulnerabilities, including:
- OWASP top 10 issues (injection, XSS, CSRF, etc.)
- Authentication and authorization flaws
- Sensitive data exposure
- Security misconfigurations
For each issue found:
1. Explain the vulnerability
2. Rate severity (critical/high/medium/low)
3. Provide a fixed code example
Outcome:
From now on, Sarah types /security-review and gets consistent, comprehensive security analysis. She also shares the skill with her team by committing it to the repo.
Measurable benefits:
- Time saved: ~30 seconds per invocation × 20 reviews/week = 10 minutes/week
- Consistency: Every review now covers the same security criteria
- Team leverage: One person's workflow improvement benefits the whole team
Additional Context
- Privacy consideration: This feature should be opt-in with clear data handling policies. Pattern data could be stored locally only.
- Storage options: Could use ~/.claude/analytics/ or similar for local pattern storage
- Threshold configuration: Users should be able to configure sensitivity (e.g., suggest after 3 vs 10 similar prompts)
- Scope options: Support both project-level patterns (.claude/commands/) and user-level patterns (~/.claude/commands/)
This feature would reduce friction for power users and help newcomers discover the skill system organically.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗