Agent Identity & Configuration
How agents are configured, personalized, and evolve over time
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
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 install tools, configure their environment, or set up workflows — and the changes persist across restarts.
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: Install dependencies
#!/bin/bash
# /workspace/start-up.sh
echo "Installing dependencies..."
if [ -f "package.json" ]; then
bun install
fi
sudo apt-get update -qq
sudo apt-get install -y -qq ripgrepAgent 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