10
Switch language to العربية

Claude Code

PreviousNext

Team setup guide for Claude Code configuration

Complete setup guide for the databayt team Claude Code configuration.

One-Liner Setup

macOS / Linux

curl -fsSL https://raw.githubusercontent.com/databayt/codebase/main/.claude/scripts/install.sh | bash && ~/.claude/scripts/secrets.sh 68453b25fa9d28c94426c55c179b3838

Windows (PowerShell)

irm https://raw.githubusercontent.com/databayt/codebase/main/.claude/scripts/install.ps1 | iex; & "$env:USERPROFILE\.claude\scripts\secrets.ps1" -GistId 68453b25fa9d28c94426c55c179b3838

This installs Claude Code CLI, downloads team configuration, and sets up secrets automatically.


What Gets Installed

ComponentCountDescription
Agents29Architecture, React, Prisma, product repos (hogwarts, souq, mkan, shifa), etc.
Commands17/repos, /atom, /template, /block, /build, /deploy, etc.
Memory5atoms, templates, blocks, reports, repositories
MCP Servers28GitHub, Neon, shadcn, browser, Vercel, Stripe, etc.
Scripts6install, sync, setup-secrets, sync-repos (macOS + Windows)

Step-by-Step Installation

Step 1: Install Claude Code CLI

macOS / Linux

curl -fsSL https://claude.ai/install.sh | sh

Windows (PowerShell)

irm https://claude.ai/install.ps1 | iex

Verify

claude --version

Step 2: Download Team Config

macOS / Linux

curl -fsSL https://raw.githubusercontent.com/databayt/codebase/main/.claude/scripts/install.sh | bash

Windows

irm https://raw.githubusercontent.com/databayt/codebase/main/.claude/scripts/install.ps1 | iex

Step 3: Setup Secrets

macOS / Linux

~/.claude/scripts/secrets.sh 68453b25fa9d28c94426c55c179b3838

Windows

& "$env:USERPROFILE\.claude\scripts\secrets.ps1" -GistId 68453b25fa9d28c94426c55c179b3838

Step 4: Restart Terminal & Run

claude
# or with alias
c

Directory Structure

~/.claude/                      # Windows: %USERPROFILE%\.claude\
├── CLAUDE.md                   # Global instructions (468 lines, 90+ keywords)
├── CLAUDE.local.md             # Your personal overrides (not synced)
├── settings.json               # Environment & hooks (macOS/Linux)
├── settings-windows.json       # Windows-specific hooks
├── mcp.json                    # 28 MCP server configurations
├── .env                        # Secrets (auto-generated, DO NOT COMMIT)
├── agents/                     # 29 custom agents
│   ├── architecture.md
│   ├── hogwarts.md             # Education SaaS patterns
│   ├── souq.md                 # E-commerce patterns
│   ├── mkan.md                 # Rental/booking patterns
│   ├── shifa.md                # Healthcare patterns
│   ├── react.md
│   ├── prisma.md
│   └── ...
├── commands/                   # 17 slash commands
│   ├── repos.md                # Repository explorer
│   ├── atom.md
│   ├── template.md
│   ├── block.md
│   └── ...
├── memory/                     # Persistent memory files
│   ├── atom.json
│   ├── template.json
│   ├── block.json
│   ├── report.json
│   └── repositories.json       # All org repos with monitoring
└── scripts/
    ├── install.sh              # macOS/Linux installer
    ├── install.ps1             # Windows installer
    ├── sync.sh                 # macOS/Linux config sync
    ├── sync.ps1                # Windows config sync
    ├── secrets.sh        # macOS/Linux secrets setup
    ├── secrets.ps1       # Windows secrets setup
    ├── sync-repos.sh           # Sync all org repos locally
    └── sync-repos.ps1          # Windows repo sync

Shell Configuration

macOS / Linux

Add to ~/.zshrc or ~/.bashrc:

export PATH="$HOME/.local/bin:$HOME/.claude/bin:$PATH"
alias c='claude --dangerously-skip-permissions'
 
# Auto-load secrets
[ -f "$HOME/.claude/.env" ] && export $(grep -v "^#" "$HOME/.claude/.env" | xargs)

