Skip to content

Devgapperk/Claude-Code-Guide

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Kleiber Orchestration

Drop-in agent team orchestration for Claude Code. Zero dependencies. Zero scripts.

What This Is

A CLAUDE.md + .claude/ config that turns Claude Code's native Agent Teams into a structured orchestration system with defined roles, model routing, and automated quality gates.

Before (this repo, old version): ~2,500 lines of TypeScript + Bash scripts reimplementing what Claude Code already provides natively.

Now: 3 config files, 320 lines total. Everything runs through Claude Code's built-in Agent Teams feature.

Setup

1. Copy into your project

# Clone this repo
git clone https://github.com/Devgapperk/Claude-Code-Guide.git

# Copy the orchestration files into your project
cp Claude-Code-Guide/CLAUDE.md /path/to/your-project/
cp -r Claude-Code-Guide/.claude/ /path/to/your-project/

2. Start Claude Code

cd /path/to/your-project
claude

3. Create a team

Tell Claude what to build:

Create an agent team to build user authentication.
Spawn an architect (opus), two engineers (sonnet), a validator (haiku), and a scribe (haiku).
Use delegate mode.

Claude reads CLAUDE.md, spawns teammates with the right prompts and models, creates the task list, and orchestrates.

What's Inside

your-project/
├── CLAUDE.md                          # Orchestration blueprint (loaded by all teammates)
└── .claude/
    ├── settings.json                  # Enables agent teams + permissions + hooks
    └── hooks/
        ├── stop-loop-guard.sh         # Detects Ralph Loops (agent spinning on same error)
        ├── task-completed.sh          # Blocks task completion if tests/types fail
        ├── teammate-idle.sh           # Prevents idle if uncommitted work exists
        ├── post-edit-verify.sh        # Type-checks after every file edit (catches slop)
        └── block-destructive.sh       # Blocks rm -rf, force push, DROP TABLE

How It Works

  1. CLAUDE.md is auto-loaded by every teammate on spawn. It defines roles, model routing, anti-slop protocol, loop prevention rules, context window management, and conventions.

  2. settings.json enables agent teams, pre-approves safe commands (test, lint, build, git), blocks dangerous ones (.env reads, rm -rf), and wires up 5 hooks across the full lifecycle.

  3. Hooks enforce quality at every stage:

    Hook Event What It Does
    stop-loop-guard.sh Stop Scans transcript for repeated errors or retry language. If an agent hit the same error 3+ times or retried 4+ times, forces it to stop and report instead of burning more tokens.
    task-completed.sh TaskCompleted Runs npm test + tsc --noEmit. Blocks completion if either fails. Teammate gets the error output and must fix it.
    teammate-idle.sh TeammateIdle Checks for uncommitted changes. Keeps teammate working until they commit.
    post-edit-verify.sh PostToolUse (Write/Edit) Type-checks after every .ts/.tsx file change. Catches hallucinated imports and wrong signatures on the first edit, not after 10 files of broken code.
    block-destructive.sh PreToolUse (Bash) Blocks rm -rf, git push --force, and DROP TABLE.

Team Roles

Role Model Purpose
Architect Opus Design, review, approve. Never writes code.
Engineer-Frontend Sonnet React, Tailwind, component tests
Engineer-Backend Sonnet Express, Drizzle, integration tests
Validator Haiku Runs tests, types, lint. Read-only.
Scribe Haiku Docs, CHANGELOG, decision records.

Only spawn what the task needs. A bug fix might only need 2 engineers + validator.

Controls

Action Key
Cycle teammates Shift+Up / Shift+Down
Delegate mode (lead coordinates only) Shift+Tab
Task list Ctrl+T
Message teammate Select + type
Split pane mode Set "teammateMode": "tmux" in settings

Example Prompts

Full feature:

Create an agent team to build [feature]. Spawn architect (opus), frontend
engineer (sonnet), backend engineer (sonnet), validator (haiku), scribe (haiku).
Require plan approval for the architect. Use delegate mode.

Parallel code review:

Create an agent team to review PR #142. Three reviewers: security, performance,
test coverage. Have them report independently.

Bug investigation:

Users report [symptom]. Create a team with 4 teammates investigating competing
hypotheses. Have them challenge each other's theories.

Model Costs

Model Input / Output per M tokens When to Use
Opus $15 / $75 Architecture, security, compliance
Sonnet $3 / $15 Implementation (default)
Haiku $0.25 / $1.25 Validation, docs, boilerplate

Requirements

  • Claude Code CLI
  • jq (used by hook scripts)
  • Git

No npm install. No build step. No runtime dependencies.


Built by DevGap. Orchestrated with Kleiber. Powered by Claude.

About

Clone the repository, load CLAUDE.md, spawn 10 Claude Code agents. Ship production infrastructure in hours, not weeks.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages