🦞 Lobster Farm

April 7, 2026 Β· View on GitHub

Complete reference for all features and systems. For quick start, see README.md.


Table of Contents


Core Concept

Every team member gets their own dedicated AI assistant ("lobster") running in an isolated Docker container. Lobsters:

  • Share company knowledge, skills, and policies (read-only mounts)
  • Keep private personal conversations, memory, and credentials
  • Learn from each other through shared knowledge and Teamind
  • Self-improve by recording and promoting lessons from mistakes
  • Detect blockers proactively and report to the controller

The controller (host OpenClaw) manages the fleet: spawning, monitoring, broadcasting, upgrading.


Fleet Operations

Spawning

Two steps to create a new lobster:

# Recommended: Tell your controller
# "Spawn a new lobster called alice for @username"
# The controller runs create-slack-app.sh + spawn-lobster.sh automatically.

# Manual CLI:
./scripts/create-slack-app.sh alice           # Auto-creates Slack app
# β†’ Follow install link, click Allow, get tokens
./scripts/spawn-lobster.sh alice U0XXXXXXXXX xoxb-... xapp-...

What happens under the hood:

  1. create-slack-app.sh creates a Slack app via Manifest API (scopes, events, socket mode all pre-configured)
  2. Admin clicks Allow on the install link (~5s), then creates an app-level token (~15s)
  3. spawn-lobster.sh creates config directory with openclaw.json, acp.json, secrets.json
  4. Appends service to docker-compose.yml with all volume mounts
  5. Starts container with Chrome, VNC, noVNC, and OpenClaw gateway

πŸ“– Full guide: docs/slack-bot-setup.md β€” includes manual setup option if you don't have a Slack Configuration Token.

Broadcast

Two modes for fleet-wide communication:

ModeScriptHow it worksUse case
AI-mediatedbroadcast.shSends as system event; lobster decides how/whether to relay to userNon-urgent updates, context sharing
Direct APIbroadcast-direct.shCalls Slack API directly; guaranteed deliveryUrgent announcements, downtime notices

Fleet Sync

Push configuration changes, new skills, API keys, or memory updates to all lobsters simultaneously:

./scripts/sync-fleet.sh                     # sync all
./scripts/sync-fleet.sh --key NEW_KEY=xxx   # add API key
./scripts/sync-fleet.sh --dry-run           # preview changes

Backup & Rescue

  • Auto-backup: backup-lobsters.sh archives all configs + workspaces to timestamped tarballs
  • Rescue mode: Check logs β†’ inspect resources β†’ restart β†’ force-recreate (escalating recovery)

Memory Architecture

Four-layer memory with strict isolation:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Layer 4: Company Knowledge (read-only)           β”‚
β”‚   company-memory/, company-skills/, company-configβ”‚
β”‚   β†’ All lobsters can read, none can write        β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Layer 3: Channel Memory                          β”‚
β”‚   team/channels/<ChannelID>.md                   β”‚
β”‚   β†’ Shared within a Slack channel context        β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Layer 2: Member Personal                         β”‚
β”‚   team/members/<UserID>.md                       β”‚
β”‚   β†’ Individual + their lobster + controller      β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Layer 1: Owner Private                           β”‚
β”‚   MEMORY.md, daily logs                          β”‚
β”‚   β†’ Only the lobster's owner sees this           β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Key principle: Information flows down (company β†’ everyone), never up (private β†’ shared) without explicit action.

Memory Files Per Lobster

FileScopeDescription
MEMORY.mdOwner onlyLong-term curated memory (decisions, preferences)
memory/YYYY-MM-DD.mdOwner onlyDaily raw conversation logs
team/members/<ID>.mdOwner + controllerPersonal work style, preferences, tasks
team/channels/<ID>.mdChannel membersChannel-specific decisions and context
TEAM_MEMORY.mdAll authorized usersTeam-wide shared knowledge

Teamind β€” Collective Team Memory

The problem: Lobsters only know what happens in their own conversations. When teammates discuss decisions in a shared Slack channel, other lobsters don't know β€” leading to blind spots and repeated questions.

The solution: Teamind indexes all Slack channel messages with vector embeddings, generates thread summaries, and lets any lobster search the team's collective memory.

How It Works

Slack channels ──→ indexer.js ──→ SQLite database
                      β”‚              β”œβ”€β”€ messages (with embeddings)
                      β”‚              β”œβ”€β”€ thread_summaries (LLM-generated)
                      β”‚              └── index_state (cursor tracking)
                      β”‚
                  search.js ←── Lobster: "what was decided about X?"
                      β”‚
                  digest.js ──→ Per-lobster daily digest markdown

