awesome-claude-code

mcp
Security Audit
Pass
Health Pass
  • License — License: CC0-1.0
  • Description — Repository has a description
  • Active repo — Last push 0 days ago
  • Community trust — 15 GitHub stars
Code Pass
  • Code scan — Scanned 3 files during light audit, no dangerous patterns found
Permissions Pass
  • Permissions — No dangerous permissions requested

No AI report is available for this listing yet.

SUMMARY

A curated list of resources, tools, tips, and community projects for Claude Code — Anthropic's official CLI for Claude.

README.md

Awesome Claude Code Awesome GitHub stars PRs Welcome License: CC0-1.0 Links

A curated list of resources, tools, tips, and community projects for Claude Code — Anthropic's official agentic coding CLI.

Claude Code lives in your terminal, understands your codebase, and helps you code faster through natural language. Unlike simple code-completion tools, it can run commands, edit files across your project, manage git workflows, and orchestrate multi-step tasks autonomously.

What makes this list different: Every section includes copy-pasteable configs, working hook recipes, real templates, and practical examples — not just links.

Contributions welcome! Read the contribution guidelines before submitting a PR.


Contents


Official Resources

Getting Started

Quick Install

# Install via npm (requires Node.js 18+)
npm install -g @anthropic-ai/claude-code

# Verify installation
claude --version

# Start your first session
cd your-project && claude

# Auto-generate a CLAUDE.md for your project
claude /init

CLI Usage & Reference

Interactive Commands

Command Description
/help Show all available commands
/init Auto-generate a CLAUDE.md for the current project
/compact Compress conversation history to free context
/model <name> Switch model (opus, sonnet, haiku)
/plan Enter plan mode — explore first, code second
/review Review code changes
/commit Create a git commit with a smart message
/pr Create a GitHub pull request
/cost Show token usage and estimated cost
/clear Clear conversation history
/fast Toggle fast mode (same model, faster output)
/memory Edit CLAUDE.md memory files

CLI Flags

# One-shot query (non-interactive)
claude -p "What does the main function do?"

# Resume last conversation
claude --resume

# Resume specific session
claude --resume <session-id>

# List previous sessions
claude sessions list

# Use a specific model
claude --model opus
claude --model sonnet
claude --model haiku

# Headless mode (non-interactive, for scripts and CI)
claude -p "Run all tests and report results" --output-format json

# Stream output in headless mode
claude -p "Explain src/index.ts" --output-format stream-json

# Set max turns for autonomous operation
claude -p "Fix all lint errors" --max-turns 20

# Append system prompt
claude --system-prompt "Always respond in Spanish"

# Specify allowed tools
claude --allowedTools "Read,Write,Bash(git *)"

# Skip permissions (trusted projects only)
claude --dangerously-skip-permissions

Piping & Scripting Patterns

# Review a PR diff
gh pr diff 123 | claude -p "Review this PR for bugs and security issues"

# Explain test failures
npm test 2>&1 | claude -p "Why are these tests failing? Suggest fixes."

# Analyze logs
tail -500 /var/log/app.log | claude -p "Summarize errors and suggest fixes"

# Generate commit message from staged changes
git diff --staged | claude -p "Write a conventional commit message" --output-format text

# Multi-file analysis
find src -name "*.ts" | head -20 | xargs cat | claude -p "Find potential memory leaks"

# Chain with other tools
claude -p "Generate a SQL migration to add a users table" --output-format text | pbcopy

Session Management

# List recent sessions
claude sessions list

# Resume most recent session
claude --resume

# Resume specific session by ID
claude --resume abc123

# Continue with full context preserved
claude --continue

CLAUDE.md Templates

CLAUDE.md is the memory file Claude Code reads at session start. A good one dramatically improves output quality.

Ready-to-Use Templates

