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
npx claude-code-templates@latest --language javascript-typescript

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
npx claude-code-templates@latest --language python

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
npx claude-code-templates@latest --language go

Interactive Template Selection

Use interactive mode for guided template selection:
npx claude-code-templates@latest
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:
cd my-react-app
npx claude-code-templates@latest --yes
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

# Specific language
npx claude-code-templates@latest --language python

# Language + Framework
npx claude-code-templates@latest \
  --language javascript-typescript \
  --framework nextjs

# With custom agents
npx claude-code-templates@latest \
  --language python \
  --agent ml-engineer \
  --agent data-scientist

Dry Run Mode

Preview what will be installed:
npx claude-code-templates@latest \
  --language javascript-typescript \
  --framework react \
  --dry-run
Shows list of files that would be created without actually installing.

Template Components

Language: JavaScript/TypeScript

Default Installation:
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
Files Created:
.claude/
├── agents/
│   ├── frontend-developer.md
│   ├── backend-developer.md
│   └── fullstack-developer.md
├── commands/
│   ├── setup-testing.md
│   ├── setup-linting.md
│   └── ci-pipeline.md
├── settings.json
└── settings.local.json
.mcp.json

Language: Python

Default Installation:
Agents:
  - python-expert
  - api-developer
  - ml-engineer

Commands:
  - setup-pytest
  - virtual-env-manager
  - requirements-updater

Hooks:
  - format-python-files (Black)
  - run-tests-on-save

MCPs:
  - postgresql-integration
  - filesystem-access

Settings:
  - allow-pip-commands
  - use-sonnet

Customizing Templates

After installation, customize components:

Add More Components

# Add additional agent
npx claude-code-templates@latest --agent security-auditor

# Add MCP integration
npx claude-code-templates@latest --mcp github-integration

# Add automation hook
npx claude-code-templates@latest --hook git/commit-validator
New components merge with existing configuration.

Modify Settings

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

Remove Components

Delete unwanted component files:
# Remove agent
rm .claude/agents/unwanted-agent.md

# Remove command
rm .claude/commands/unwanted-command.md

Template Best Practices

1. Start with Base Template

Install language/framework template first:
npx claude-code-templates@latest --language python --framework django
Then add specialized components:
npx claude-code-templates@latest --agent security-auditor

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:
# Claude Code Setup

## Installed Components

- **Agents**: frontend-developer, backend-developer
- **Commands**: ci-pipeline, setup-testing
- **Hooks**: format-on-save, run-tests
- **MCPs**: web-fetch, postgresql-integration

## Usage

Invoke agents: `@frontend-developer Build the dashboard`
Run commands: `/ci-pipeline setup`

4. Version Control Template Configuration

Commit .claude/ directory:
git add .claude/
git commit -m "Add Claude Code template configuration"
Team members get the same setup when they clone.

Template Migration

Update to newer template versions:
# Re-run installation
npx claude-code-templates@latest --language javascript-typescript
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:
# Package template
tar -czf my-template.tar.gz .claude/ .mcp.json

# Share with team
cp my-template.tar.gz /shared/drive/

2. Install from Archive

# Extract template
tar -xzf my-template.tar.gz

# Components are ready to use

3. Publish Template Workflow

Create workflow hash for easy sharing:
# Create workflow YAML
cat > my-workflow.yml <<EOF
agents:
  - frontend-developer
  - backend-developer
commands:
  - ci-pipeline
hooks:
  - format-on-save
mcps:
  - web-fetch
EOF

# Install from workflow
npx claude-code-templates@latest --workflow my-workflow.yml
For detailed workflow creation, see Workflows Guide.

Common Template Use Cases

Startup MVP

npx claude-code-templates@latest \
  --language javascript-typescript \
  --framework nextjs \
  --agent fullstack-developer \
  --mcp web-fetch \
  --mcp supabase
Result: Full-stack Next.js setup with database and API integration.

Enterprise API

npx claude-code-templates@latest \
  --language python \
  --framework fastapi \
  --agent api-developer \
  --agent security-auditor \
  --mcp postgresql-integration \
  --setting read-only-mode
Result: Secure API development environment with database access.

Data Science Project

npx claude-code-templates@latest \
  --language python \
  --agent ml-engineer \
  --agent data-scientist \
  --mcp postgresql-integration \
  --command data-pipeline
Result: ML/data science environment with database integration.

Open Source Project

npx claude-code-templates@latest \
  --workflow git-excellence \
  --agent documentation-expert \
  --command changelog-generator \
  --mcp github-integration
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:
# Create command that scaffolds components
npx claude-code-templates@latest --command scaffold-react-component

# Use in Claude Code
/scaffold-react-component Button

Health Check

Verify template installation:
npx claude-code-templates@latest --health
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