Agent Identity & Configuration
AI agent identity architecture — SOUL.md, IDENTITY.md, CLAUDE.md, and TOOLS.md combine to give each agent a persistent role, expertise, and self-evolving memory across Claude Code sessions.
Every agent in the swarm is a persistent entity with its own identity, memories, and environment. This identity evolves over time as the agent works.
Identity Files
Each agent has four identity files that persist across sessions:
| File | Purpose | Example |
|---|---|---|
| SOUL.md | Core persona, values, behavioral directives | "You're not a chatbot. Be thorough. Own your mistakes." |
| IDENTITY.md | Expertise, working style, track record | "I'm the coding arm of the swarm. I ship fast and clean." |
| TOOLS.md | Environment knowledge — repos, services, APIs | "The API runs on port 3013. Use wts for worktree management." |
| CLAUDE.md | Persistent notes and instructions | Learnings, preferences, important context |
How Identity Works
- Template-based bootstrap — On first registration, if
TEMPLATE_IDis set, the template is fetched and used to generate identity files. Templates can also set defaultrole,capabilities,maxTasks, andisLeadvalues that apply when not explicitly configured. - Default generation — If no template is set, the system generates generic templates based on the agent's name, role, and description
- Self-editing — Agents modify their own identity files during sessions. A PostToolUse hook syncs changes to the database in real-time
- API / MCP tool — Use the
update-profiletool to programmatically set any identity field
Identity size budgets
The prompt has finite space for identity files, so profile updates use ratcheting budgets instead of silently accepting content that sessions cannot read:
| Field | Budget | Behavior above the budget |
|---|---|---|
SOUL.md | 10,000 characters | May stay the same size or shrink, but cannot grow |
IDENTITY.md | 10,000 characters | May stay the same size or shrink, but cannot grow |
CLAUDE.md | 20,000 characters | May stay the same size or shrink, but cannot grow |
TOOLS.md | 20,000 characters | May stay the same size or shrink, but cannot grow |
This ratchet preserves existing oversized profiles while giving agents a safe path back under budget. Move durable detail into searchable memory files and keep concise pointers in identity files.
Filesystem sync sends each changed identity file independently. If one field is rejected, valid edits to the other fields still persist. The rejection is recorded as a system.profile_sync_rejected event and shown to the agent at its next session with the current size, budget, and recovery guidance; a later successful sync records system.profile_sync_reconciled. Before boot replaces a local identity file from the database, the worker preserves divergent local content in a .pre-boot-<timestamp>.bak file.
Agent Appearance
An agent profile can optionally store a Lucide icon and hex color. In the dashboard, open an agent's detail page, enter edit mode, and use the appearance picker to search hundreds of curated icons by natural words (spaces and hyphens are treated equivalently), select a suggested color, or enter a #RRGGBB value. The selected avatar is used consistently in agent lists and detail views; agents without one keep their deterministic icon and color.
The same setting is available through update-profile:
{
"avatar": {
"type": "lucide",
"icon": "rocket",
"color": "#7C3AED"
}
}Pass "avatar": null to restore the deterministic default. Omitting avatar leaves the current appearance unchanged.
Version History
All identity file changes are tracked with version history. You can:
- View past versions using the
context-historyMCP tool - Compare versions using the
context-difftool - Roll back to a previous version if needed
System Prompt Assembly
The system prompt is built from multiple layers, assembled at task start:
- Base role instructions — Lead or worker-specific behavior rules
- Code quality & repository guidelines — Mandatory PR checks, merge policy, and review guidance from per-repo configuration
- Conditional Slack instructions — Injected only for worker tasks that originated from Slack (channel ID and thread context)
- Agent identity — SOUL.md + IDENTITY.md content
- Repository context — If the task targets a specific GitHub repo, that repo's CLAUDE.md and guidelines are included
- Filesystem guide — Memory directories, personal/shared workspace, setup script instructions
- Self-awareness — How the agent is built (runtime, hooks, memory system, task lifecycle)
- Additional prompt — Custom text from
SYSTEM_PROMPTenv var or--system-promptCLI flag
Startup Scripts
Each agent has a startup script (/workspace/start-up.sh) that runs at every container start. Agents can modify this script to configure their environment or set up repo-local dependencies, and the changes persist across restarts. The script runs as the non-root worker user after privilege drop, so it is not a place to apt-install system packages.
Supported formats (priority order):
start-up.sh/start-up.bash— Bash scriptsstart-up.js— Node.js scriptsstart-up.ts/start-up.bun— Bun/TypeScript scripts
Example: Project-local setup
#!/bin/bash
# /workspace/start-up.sh
echo "Installing dependencies..."
if [ -f "package.json" ]; then
bun install
fiAgent Workspace
Each agent has access to:
| Path | Description |
|---|---|
/workspace/personal/ | Agent's private workspace (isolated per agent) |
/workspace/shared/ | Shared workspace between all agents |
/workspace/personal/memory/ | Private searchable memory files |
/workspace/shared/ | Read-only shared disk (all agents' directories visible) |
/logs | Session logs |
Agent Filesystem (agent-fs)
When AGENT_FS_API_URL is configured as a global swarm config, agents gain access to agent-fs — a persistent, searchable filesystem shared across the swarm. Agent-fs provides:
- Personal and shared drives — Each agent has a personal drive and access to a shared org drive
- Full-text and semantic search — Search across all files with keyword or natural language queries
- Comments — Human-agent collaboration via file comments
- CLI access — The
agent-fsCLI is pre-installed in worker containers and auto-configured on first boot
Agents are automatically registered with agent-fs on their first container boot. The lead agent creates a shared organization and workers receive invitations automatically.
Repository Guidelines
Repos registered with the swarm can have guidelines — per-repo quality rules that are injected into agent prompts and enforced by plugin commands.
Guidelines have three sections:
| Section | Purpose |
|---|---|
| PR Checks | Commands agents must run before pushing (lint, typecheck, tests) |
| Merge Policy | Whether agents are allowed to merge, and any required checks |
| Review Guidance | How agents should review PRs for this repo |
How It Works
- Lead sets guidelines — Use the
update-repoMCP tool to configure guidelines for a repo - Prompt injection — When a task targets a repo, its guidelines are injected into the agent's system prompt as a mandatory "Repository Guidelines" section
- Command enforcement —
/create-prand/implement-issuerequire PR checks to pass before pushing;/review-prreferences the review guidance - Lead gating — The lead agent can block code tasks for repos that lack guidelines
Use the get-repos MCP tool to view registered repos and their guidelines.
Lead vs Worker
Lead Agent
- Receives incoming messages from Slack, GitHub, and email
- Has an inbox for triaging messages
- Can delegate tasks to workers
- Can inject learnings into worker memories
- Has access to all Slack channels
- Coordinates projects across workers
Worker Agent
- Executes assigned tasks
- Reports progress via
store-progress - Can expose HTTP services
- Builds specialized expertise over time
- Can claim tasks from the task pool
- Can communicate with other agents via channels
Related
- Architecture Overview — How all the components fit together
- Hook System — Hooks that sync identity files and manage sessions
- Memory System — How agents build compounding knowledge
- Agents API Reference — REST API endpoints for registering, querying, and managing agents
Architecture Overview
Hub-and-spoke architecture for multi-agent AI orchestration — central MCP API server coordinates Docker-isolated worker agents with persistent SQLite state, vector memory, and Claude Code harness integration.
Memory System
Persistent AI agent memory — vector embeddings, semantic search, TTL expiry, and reranking with recency and access signals so agents accumulate knowledge across Claude Code sessions instead of starting fresh.