Components

ComponentWhat it does
setup.jsInitialize SQLite database with proper schema
indexer.jsFetch Slack history, embed messages, summarize threads
search.jsSemantic search across threads and messages
digest.jsGenerate personalized daily digest per lobster

Thread Summaries

Every thread with β‰₯3 messages gets an LLM-generated summary containing:

  • Title β€” concise description
  • Summary β€” 2-3 sentence overview
  • Thread type β€” decision / bug_fix / brainstorm / status_update / qa / casual / announcement
  • Key points β€” specific conclusions and decisions
  • Participants β€” who contributed what
  • Open items β€” unresolved tasks with assignees

Search Capabilities

# Basic semantic search
node search.js "API design decision" --json

# Composable filters
node search.js "recommendation algorithm" \
  --channel CXXXXXXXXXX \
  --type decision \
  --after 2026-03-01 \
  --participant alice \
  --limit 10 \
  --json

Returns ranked thread summaries + individual message matches with cosine similarity scores.

Daily Digest

Each lobster receives a personalized digest of threads they participated in (or high-activity threads everyone should know about). Written as markdown, easy to integrate into daily logs or MEMORY.md.

Embedding Providers

ProviderModelDimensionsCost
OpenAItext-embedding-3-small1536~$0.02/1M tokens
Geminitext-embedding-004variesFree tier available
# Incremental index every hour
0 * * * * cd scripts/teamind && node indexer.js

# Full digest daily at 04:00 UTC
0 4 * * * cd scripts/teamind && node digest.js

Self-Improving (2nd Me)

The problem: AI assistants repeat the same mistakes because they don't have structured learning from corrections.

The solution: Lobsters detect when they're corrected (using semantic understanding, not keywords), record the lesson, and periodically promote validated patterns to permanent memory.

How It Works

User corrects lobster ──→ Detect correction (semantic)
                              β”‚
                              β–Ό
                     Record in .learnings/corrections.md
                              β”‚
                              β–Ό (daily cron)
                     Review & validate lessons
                              β”‚
                              β–Ό
                     Promote to MEMORY.md / AGENTS.md

Trigger Conditions

ScenarioDetectionAction
Corrected by userSemantic detection (any phrasing)Record correction + root cause
Command failedError/exceptionRecord error + fix
Outdated knowledgeAPI behavior differs from expectationRecord knowledge gap
Better approach foundDiscovered more efficient methodRecord best practice
Complex task completedβ‰₯5 stepsSelf-reflection

Not triggered by: one-time instructions, hypothetical discussions, silence.

Storage Structure

.learnings/
β”œβ”€β”€ corrections.md      # Core: what I got wrong and why
β”œβ”€β”€ errors.md           # Command/tool failures and fixes
β”œβ”€β”€ reflections.md      # Post-task self-assessment
└── best-practices.md   # Discovered better approaches

Promotion Rules

Lessons don't stay in .learnings/ forever β€” important ones get promoted:

ConditionPromoted toExample
Affects daily workflowMEMORY.md"Always use CC for code analysis"
Tool usage patternTOOLS.md"MySQL queries need LIMIT"
Behavioral patternAGENTS.md"Confirm understanding before acting"
Same lesson β‰₯3 timesImmediate promotionβ€”

Fleet-wide Scan

# Trigger scan on all lobsters
./scripts/trigger-2nd-me-all.sh

# Single lobster
docker exec lobster-alice bash /shared/scripts/run-2nd-me-scan.sh

Recommended: daily cron at 04:00 UTC.


Skill Tier System

Skills have three access levels, controlled by manifest.json:

TierAccessExamples
baseAll lobstersteamind, self-improving, bottleneck-reporting
restrictedAllowlisted onlyfinance dashboard, HR data, admin tools
adminController onlyfleet management, credential rotation

Adding a Skill

  1. Create company-skills/<name>/SKILL.md with YAML frontmatter
  2. Register in manifest.json
  3. Run sync-company-skills.sh or restart lobsters (entrypoint auto-syncs)

Skill Discovery

The entrypoint automatically symlinks company-skills/ into each lobster's workspace/skills/, so OpenClaw discovers them on boot. No manual configuration needed per lobster.

See SKILL_POLICY.md for full spec.


Bottleneck Detection & Team Intelligence

Lobsters don't wait for users to say "I'm stuck." They detect it from conversation patterns.

How It Works

  1. Detection: Lobster notices repeated failures, missing info, or blocked processes
  2. Report: Writes structured report to /shared/bottleneck-inbox/
  3. Triage: Controller polls every 5 minutes + daily full scan
  4. Promote: Common issues β†’ company-memory/ (all lobsters learn)
  5. Escalate: Individual issues β†’ team lead notification

