$ show anthropics/claude-code
This repository is the official open-source companion to Anthropic's Claude Codeβan agentic AI coding assistant that operates in the terminal. It is not the core Claude Code binary (distributed separately via npm/brew/install scripts), but rather the plugin ecosystem, example configurations, CI automation scripts, and infrastructure-as-code templates that extend and support the tool. The repo contains 13 first-party plugins (e.g., security-guidance, code-review, feature-dev, commit-commands, pr-review-toolkit, hookify, plugin-dev), each defining hooks, commands, agents, and skills that integrate with Claude Code's extensibility framework. It also provides production-grade Terraform modules for deploying a Claude Code Gateway on AWS (ECS Fargate + RDS + Bedrock) and GCP (Cloud Run + Cloud SQL + Vertex AI), along with enterprise MDM settings (macOS plist/mobileconfig, Windows ADMX, Intune scripts) and managed settings templates. A suite of GitHub Actions workflows handles automated issue triage, duplicate detection, lifecycle management, and code review, all using Claude Code itself as the automation engine. The repository is primarily a configuration and extension catalog rather than a standalone application; its value lies in demonstrating the plugin architecture and providing reusable patterns for AI-assisted development workflows.
The LLM identified 5 files worth highlighting for reuse:
A multi-layer agentic security review system that hooks into PreToolUse, PostToolUse, UserPromptSubmit, and Stop events. Key patterns: (1) Agentic race pattern: starts an expensive agentic review (Read/Grep/Glob) and a single-shot LLM fallback after a 180s delay, using a queue for winner; (2) File-locked atomic state: fcntl-locked read-modify-write state files for safe concurrent async hook access (Stop + PostToolUse race); (3) Adaptive thinking model detection: routes thinking config between legacy 'budget_tokens' and new 'adaptive' API per model family; (4) 3P provider routing: falls back to Agent SDK child CLI when Bedrock/Vertex/Foundry env vars are set; (5) Git baseline dedup: computes review sets and advances diff base past already-reviewed commits using stash create and reflog parsing. This is the most architecturally sophisticated component in the repo and demonstrates patterns reusable for any agentic code quality tool.
A reusable rule-based hook system that reads `.claude/hookify.*.local.md` files (YAML frontmatter + markdown body) and evaluates conditions to dynamically create PreToolUse, PostToolUse, Stop, or UserPromptSubmit hooks. Demonstrates a pattern of using localized markdown files for configuration instead of rigid JSON or YAML files, making it easy for users to add custom hooks without modifying plugin code. The config_loader.py companion handles robust frontmatter parsing. This pattern is applicable to any project needing user-extensible hook systems.
A comprehensive meta-toolkit for building Claude Code plugins, organized into skills (plugin-structure, command-development, hook-development, agent-development, skill-development, mcp-integration, plugin-settings) each with a lean SKILL.md (1500-2000 words), detailed references/, examples/, and scripts/ for validation. Key patterns: (1) Progressive disclosure: each skill surfaces essential information first, with deeper content in subdirectories; (2) Portable path references using `${CLAUDE_PLUGIN_ROOT}`; (3) Validation scripts (validate-hook-schema.sh, test-hook.sh, validate-agent.sh, parse-frontmatter.sh) that can be reused across any plugin project; (4) Agent triggering example blocks with `<example>` demonstrating context, user message, assistant response, and commentary. This is the canonical reference for the plugin architecture and demonstrates how to systematically document a framework.
Production-grade Terraform module for deploying a Claude Code Gateway with ECS Fargate (private subnets, ALB, Docker image), RDS PostgreSQL (IAM Database Auth, force SSL), Secrets Manager for JWT/signing keys, Bedrock/Vertex AI API routing, Okta/Google Workspace OIDC auth, and a web ACL. The module includes clean variable definitions, outputs for DNS/URLs, conditional resource creation, and precondition blocks to validate configuration. A corresponding GCP module (Cloud Run + Cloud SQL + Secret Manager + Identity-Aware Proxy) mirrors this architecture. Together they serve as a reference for deploying AI gateway infrastructure with enterprise security controls.
A TypeScript script that implements a state-machine-based issue lifecycle for GitHub issues. Defines timeout-based lifecycle labels (invalid, needs-repro, needs-info, stale, autoclose) with configurable days and nudges, all driven from a single constants file. Used by multiple GitHub Actions workflows (claude-issue-triage.yml, auto-close-duplicates.yml). The pattern of a single source of truth for lifecycle transitions, combined with GitHub API pagination, is reusable for any project needing automated issue management without a third-party service.