Skip to main content
Templates are pre-configured bundles that install multiple components at once. They provide complete setups for specific use cases, frameworks, or workflows, saving time on initial configuration.

What Are Templates?

Templates are curated collections of components that work together:
  • Language-specific - Optimized for JavaScript, Python, Go, etc.
  • Framework-focused - React, Next.js, Django, FastAPI, etc.
  • Workflow-oriented - Git excellence, security-first, testing-focused
  • Use-case driven - API development, full-stack apps, microservices
Templates are essentially installation recipes that install multiple agents, commands, hooks, MCPs, and settings in one command.

Template Categories

Comprehensive setups for programming languages:

JavaScript/TypeScript

  • Agents: frontend-developer, backend-developer, fullstack-developer
  • Commands: setup-testing, setup-linting, ci-pipeline
  • Hooks: format-javascript-files, eslint-on-save
  • MCPs: web-fetch, filesystem-access
  • Settings: allow-npm-commands, use-sonnet

Python

  • Agents: python-expert, ml-engineer, api-developer
  • Commands: setup-pytest, virtual-env-manager
  • Hooks: format-python-files (Black), run-tests-on-save
  • MCPs: postgresql-integration, filesystem-access
  • Settings: allow-pip-commands, use-sonnet

Go

  • Agents: go-expert, microservices-architect
  • Commands: setup-go-testing, module-manager
  • Hooks: gofmt-on-save, go-vet-on-change
  • MCPs: database integrations
  • Settings: allow-go-commands

Interactive Template Selection

Use interactive mode for guided template selection:
1

Choose Language

Select your primary programming language:
  • Common (language-agnostic)
  • JavaScript/TypeScript
  • Python
  • Go
  • Rust
  • Java
2

Choose Framework

Select your framework (optional):
  • None
  • React
  • Next.js
  • Vue.js
  • Django
  • FastAPI
3

Select Agents

Choose AI specialists for your project:
  • frontend-developer
  • backend-developer
  • devops-engineer
  • security-auditor
4

Select Hooks

Choose automation hooks:
  • format-on-save
  • run-tests-on-change
  • git-commit-formatter
5

Select MCPs

Choose service integrations:
  • web-fetch
  • postgresql-integration
  • github-integration
6

Confirm & Install

Review selections and confirm installation.

Template Installation

Auto-Detection Mode

Claude Code automatically detects your project type:
Detection logic:
  • Checks package.json for React/Next.js/etc.
  • Looks for requirements.txt or pyproject.toml for Python
  • Finds go.mod for Go projects
  • Detects framework from dependencies
Installs appropriate template automatically.

Manual Template Selection

Dry Run Mode

Preview what will be installed:
Shows list of files that would be created without actually installing.

Template Components

Language: JavaScript/TypeScript

Default Installation:
Files Created:

Language: Python

Default Installation:

Customizing Templates

After installation, customize components:

Add More Components

New components merge with existing configuration.

Modify Settings

Edit .claude/settings.json or .claude/settings.local.json:
Change permissions, add environment variables, or configure hooks.

Remove Components

Delete unwanted component files:

Template Best Practices

1. Start with Base Template

Install language/framework template first:
Then add specialized components:

2. Separate Team vs Personal Settings

Commit to git (team settings):
  • .claude/agents/
  • .claude/commands/
  • .claude/settings.json
  • .mcp.json
Don’t commit (personal settings):
  • .claude/settings.local.json

3. Document Your Template

Create CLAUDE.md in your project:

4. Version Control Template Configuration

Commit .claude/ directory:
Team members get the same setup when they clone.

Template Migration

Update to newer template versions:
CLI merges new components with existing ones, prompting for conflicts.

Creating Custom Templates

Share your template configuration:

1. Export Current Setup

Your .claude/ directory IS your template:

2. Install from Archive

3. Publish Template Workflow

Create workflow hash for easy sharing:
For detailed workflow creation, see Workflows Guide.

Common Template Use Cases

Startup MVP

Result: Full-stack Next.js setup with database and API integration.

Enterprise API

Result: Secure API development environment with database access.

Data Science Project

Result: ML/data science environment with database integration.

Open Source Project

Result: Git workflow automation with documentation and GitHub integration.

Template Limitations

Not Supported

  • Custom file templates (React components, etc.)
  • Project scaffolding (create-react-app, etc.)
  • Package installation (npm install, pip install)
  • Code generation

Workarounds

Use commands for custom workflows:

Health Check

Verify template installation:
Checks:
  • .claude/ directory exists
  • Agents are valid markdown
  • Commands are valid markdown
  • Settings are valid JSON
  • MCP configuration is valid
  • Hooks are properly configured
Run health check after template installation to catch configuration issues early.

Next Steps

Install Template

Get started with a template

Browse Components

Explore individual components

Create Workflows

Bundle components into workflows

Interactive Mode

Use guided template selection