Bottleneck Report Format

## Bottleneck: [Title]
- **Reporter**: lobster-alice
- **User**: U0XXXXXXXXX
- **Category**: missing_access | missing_info | bug | process_blocker
- **Severity**: low | medium | high
- **Description**: What's blocking progress
- **Attempted**: What was already tried

Scripts

ScriptFrequencyWhat it does
poll-bottleneck-inbox.shEvery 5 minCheck for new reports
scan-bottlenecks.shDaily 04:00Pattern analysis across all reports

Shared Knowledge (Peer Learning)

A living document (shared-knowledge.md) that any lobster can write to:

Lobster discovers useful pattern ──→ Writes to shared-knowledge.md
                                          β”‚
                                     Other lobsters read it
                                          β”‚
                                     Controller curates weekly
                                          β”‚
                                     Best entries β†’ company-memory/

This creates a learning loop: lobsters discover β†’ share β†’ controller curates β†’ all lobsters benefit.


Security Model

Credential Isolation

FileAccessDescription
secrets.jsonRead-onlyShared API keys (injected at spawn)
personal-secrets.jsonRead-writePer-lobster private credentials
.envHost onlyMaster API keys (never mounted directly)

OpenClaw's SecretRef system ({"$ref": "secrets://KEY"}) keeps secrets out of openclaw.json.