CLAUDE.md Best Practices

  • Keep it under 500 lines — Claude reads it every session, so conciseness matters.
  • Put the most important context (build commands, architecture) at the top.
  • Use tables for structured data (services, ports, API keys).
  • Include the commands Claude should know how to run.
  • Use nested CLAUDE.md files in subdirectories for package-specific context.
  • Update it after every significant change to your project.
  • Use comments (<!-- -->) to explain why, not just what.
  • Include known issues and "don't touch" warnings for work-in-progress areas.

CLAUDE.md Generator Prompt

Paste this into Claude Code to auto-generate a CLAUDE.md tailored to your project:

Analyze this project and generate a CLAUDE.md file. Include:
1. Project overview (name, stack, description)
2. All available commands in a table (build, test, lint, run)
3. Project structure as a tree
4. Code conventions you observe (naming, imports, patterns)
5. Environment variables from .env.example or config files
6. Known issues from TODO/FIXME comments

Read package.json, tsconfig.json, Makefile, Cargo.toml, pyproject.toml,
or whatever build config exists. Be specific — use actual values, not placeholders.

File Organization

project/
├── CLAUDE.md              # Root context — project-wide info
├── src/
│   ├── CLAUDE.md          # Source-specific conventions
│   ├── api/
│   │   └── CLAUDE.md      # API layer patterns and endpoints
│   └── components/
│       └── CLAUDE.md      # Component conventions, design system
├── .claude/
│   ├── settings.json      # Project-level Claude settings
│   └── commands/          # Custom slash commands
│       ├── review.md
│       └── deploy-check.md
└── tests/
    └── CLAUDE.md          # Testing conventions, fixtures

What to Put in CLAUDE.md

Section Example
Project overview "This is a Next.js 14 app with App Router"
Build/run commands npm run dev, npm test, npm run build
Architecture "We use the repository pattern with service layers"
Conventions "Use named exports, no default exports"
Common tasks "To add a new API route, create a file in src/app/api/"
Environment "Requires Node 20+, PostgreSQL 16"
Known issues "The auth module is being migrated, don't touch legacy/"

Configuration Tools

  • claude-config - Built-in /config command to manage settings interactively.
  • dotenv-vault - Sync environment variables across machines for consistent Claude Code behavior.

Settings Locations

Scope Path Use Case
Global ~/.claude/settings.json Personal defaults (permissions, model, hooks)
Global local ~/.claude/settings.local.json Machine-specific overrides (not synced)
Project .claude/settings.json Shared team settings (commit to repo)
Project local .claude/settings.local.json Personal project overrides (gitignored)

Example: Project Settings

// .claude/settings.json — commit this to your repo
{
  "permissions": {
    "allow": [
      "Bash(npm run *)",
      "Bash(npx vitest *)",
      "Bash(git *)",
      "Read",
      "Write",
      "Edit"
    ],
    "deny": [
      "Bash(rm -rf *)",
      "Bash(curl *)",
      "Bash(wget *)"
    ]
  }
}

Custom Slash Commands

Place .md files in .claude/commands/ to create project-specific commands. Use $ARGUMENTS to accept input.

Example: /project:review

<!-- .claude/commands/review.md -->
Review the changes in the current branch compared to main.
Focus on:
1. Security vulnerabilities
2. Performance regressions
3. Missing error handling
4. Test coverage gaps

Format as a markdown checklist with severity levels.

Example: /project:deploy-check

<!-- .claude/commands/deploy-check.md -->
Pre-deployment checklist:
1. Run all tests
2. Check for console.logs or debug statements
3. Verify environment variables are not hardcoded
4. Check for TODO/FIXME comments
5. Verify all API endpoints have error handling
6. Check bundle size hasn't increased significantly

Example: /project:doc

<!-- .claude/commands/doc.md -->
Generate documentation for $ARGUMENTS.
Include:
- Brief description of purpose
- Parameters with types and descriptions
- Return value
- Usage example
- Edge cases to be aware of

Write docs as JSDoc comments directly in the source file.

Example: /project:test

<!-- .claude/commands/test.md -->
Write comprehensive tests for $ARGUMENTS.
Include:
- Happy path tests
- Edge cases (empty input, null, undefined, boundary values)
- Error scenarios
- Integration points with mocked dependencies

Use the existing test patterns in this project.

Hooks

Hooks are shell commands that execute automatically in response to Claude Code events. Configure them in your settings JSON.

Hook Events Reference

Event Trigger Available Env Vars
PreToolUse Before any tool executes $CLAUDE_TOOL_NAME, $CLAUDE_FILE_PATH
PostToolUse After any tool executes $CLAUDE_TOOL_NAME, $CLAUDE_FILE_PATH, $CLAUDE_TOOL_OUTPUT
Notification When Claude sends a notification $CLAUDE_NOTIFICATION
Stop When Claude finishes a turn

Hook Configuration

// .claude/settings.json
{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "Bash",
        "command": "echo 'About to run a shell command'"
      }
    ],
    "PostToolUse": [
      {
        "matcher": "Write|Edit",
        "command": "eslint --fix \"$CLAUDE_FILE_PATH\" 2>/dev/null || true"
      }
    ],
    "Notification": [
      {
        "command": "terminal-notifier -message \"$CLAUDE_NOTIFICATION\" -title 'Claude Code'"
      }
    ],
    "Stop": [
      {
        "command": "say 'Claude is done'"
      }
    ]
  }
}

Community Hook Recipes

Auto-format on save (multi-language):

{
  "hooks": {
    "PostToolUse": [
      {
        "matcher": "Write|Edit",
        "command": "case \"$CLAUDE_FILE_PATH\" in *.py) black \"$CLAUDE_FILE_PATH\" 2>/dev/null;; *.ts|*.tsx|*.js|*.jsx) prettier --write \"$CLAUDE_FILE_PATH\" 2>/dev/null;; *.go) gofmt -w \"$CLAUDE_FILE_PATH\" 2>/dev/null;; *.rs) rustfmt \"$CLAUDE_FILE_PATH\" 2>/dev/null;; esac || true"
      }
    ]
  }
}

Desktop notifications (macOS):

{
  "hooks": {
    "Notification": [
      {
        "command": "osascript -e 'display notification \"'\"$CLAUDE_NOTIFICATION\"'\" with title \"Claude Code\"'"
      }
    ]
  }
}

Block dangerous commands:

{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "Bash",
        "command": "if echo \"$CLAUDE_TOOL_INPUT\" | grep -qE 'rm -rf /|DROP TABLE|format c:'; then echo 'BLOCKED: Dangerous command detected' >&2; exit 1; fi"
      }
    ]
  }
}

Auto-run tests after edits:

{
  "hooks": {
    "PostToolUse": [
      {
        "matcher": "Write|Edit",
        "command": "if echo \"$CLAUDE_FILE_PATH\" | grep -qE '\\.(test|spec)\\.(ts|js|tsx|jsx)$'; then npx vitest run \"$CLAUDE_FILE_PATH\" --reporter=dot 2>/dev/null || true; fi"
      }
    ]
  }
}

Status Line Customization

Customize what Claude Code shows in the status bar at the bottom of your terminal.

// ~/.claude/settings.json
{
  "statusLine": {
    "enabled": true,
    "items": ["model", "cost", "session"]
  }
}

MCP Servers

MCP (Model Context Protocol) servers extend Claude Code with external tools and data sources. Add them to .claude/settings.json or ~/.claude/settings.json.

MCP Configuration Example

// .claude/settings.json
{
  "mcpServers": {
    "github": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": {
        "GITHUB_TOKEN": "ghp_your_token_here"
      }
    },
    "postgres": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-postgres", "postgresql://localhost/mydb"]
    }
  }
}

Official / First-Party

Community MCP Servers

MCP Resources

Plugins

Extend Claude Code's capabilities with community-built plugins and integrations.

  • claude-code-router - Built-in model routing for cost optimization (use haiku for simple tasks, opus for complex ones).
  • claude-code-action - GitHub Action for running Claude Code in CI/CD pipelines.
  • Hermes Tweet - Xquik X/Twitter plugin with a Claude manifest and approval-gated actions.

Skills

Skills are reusable prompt templates that Claude Code can invoke. They can be shared across projects and teams.

Built-in Skills

Skill Trigger Description
/commit Git commit Smart commit message generation
/pr Pull request Create PR with title, description, test plan
/review Code review Review current changes
/init Initialize Generate CLAUDE.md for current project

Custom Skills

Create custom skills in .claude/commands/:

<!-- .claude/commands/migrate.md -->
Generate a database migration for $ARGUMENTS.
1. Check existing models and migrations for context
2. Create the migration file using the project's migration tool
3. Include both up and down migration logic
4. Add appropriate indexes for foreign keys

Subagents

Claude Code can spawn specialized subagents (via the Task tool) to handle parallel, isolated work. Subagents inherit project context but run in their own conversation.

How Subagents Work

Main Agent
├── Task (Explore subagent) → "Find all API endpoints"
├── Task (Bash subagent) → "Run the full test suite"
└── Task (General subagent) → "Research how auth middleware works"

Subagents are useful for:

  • Parallel research — explore multiple parts of a codebase simultaneously.
  • Isolated execution — run tests or builds without cluttering the main conversation.
  • Context protection — keep large tool outputs out of the main context window.

Subagent Types

Type Best For
Explore Codebase exploration, finding files and patterns
Bash Running commands, git operations
general-purpose Multi-step research and code analysis
Plan Designing implementation strategies

Multi-Agent Orchestration

Use the Claude Code SDK to orchestrate multiple Claude Code instances for complex workflows.

SDK Example: Parallel Code Review

import { Claude } from "@anthropic-ai/claude-code";

const claude = new Claude();

// Review different aspects in parallel
const [security, performance, tests] = await Promise.all([
  claude.sendMessage("Review src/ for security vulnerabilities", {
    options: { model: "sonnet" }
  }),
  claude.sendMessage("Find performance bottlenecks in src/api/", {
    options: { model: "sonnet" }
  }),
  claude.sendMessage("Check test coverage gaps in src/services/", {
    options: { model: "haiku" }
  }),
]);

console.log("Security:", security.text);
console.log("Performance:", performance.text);
console.log("Tests:", tests.text);

Headless Orchestration (Bash)

#!/bin/bash
# Run multiple Claude Code tasks in parallel

claude -p "Check for security issues in src/" --output-format json > /tmp/security.json &
claude -p "Find unused exports in src/" --output-format json > /tmp/unused.json &
claude -p "Identify slow database queries" --output-format json > /tmp/perf.json &

wait
echo "All reviews complete. Results in /tmp/*.json"

Agent Teams

For large projects, structure multiple Claude Code instances as a team with distinct roles.

Example: Feature Development Team

Role Model Responsibility
Architect Opus Design the approach, break into subtasks
Implementer Sonnet Write the code based on the architect's plan
Reviewer Sonnet Review the implementer's code for quality
Tester Haiku Write and run tests for the new code
# Step 1: Architect plans the approach
PLAN=$(claude -p "Plan how to add OAuth2 login. Output a numbered task list." \
  --model opus --output-format text)

# Step 2: Implementer writes code
claude -p "Implement this plan: $PLAN" --model sonnet

# Step 3: Reviewer checks the work
claude -p "Review all changes on this branch vs main" --model sonnet

# Step 4: Tester validates
claude -p "Write and run tests for the OAuth2 login feature" --model haiku

Workflows & Patterns

Plan Mode

Use plan mode for non-trivial tasks. It forces Claude to explore the codebase and design an approach before writing code.

