DEV Community

Sangmin Lee
Sangmin Lee

Posted on • Originally published at claudeguide.io

Claude Code for Teams: Self-Host, Shared Config, Enterprise

Originally published at claudeguide.io/claude-code-self-host-team

Claude Code for Teams: Self-Hosting, Shared Config, and Enterprise Setup

There is no "self-hosted" Claude Code in the traditional sense — the model runs on Anthropic's API, not your servers. "Team setup" means: shared CLAUDE.md conventions in the repo, centralized API key management, model routing to control costs, and consistent tooling across developers' machines. This guide covers what it takes to run Claude Code effectively across a team of 2–50 developers.


What "Team Claude Code" Actually Means

Three things to get right:

  1. Shared context — every developer's Claude session knows the project conventions (CLAUDE.md in the repo)
  2. Centralized API access — one billing account, keys distributed securely, usage visible
  3. Consistent tooling — same Claude Code version and settings across machines

What it does NOT mean:

  • Running a Claude model on your own servers (not available; Anthropic API only)
  • A shared Claude Code "server" that multiple developers connect to (each developer runs their own Claude Code CLI)

Step 1: Shared CLAUDE.md in the Repository

The most important team setup is CLAUDE.md committed to the repo. Every developer who runs Claude Code in the project directory gets the same context automatically.

# ProjectName — Claude Code Team Config

## Stack
- Node.js 20, TypeScript strict
- Next.js 15 App Router
- Prisma + PostgreSQL (Neon)
- Clerk auth
- Bun as package manager

## Architecture Rules
1. Every DB query must include organizationId filter (multi-tenant)
2. No direct Prisma calls in components — use server actions or API routes
3. All API routes: validate auth first, then DB access
4. Errors: throw AppError from @/lib/errors, never plain Error

## Testing
- Unit tests: vitest
- Integration: tests/integration/ (run with bun run test:integration)
- Pre-commit: bun run typecheck && bun run lint

## Naming
- Files: kebab-case
- Components: PascalCase
- DB columns: snake_case

## What NOT to do
- No any type (use unknown or specific types)
- No console.log in production code (use @/lib/logger)
- No hardcoded strings for user-facing copy (use i18n keys)

## Commands
- dev: bun run dev
- typecheck: bun run typecheck
- test: bun run test
- lint: bun run lint
Enter fullscreen mode Exit fullscreen mode

Commit this file to the repo root:

git add CLAUDE.md
git commit -m "docs: add Claude Code team configuration"
Enter fullscreen mode Exit fullscreen mode

Every team member benefits automatically — no manual setup needed on their machine.


Step 2: API Key Management

Option A: Individual API keys (small teams, < 5 developers)

Each developer gets their own Anthropic API key. Simple, no shared cost visibility.

# Each developer sets their own key
export ANTHROPIC_API_KEY="sk-ant-..."
# Or add to ~/.zshrc / ~/.bashrc
Enter fullscreen mode Exit fullscreen mode

Downside: no centralized billing, no usage visibility per developer.

Option B: Shared key via secrets manager (recommended for 5+ developers)

Use a secrets manager (1Password, AWS Secrets Manager, Doppler) to distribute a shared key:

# With Doppler
doppler setup
export ANTHROPIC_API_KEY=$(doppler secrets get ANTHROPIC_API_KEY --plain)

# With AWS SSM
export ANTHROPIC_API_KEY=$(aws ssm get-parameter --name /team/anthropic-api-key --with-decryption --query Parameter.Value --output text)
Enter fullscreen mode Exit fullscreen mode

Advantage: rotate the key in one place, everyone gets the update.

Option C: Enterprise Anthropic agreement

For teams

→ Get Power Prompts 300 — $29

30-day money-back guarantee. Instant download.

Top comments (0)