Skip to content

Agents

Bonsai agents are Claude Code agents equipped with a structured instruction layer — identity, memory, protocols, skills, workflows, and sensors. Think of each agent as a new hire who arrives with full onboarding materials:

What a new hire needsBonsai equivalent
Role descriptionIdentity — job title, mindset, relationships
Company handbookProtocols — security policy, scope boundaries
PlaybooksWorkflows — how to plan, review, report
Domain trainingSkills — coding standards, API patterns
Automated guardrailsSensors — catch mistakes in real time
Maintenance dutiesRoutines — periodic audits on a schedule

When an agent starts a session, it reads its identity, checks its memory, follows its startup protocol, and gets context injected by sensors — all before you ask it anything.

Tech Lead

Architects, plans, reviews — never writes application code.

The orchestrator. It reads requirements, writes implementation plans, dispatches work to code agents via worktrees, and reviews their output. Every project starts with a Tech Lead.

Default skills: planning-template, issue-classification, dispatch, review-checklist.

Backend

API, database, server-side logic.

Executes backend implementation plans. Knows coding standards, testing conventions, and database patterns. Focused on server-side code.

Default skills: coding-standards, testing, database-conventions.

Frontend

UI components, state management, styling.

Executes frontend plans. Equipped with coding standards, testing, and UI/UX design knowledge. Focused on client-side code.

Default skills: coding-standards, testing, design-guide.

Full-Stack

End-to-end — UI, API, database, auth, tests.

A generalist code agent that handles the full stack. Carries the broadest set of default skills — coding standards, testing, design, databases, API design, and auth patterns.

Default skills: coding-standards, testing, design-guide, database-conventions, api-design-standards, auth-patterns.

DevOps

Infrastructure-as-code, CI/CD, containers, deployment.

Manages infrastructure. Comes with IaC and container standards, plus the iac-safety-guard sensor that blocks dangerous commands like terraform destroy.

Default skills: coding-standards, iac-conventions, container-standards.

Security

Vulnerability audits, auth review, dependency scanning.

Audits code for security issues. Equipped with auth patterns, review checklists, and the security-audit workflow. The api-security-check sensor auto-detects common vulnerabilities in code changes.

Default skills: coding-standards, testing, auth-patterns, review-checklist.

The Tech Lead is the central agent in every Bonsai project. It operates fundamentally differently from code agents:

You (human)
└── Tech Lead (station/) plans, reviews, orchestrates, runs routines
├── Backend (backend/) API, database, server logic
├── Frontend (frontend/) UI, components, styling
├── DevOps (devops/) infrastructure, CI/CD
└── Security (security/) audits, scanning
Tech Lead doesCode agents do
Writes implementation plansExecutes plans step-by-step
Dispatches work via worktreesImplements in isolated branches
Reviews code agent outputWrites completion reports
Runs routines (maintenance)Focuses on implementation
Manages scaffolding (status, roadmap, plans)References scaffolding for context

Start with the Tech Lead (always installed via bonsai init), then add code agents based on your project:

Your situationAdd these agentsWhy
Solo developer, any stackfullstackOne agent handles everything — UI, API, database, tests
Separated frontend and backendbackend + frontendDomain-specific skills and conventions for each layer
Infrastructure work+ devopsIaC conventions, container standards, iac-safety-guard sensor
Security-sensitive project+ securityVulnerability scanning, dependency audits, security-audit workflow
Full teambackend + frontend + devops + securityMaximum specialization and coverage

The simplest setup. One Tech Lead, one Full-Stack agent:

You
└── Tech Lead (station/)
└── Full-Stack (fullstack/)

The Tech Lead plans features and reviews work. The Full-Stack agent implements everything. Good for small-to-medium projects where you don’t need domain specialization.

Split code agents by domain for larger projects:

You
└── Tech Lead (station/)
├── Backend (backend/)
└── Frontend (frontend/)

Each agent has domain-specific skills and conventions. The Tech Lead coordinates across both — planning features that span frontend and backend, reviewing each agent’s output, maintaining shared standards.

Maximum specialization with infrastructure and security coverage:

You
└── Tech Lead (station/)
├── Backend (backend/)
├── Frontend (frontend/)
├── DevOps (devops/)
└── Security (security/)

The DevOps agent adds iac-safety-guard (blocks dangerous infrastructure commands) and infrastructure routines. The Security agent adds api-security-check (detects vulnerabilities in code), scope-guard-commands (blocks execution), and the security-audit workflow.

  • Tech Lead: Always installed during bonsai init. It lives in the station directory alongside scaffolding.
  • Code agents: Added with bonsai add. Each gets its own workspace directory (e.g., backend/, frontend/). The interactive picker lets you select agent type and customize abilities.

Each agent gets:

  • A CLAUDE.md navigation file with cross-linked references
  • An agent/ directory with Core (identity, memory), Protocols, Workflows, Skills, and Sensors
  • Hook entries in .claude/settings.json for all installed sensors
  • A config entry in .bonsai.yaml tracking all installed components

See Your First Workspace for a step-by-step walkthrough.