Reload: source ~/.zshrc

Windows (PowerShell Profile)

Add to $PROFILE:

# Claude Code alias
Set-Alias -Name c -Value claude
 
# Quick start with permissions
function cc { claude --dangerously-skip-permissions $args }
 
# Auto-load secrets
if (Test-Path "$env:USERPROFILE\.claude\.env") {
    Get-Content "$env:USERPROFILE\.claude\.env" | ForEach-Object {
        if ($_ -and -not $_.StartsWith("#")) {
            $parts = $_ -split "=", 2
            if ($parts.Length -eq 2) {
                [Environment]::SetEnvironmentVariable($parts[0], $parts[1], "Process")
            }
        }
    }
}

Reload: . $PROFILE


Quick Keywords

After setup, just say these words to trigger actions:

Workflow

KeywordAction
devKill port 3000 → Start server → Open browser
buildRun build with error scanning
pushFull git commit + push
quickFast commit (skip build)
deployDeploy to Vercel staging
shipDeploy to production

Creation

KeywordAction
atomCreate atom (2+ primitives)
templateCreate template (full-page layout)
blockCreate block (UI + logic)
componentCreate React component
pageCreate Next.js page

Repository References

KeywordAction
like hogwartsReference education SaaS patterns
like souqReference e-commerce patterns
like mkanReference rental/booking patterns
like shifaReference healthcare patterns
from codebaseClone pattern from codebase
/reposExplore all org repositories

Quality

KeywordAction
testGenerate tests (Vitest)
securitySecurity audit (OWASP)
performanceCore Web Vitals check
reviewCode review

See full keyword list (90+) in ~/.claude/CLAUDE.md.


Secrets Management

Secrets are stored in a private GitHub gist and auto-loaded via scripts.

What's Included

Required

  • GITHUB_PERSONAL_ACCESS_TOKEN - GitHub API access

Per-Project Databases

  • DATABASE_URL_CODEBASE - Codebase project DB
  • DATABASE_URL_HOGWARTS - Hogwarts (education SaaS) DB
  • DATABASE_URL_MKAN - Mkan (rental marketplace) DB
  • DATABASE_URL_SOUQ - Souq (e-commerce) DB (when created)
  • DATABASE_URL_SHIFA - Shifa (healthcare) DB (when created)

AI Keys

  • ANTHROPIC_API_KEY - Claude API
  • GROQ_API_KEY - Groq API

Auth

  • OAuth credentials (Google, Facebook)
  • AUTH_SECRET - NextAuth secret

Services

  • Stripe, Resend, Cloudinary, ImageKit, Telegram

Per-Project Database Usage

When working on a specific project, copy the appropriate DATABASE_URL to your project's .env:

# Working on hogwarts?
DATABASE_URL=$DATABASE_URL_HOGWARTS
 
# Working on mkan?
DATABASE_URL=$DATABASE_URL_MKAN
 
# Working on codebase?
DATABASE_URL=$DATABASE_URL_CODEBASE

Or use an alias in your shell profile:

alias use-hogwarts='export DATABASE_URL=$DATABASE_URL_HOGWARTS'
alias use-mkan='export DATABASE_URL=$DATABASE_URL_MKAN'
alias use-codebase='export DATABASE_URL=$DATABASE_URL_CODEBASE'

Update Secrets

  1. Go to: https://gist.github.com/abdout/68453b25fa9d28c94426c55c179b3838
  2. Click Edit
  3. Update values
  4. Team members run setup-secrets again to get updates

Manual Override

Create/edit ~/.claude/.env directly:

GITHUB_PERSONAL_ACCESS_TOKEN=ghp_xxx
DATABASE_URL_HOGWARTS=postgresql://...
# ... other variables

Repository Sync

Sync all organization repositories locally for deep reference:

macOS / Linux

# Sync all repos
~/.claude/scripts/sync-repos.sh
 
# Check status
~/.claude/scripts/sync-repos.sh status
 
# Watch upstream dependencies
~/.claude/scripts/sync-repos.sh watch
 
# Sync specific repo
~/.claude/scripts/sync-repos.sh hogwarts

Windows

& "$env:USERPROFILE\.claude\scripts\sync-repos.ps1"
& "$env:USERPROFILE\.claude\scripts\sync-repos.ps1" -RepoName status

Monitored Repositories

Core Libraries (Priority 1):

  • codebase - Patterns, agents, templates, blocks
  • shadcn - UI component library (shadcn/ui fork)
  • radix - Radix primitives
  • kun - Code Machine config

Product Repositories (Priority 2):

  • hogwarts - Education SaaS (multi-tenant, LMS, billing)
  • souq - E-commerce (multi-vendor, cart)
  • mkan - Rental marketplace (booking, listings)
  • shifa - Medical platform (appointments, patients)

Specialized (Priority 3):

  • swift-app - iOS mobile
  • distributed-computer - Rust infrastructure
  • marketing - Landing pages

Configuration Sync

To get latest team configuration updates:

macOS / Linux

~/.claude/scripts/sync.sh

Windows

& "$env:USERPROFILE\.claude\scripts\sync.ps1"

This updates:

  • CLAUDE.md (keywords, patterns)
  • Agents (29 files)
  • Commands (17 files)
  • Memory files
  • Scripts

Your CLAUDE.local.md is preserved.


MCP Servers

28 MCP servers are pre-configured:

MCPPurposeTrigger
githubGit operationspush, pr, issue
neonDatabaseprisma, migration
shadcnUI componentsui, component
browserPlaywrighttest, e2e
vercelDeploymentsdeploy, ship
stripePaymentspayment, billing
posthogAnalyticsanalytics
sentryErrorserror, debug
airtableDataairtable
notionDocsnotion

See full list in ~/.claude/mcp.json.


Product Agent Reference

Each product repo has a dedicated agent with patterns:

hogwarts (Education SaaS)

"auth like hogwarts"      # Multi-tenant auth
"billing like hogwarts"   # Stripe subscription
"lms like hogwarts"       # Course management

Patterns: Multi-tenant architecture, subdomain routing, role-based access, Stripe billing

souq (E-commerce)

"cart from souq"          # Shopping cart
"vendor like souq"        # Vendor dashboard
"catalog like souq"       # Product catalog

Patterns: Redux cart, multi-vendor, product variants, order management

mkan (Rental Marketplace)

"booking like mkan"       # Booking system
"listings like mkan"      # Property listings
"calendar like mkan"      # Availability calendar

Patterns: Property listings, date range booking, availability management, search filters

shifa (Healthcare)

"appointments like shifa" # Appointment scheduling
"patient like shifa"      # Patient records
"schedule like shifa"     # Doctor scheduling

Patterns: Appointment system, patient records, doctor schedules, prescription management


Local Customizations

Create ~/.claude/CLAUDE.local.md for personal overrides:

# My Local Settings
 
## Additional Preferences
- My preferred editor: VSCode
- Custom project paths: /path/to/my/projects
 
## Personal Keywords
| Keyword | Action |
|---------|--------|
| `myproject` | cd to my main project |

This file is never overwritten by sync.


Troubleshooting

Windows: "claude not found"

$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")

macOS: Permission denied

chmod +x ~/.claude/scripts/*.sh

MCP servers not loading

  1. Check ~/.claude/mcp.json exists
  2. Verify environment variables are set
  3. Restart Claude

Secrets not loading

# Check .env file
cat ~/.claude/.env
 
# Manually source
source ~/.zshrc

Config Sources

Configuration is available from two repositories:

Primary (codebase)

https://github.com/databayt/codebase/tree/main/.claude

Alternative (kun)

https://github.com/databayt/kun/tree/main/.claude

Both contain identical configuration.


Permission Flags

FlagPurpose
--dangerously-skip-permissionsSkip all prompts
--allowedTools "Bash,Read,Write"Whitelist tools
-p "prompt"Direct prompt mode
-rResume last session

Usage Examples

# Start session
c
 
# Direct prompt
c "fix the login bug"
 
# Resume last session
c -r
 
# With specific tools allowed
claude --allowedTools "Read,Grep,Glob" "find all TODO comments"