Based on production patterns from running multi-agent Claude Code deployments.
# Clone the repo
git clone https://github.com/arturborycki/claudecode.git
cd claudecode
# One-time global setup
./setup-global.sh
# Set up a new project
./setup-project.sh /path/to/my-project├── setup-global.sh # Script to install global config
├── setup-project.sh # Script to initialize new projects
├── global/ # Copy to ~/.claude/
│ └── .claude/
│ ├── MEMORY.md # System-wide standards (all projects)
│ ├── INFRASTRUCTURE.md # Global server/service reference
│ ├── settings.json # Global permissions & env vars
│ ├── commands/ # Global custom commands
│ │ ├── wrap.md # /wrap — End session, commit
│ │ ├── sup.md # /sup — Quick status check
│ │ ├── fragile.md # /fragile — Review danger zones
│ │ ├── plan.md # /plan — Two-phase planning
│ │ ├── research.md # /research — Deep exploration
│ │ ├── infra.md # /infra — Infrastructure reference
│ │ └── new-project.md # /new-project — Initialize project
│ └── rules/
│ └── infrastructure-access.md # Global infra access rules
│
└── project/ # Copy to your project root
├── CLAUDE.md # Project context (read first)
├── INFRASTRUCTURE.md # Project-specific servers/services
├── _FRAGILE.md # Danger zones documentation
├── _NEXT_SESSION_MEMO.md # Session handoff notes
├── _VOCABULARY.md # Canonical terminology
├── .mcp.json.example # MCP server config template
└── .claude/
├── commands/ # Project-specific commands
└── rules/
└── infrastructure.md # Project infra access rules
# Global setup (one time)
./setup-global.sh
# Per-project setup
./setup-project.sh /path/to/my-projectClick to expand manual steps
# Copy all global files
cp global/.claude/MEMORY.md ~/.claude/
cp global/.claude/INFRASTRUCTURE.md ~/.claude/
cp global/.claude/settings.json ~/.claude/
# Copy global commands
cp -r global/.claude/commands ~/.claude/
# Copy global rules
mkdir -p ~/.claude/rules
cp -r global/.claude/rules/* ~/.claude/rules/# From your project root:
cp /path/to/claudecode/project/CLAUDE.md ./
cp /path/to/claudecode/project/INFRASTRUCTURE.md ./
cp /path/to/claudecode/project/_FRAGILE.md ./
cp /path/to/claudecode/project/_NEXT_SESSION_MEMO.md ./
cp /path/to/claudecode/project/_VOCABULARY.md ./
# Copy project .claude folder
cp -r /path/to/claudecode/project/.claude ./
# Optional: Set up MCP servers
cp /path/to/claudecode/project/.mcp.json.example ./.mcp.json
# Then edit .mcp.json with your actual valuesAfter installing the global commands, use them in any Claude Code session:
| Command | Purpose | When to Use |
|---|---|---|
/wrap |
End session properly | End of work session |
/sup |
Quick status check | Anytime, fast overview |
/fragile |
Review danger zones | Before touching sensitive code |
/plan |
Two-phase planning | Complex features, no YOLO |
/research |
Deep exploration | Investigation tasks |
/infra |
Infrastructure reference | Before server/DB operations |
/new-project |
Initialize new project | Starting a new codebase |
Use this pattern when starting a session:
Read CLAUDE.md. Read _FRAGILE.md. Read _NEXT_SESSION_MEMO.md.
Working on [TASK/RFD]. Your role: [ROLE]. Write permission: [SCOPE].
- Review agent: Read-only code review
- Testing agent: Write only to test files
- Security agent: Output to SECURITY_REPORT.md only
- Coding agent: Full implementation access
Project-specific context. What you're building, tech stack, architecture decisions, conventions. Every agent reads this first.
Document code that breaks in non-obvious ways: auth flows, payments, RLS policies, migrations. Agents must check before modifying.
Handoff documentation. Updated at session end via /wrap. Contains completed work, in-progress items, blockers, and next steps.
Canonical terminology. Prevents confusion from inconsistent naming (e.g., "user" vs "member" vs "account").
System-wide standards that apply to all projects. Code quality rules, git practices, security defaults.
Server details, connection info, credentials references. Never store actual passwords — use environment variable references like $SSH_USER.
Permissions and environment variables. Controls what Claude can access (allow/ask/deny rules).
MCP (Model Context Protocol) server configurations. Enables Claude to interact with external services like GitHub, databases, Docker, Kubernetes.
Modular rules files. Split large instruction sets by topic (infrastructure, security, testing, etc.).
# WRONG - Never do this
- **Password**: `mysecretpassword123`
# CORRECT - Use environment variable references
- **Password**: `$DB_PASSWORD` (set in environment)Set credentials in your shell profile (~/.zshrc or ~/.bashrc):
# SSH
export DEV_SSH_USER="your-username"
export PROD_SSH_USER="your-prod-username"
# Database
export DB_USER="dbuser"
export DB_PASSWORD="from-secrets-manager"
# Cloud
export AWS_PROFILE="default"Enable Claude to interact with external services by configuring .mcp.json:
{
"mcpServers": {
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "${GITHUB_TOKEN}" }
},
"postgres": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-postgres"],
"env": { "DATABASE_URL": "${DATABASE_URL}" }
}
}
}{
"permissions": {
"allow": ["Bash(ssh:*dev*)"], // Auto-approved
"ask": ["Bash(ssh:*prod*)"], // Requires confirmation
"deny": ["Read(.env)", "Read(~/.ssh/*)"] // Blocked entirely
}
}- Short prompts + comprehensive docs beats elaborate role definitions
- Update _NEXT_SESSION_MEMO.md religiously via
/wrap - Use
/fragilebefore touching auth, payments, or security code - Use
/planfor any feature that spans multiple files - Keep files under 300 lines for reviewable diffs
- Single source of truth for env vars, formatters, query keys
Edit the template files to match your:
- Tech stack and frameworks
- Coding conventions
- Project structure
- Domain vocabulary
- Team processes