Idiomatic patterns for Claude Code
Pattern submitted successfully! Redirecting...
📁
Drop your pattern file here
CLAUDE.md, agent.yaml, hook.sh, prompt.txt, or command.md
— or —
Paste content manually

📋 Format Templates

Agent Format (Subagent)

Location: ~/.claude/agents/*.md

---
name: your-agent-name
description: When this agent should be used
tools: "*"  # or "Read, Write, Bash"
---

You are a specialized agent for...
Instructions go here...

Command Format (Slash Command)

Location: ~/.claude/commands/*.md

# Description of what this command does
npm install && npm run dev

# Can include multiple commands
docker-compose up -d

Hook Format (Event Hook)

Location: Inside ~/.claude/settings.json

⚠️ Extract just the hook configuration object:

{
  "matcher": "Bash",
  "hooks": [
    {
      "type": "command",
      "command": "#!/bin/bash\necho \"Hook running\"\nexit 0"
    }
  ]
}

CLAUDE.md Format

Location: Project root CLAUDE.md

# Project Name

## Tech Stack
- Framework: Next.js
- Database: PostgreSQL

## Commands
```bash
npm run dev  # Start development
npm test     # Run tests
```

## Guidelines
- Follow TypeScript best practices
- Use functional components

Prompt Format

Instructional methodology for Claude

When implementing authentication:
1. Start with the user model
2. Set up session management
3. Implement OAuth providers
4. Add rate limiting
5. Test security thoroughly

🎭 Output Style Format

Complete personality replacement for Claude

---
name: Grumpy Senior Developer
description: Battle-hardened dev who's seen it all
---

# Grumpy Senior Developer

You are a brilliant but perpetually annoyed senior developer.

## Core Behaviors
- Complain about modern frameworks
- Reference "the good old days"
- Be helpful but act inconvenienced

## Communication Style
- Start with sighs or grumbles
- Use phrases like "Back in my day..."

📊 Status Line Format

⚠️ SECURITY WARNING: Executes shell commands!

#!/bin/bash
# Simple git status line
BRANCH=$(git branch --show-current 2>/dev/null || echo "no-git")
CHANGES=$(git status --porcelain 2>/dev/null | wc -l)
TIME=$(date +%H:%M)
echo "[$TIME] $BRANCH${CHANGES:+ *$CHANGES}"
Manual Pattern Entry
CLAUDE.md
Project instructions
Agent
Task agents
Prompt
Effective prompts
Hook
Shell hooks
Command
CLI commands
🎭 Style
Personality replacement
📊 Status Line
⚠️ Terminal status (shell)
0 / 10240 characters
Complete Pattern Details
This is what will be stored as your pattern
A clear, descriptive title for your pattern
Explain the problem this pattern solves and when to use it
Add 1-5 tags to help others find your pattern (required)