Volume Isolation

  • Company resources: read-only mount (lobsters can't modify shared knowledge)
  • Personal workspace: read-write (isolated per lobster)
  • Bottleneck inbox: read-write (controlled shared space)

Watchdogs

WatchdogWhat it does
config-watchdog.shDead-man switch: auto-rollback config changes if not confirmed within N seconds
gateway-watchdog.shCron: auto-restart gateway if health check fails

Credential Health Check

./scripts/credential-healthcheck.sh

Verifies all lobster credentials are valid and API keys haven't expired.


Goal Orchestration (GoalOps)

Coordinate multi-lobster goals with automatic decomposition, distribution, and monitoring.

How It Works

Owner: "goal: Launch new feature by Friday"
    β”‚
    β–Ό
Controller decomposes β†’ SG-1 (backend), SG-2 (frontend), SG-3 (QA)
    β”‚
    β–Ό
Distribute to lobsters via Slack threads + task board entries
    β”‚
    β–Ό
Lobsters execute autonomously, collaborate P2P
    β”‚
    β–Ό
Patrol script detects stuck tasks β†’ nudge β†’ escalate
    β”‚
    β–Ό
Controller verifies acceptance criteria β†’ completion report

Key Features

FeatureDescription
4-phase flowDecompose β†’ Distribute β†’ Monitor β†’ Complete
Event-drivenLobsters report progress; controller reacts
Patrol fallbackBash script runs every 30 min, $0 cost when idle
P2P collaborationLobsters @mention each other directly
Task board syncAuto-creates entries in Notion/Linear/GitHub Issues
Coverage checkVerifies sub-goals fully cover the big goal

See templates/controller/goal-ops/SKILL.md for full protocol.


Proactive Task Discovery

Lobsters don't just wait for assignments β€” they actively scan for work.

How It Works

  1. Daily cron (proactive-cron.sh) nudges all lobsters
  2. Each lobster scans configured task boards for unassigned/open items
  3. Items are scored by capability match, priority, effort, and dependencies
  4. High-scoring items are proposed to the owner for approval
  5. On approval, lobster assigns itself and executes

Confidence Scoring

ScoreAction
8-10Recommend with high confidence
5-7Present with caveats
0-4Skip unless nothing else available

See templates/skills/proactive-task-engine/SKILL.md and templates/skills/task-autopilot/SKILL.md.


Coding Agent Workflow

Structured collaboration with ACP coding agents (Claude Code, Codex, Cursor).

Confidence-Based Routing

ConfidenceAction
High (8-10)Auto-execute with verification
Medium (5-7)Structured prompt, careful review
Low (1-4)Ask human before proceeding

Verification Pipeline

Every code change goes through:

  1. Automated: tests pass, lint clean, build succeeds
  2. Manual: changes match requirements, no hardcoded values, consistent style
  3. Decision: ship, iterate, or abandon

See templates/skills/coding-workflow/SKILL.md.


Monitoring & Observability

Health Check (4-point inspection)

./scripts/health-check.sh --verbose --auto-fix --notify

Checks:

  1. Container status β€” running? healthy?
  2. HTTP response β€” gateway responding?
  3. Memory usage β€” over 90% triggers alert
  4. Restart frequency β€” abnormal restarts (<5 min interval)

Recommended: cron every 30 minutes with --auto-fix --notify.

Log Patrol (3-tier alerting)

./scripts/log-patrol.sh --since 24h --notify-owner

Scans for:

  • πŸ”΄ Critical: FATAL, OOM
  • 🟑 Error: Error, rate-limit, ECONNREFUSED
  • 🟒 Warning: WARN, timeout, retry

Recommended: daily cron at 09:00 UTC.

Resource Monitor

./scripts/resource-monitor.sh --all --threshold 80

Shows: CPU%, memory usage/limit, PID count, host load average.

Owner Notification

./scripts/notify-lobster-owner.sh <name> "Your message"

Reads bot token + owner from the lobster's config automatically. Used by health-check and log-patrol for targeted alerts.


Upgrade & Rollout

Rolling Upgrade

Zero-downtime fleet upgrades with automatic canary testing:

./scripts/rolling-upgrade.sh --canary alice --batch-size 5

Process:

  1. Canary: Upgrade one lobster first
  2. Health check: Wait 90s, verify health
  3. Batch upgrade: Upgrade remaining in batches
  4. Auto-rollback: If any health check fails, revert canary + stop

Canary Rollout Tracking

Use CANARY.md (template in templates/) to track gradual feature rollouts:

### #1 β€” New Feature (Status: 🟑 canary)
- Canary group: alice, bob (2/20)
- Started: 2026-03-15
- Metrics: error rate, memory usage

Patch System

After every OpenClaw upgrade, run:

./scripts/patch-all.sh

Current patches:

PatchIssue
patch-implicit-mention.shThread messages trigger AI without @mention
patch-cc-session.shACP session requires thread binding on Slack

All Scripts Reference

Core Operations (5)

ScriptDescription
create-slack-app.shAuto-create Slack App via Manifest API
spawn-lobster.shCreate new lobster container (after create-slack-app or with tokens)
health-check.sh4-point health inspection + auto-fix
backup-lobsters.shArchive all configs and workspaces
rolling-upgrade.shCanary β†’ batch β†’ auto-rollback upgrade
enable-acp.shEnable Claude Code/ACP on a lobster

Fleet Management (5)

ScriptDescription
apply-fleet-config.shDeep-merge JSON patch into all configs
sync-fleet.shPush skills, memory, and API keys
sync-company-skills.shSymlink shared skills into workspaces
broadcast.shAI-mediated broadcast (lobster reformulates)
broadcast-direct.shDirect Slack API broadcast (guaranteed)

Monitoring (4)

ScriptDescription
log-patrol.shLog scanning with 3-tier alerting
resource-monitor.shCPU/memory/PID monitoring
notify-lobster-owner.shDM a lobster's owner via their bot
credential-healthcheck.shVerify all credentials are valid

Intelligence (4)

ScriptDescription
poll-bottleneck-inbox.shCheck for new bottleneck reports
scan-bottlenecks.shPattern analysis across all reports
run-2nd-me-scan.shSelf-improvement scan (single lobster)
trigger-2nd-me-all.shSelf-improvement scan (all lobsters)

Watchdogs & Patches (4)

ScriptDescription
config-watchdog.shDead-man switch for config changes
gateway-watchdog.shAuto-restart unhealthy gateways
patch-implicit-mention.shFix thread implicit mention behavior
patch-cc-session.shFix ACP session binding requirement

Utilities (2)

ScriptDescription
claude-wrapper.shClaude Code CLI wrapper
teamind/Group chat memory system (4 JS modules)

Total: 24 shell scripts + 4 Node.js modules


# Health check every 30 min
*/30 * * * * $(pwd)/scripts/health-check.sh --auto-fix --notify

# Log patrol daily 09:00 UTC
0 9 * * * $(pwd)/scripts/log-patrol.sh --since 24h --notify-owner

# Teamind incremental index every hour
0 * * * * cd $(pwd)/scripts/teamind && node indexer.js

# Teamind digest + 2nd Me scan daily 04:00 UTC
0 4 * * * cd $(pwd)/scripts/teamind && node digest.js
5 4 * * * $(pwd)/scripts/trigger-2nd-me-all.sh

# Bottleneck polling every 5 min
*/5 * * * * $(pwd)/scripts/poll-bottleneck-inbox.sh

# Bottleneck analysis daily 04:00 UTC
0 4 * * * $(pwd)/scripts/scan-bottlenecks.sh

# Backup weekly Sunday 03:00 UTC
0 3 * * 0 $(pwd)/scripts/backup-lobsters.sh