> /plan Refactor the authentication module to use JWT instead of sessions

Plan mode is ideal for:

  • Architecture changes affecting multiple files.
  • Refactors where you want to review the approach first.
  • Unfamiliar codebases where exploration is needed.

Multi-Agent with Worktrees

Use git worktrees for parallel, isolated work:

> Work on the login page redesign in a worktree
> # Claude creates an isolated copy — your main branch stays clean

Test-Driven Development (TDD)

> Write a failing test for user registration with email validation.
> Now implement the minimum code to make the test pass.
> Refactor the implementation while keeping tests green.

Bug Investigation Pattern

> Read the error log below and trace the bug to its root cause.
> Don't fix it yet — just explain what's happening and which files are involved.

Then, once you understand the issue:

> Now fix the bug. Run the test suite after to confirm nothing else broke.

Code Migration Pattern

> Migrate all class components in src/components/ to functional components with hooks.
> Do them one at a time. After each migration, run the tests for that component.
> Stop if any test fails.

Effective Prompting Patterns

  • Be specific about scope: "Fix the null check in src/auth/login.ts:45" > "Fix the login bug".
  • Reference files directly: "Read package.json and update all outdated deps".
  • Chain tasks: "Run the tests, fix any failures, then run them again".
  • Set constraints: "Refactor this function but don't change the public API".
  • Ask for exploration first: "What files handle payment processing?" before "Refactor payments".
  • Set quality gates: "Run tests after every change. Stop if coverage drops below 80%".

Git Workflow

> /commit                    # Smart commit with conventional message
> Create a PR for this branch # Generates title, description, test plan

Automation & CI/CD

GitHub Action: Claude Code Review

# .github/workflows/claude-review.yml
name: Claude Code Review
on:
  pull_request:
    types: [opened, synchronize]

permissions:
  contents: read
  pull-requests: write

jobs:
  review:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0

      - uses: anthropics/claude-code-action@v1
        with:
          anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
          prompt: |
            Review this pull request. Focus on:
            1. Security vulnerabilities
            2. Performance regressions
            3. Missing error handling
            4. Test coverage
            Post your review as a PR comment.

GitHub Action: Auto-Fix Lint Errors

# .github/workflows/claude-fix.yml
name: Claude Auto-Fix
on:
  push:
    branches: [main]

jobs:
  fix:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - uses: anthropics/claude-code-action@v1
        with:
          anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
          prompt: "Run the linter. If there are errors, fix them and commit."
          allowed_tools: "Bash(npm run lint *),Edit,Write,Bash(git *)"

SDK Automation Example

import { Claude } from "@anthropic-ai/claude-code";

// Nightly code health check
const claude = new Claude();
const result = await claude.sendMessage(
  "Check for: unused dependencies, circular imports, and functions over 50 lines. " +
  "Output a JSON report.",
  { options: { outputFormat: "json", model: "haiku" } }
);
console.log(JSON.parse(result.text));

IDE Integrations

  • VS Code Extension - Official VS Code integration with inline diffs and chat panel.
  • JetBrains Plugin - Official IntelliJ/WebStorm/PyCharm integration.
  • Claude Code Desktop - Standalone desktop app with terminal integration.
  • Neovim Plugin (avante.nvim) - Neovim integration supporting Claude as a backend.
  • Cursor - AI-first code editor with Claude model support.
  • Zed Editor - High-performance editor with built-in Claude assistant.
  • Terminal-only - Claude Code works in any terminal — iTerm2, Alacritty, Warp, Kitty, WezTerm, tmux, etc.

Usage Monitors & Cost Management

Track Your Spending

# Check current session cost
# Inside Claude Code:
> /cost

# Set a spending limit in your environment
export ANTHROPIC_MAX_TOKENS=100000  # Limit per session

Cost Optimization Tips

  • Use /model haiku for simple tasks (code explanations, formatting, small fixes).
  • Use /model sonnet for everyday coding (default, best balance).
  • Use /model opus only for complex architecture and multi-file refactors.
  • Use /compact regularly to keep context small and reduce token usage.
  • Use headless mode (-p) for batch tasks to avoid interactive overhead.
  • Set --max-turns in automation to prevent runaway sessions.

Cost Monitoring Tools

  • Anthropic Console - Official usage dashboard and billing.
  • LLM Cost Calculator - Compare Claude Code costs with other AI coding tools.
  • ax - Local-first cost, skill, tool, and telemetry dashboard for Claude Code, Codex, OpenCode, Cursor, and Pi.
  • agenttrace - Inspect local Claude/Codex agent sessions for cost, tokens, latency, tool failures, and CI gates.

Security & Permissions

Permission System

Claude Code has a granular permission system to control what actions it can take:

// .claude/settings.json
{
  "permissions": {
    "allow": [
      "Read",
      "Write",
      "Edit",
      "Bash(npm run *)",
      "Bash(npx vitest *)",
      "Bash(git status)",
      "Bash(git diff *)",
      "Bash(git log *)",
      "Bash(git add *)",
      "Bash(git commit *)"
    ],
    "deny": [
      "Bash(rm -rf *)",
      "Bash(curl * | bash)",
      "Bash(wget *)",
      "Bash(git push --force *)",
      "Bash(git reset --hard *)",
      "Bash(chmod 777 *)"
    ]
  }
}

Safety Hook: Block Secrets in Commits

{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "Bash",
        "command": "if echo \"$CLAUDE_TOOL_INPUT\" | grep -qE 'git (add|commit)' && git diff --cached --name-only | grep -qE '\\.(env|pem|key)$'; then echo 'BLOCKED: Refusing to commit secret files' >&2; exit 1; fi"
      }
    ]
  }
}

Best Practices

  • Always use project-level .claude/settings.json for team-shared permissions.
  • Use deny lists for destructive commands (rm -rf, git push --force).
  • Use --dangerously-skip-permissions only in fully trusted, automated pipelines.
  • Review Claude's actions during the first few sessions before expanding permissions.
  • Use the PreToolUse hook to implement custom safety checks.

Community Projects

Open source projects built with or for Claude Code.

Tools & Extensions

  • claude-code-action - GitHub Action for running Claude Code in CI/CD workflows.
  • ClaudeMD - VS Code extension for editing and managing CLAUDE.md files.
  • claude-code-tmux - Run multiple Claude Code sessions in tmux panes.
  • claude-code-power-pack - Collection of slash commands, hooks, and CLAUDE.md templates.
  • mcpservers.org - Directory and registry of MCP servers.
  • mcp.run - Run MCP servers in a secure sandbox without local installation.
  • Smithery - Package registry for MCP servers with one-click install.
  • OpenAgentRelay - Expose a restricted local Claude Code or other agent command as a keyed trusted-LAN capability.

Frameworks & Libraries

  • MCP TypeScript SDK - Build custom MCP servers in TypeScript.
  • MCP Python SDK - Build custom MCP servers in Python.
  • FastMCP - High-level Python framework for building MCP servers quickly.
  • mcp-framework - TypeScript framework for building MCP servers with decorators.

Example Projects

Articles & Blog Posts

Videos & Tutorials

Know a great video tutorial? Submit a PR!

Community


Contributing

Contributions are welcome! Please read the contribution guidelines first.

We especially need:

  • Community projects — tools, extensions, and integrations you've built.
  • CLAUDE.md templates — for frameworks not yet covered.
  • Hook recipes — working examples that solve real problems.
  • Articles & tutorials — quality content about Claude Code workflows.

Maintainer

Erkan — GitHub: @erkcet

License

CC0

To the extent possible under law, the maintainer has waived all copyright and related rights to this work.


Star History

Star History Chart

Reviews (0)

No results found