Concepts
How Fellowship orchestrates AI agents with memory, specs, and code review.
How It Works
When you run a task, Fellowship orchestrates a full pipeline:
The Memory System
Fellowship maintains a persistent memory that grows with every run. This is what makes Day 30 runs better than Day 1.
| File | Purpose | Updated |
|---|---|---|
learnings.md | Raw lessons from each run | After every run |
learnings-distilled.md | Consolidated top learnings (max 30) | After every run |
gotchas.md | Technical pitfalls and warnings | After every run |
architecture.md | Project architecture reference | On init/adopt |
fellowship.db | Runs, decisions, tasks, events (SQLite + FTS5) | Continuously |
How Memory Improves Runs
- Before generating a spec, Fellowship searches learnings via FTS5
- Relevant learnings + all gotchas are injected as context
- The spec includes a
## Context Consideredsection showing exactly what was used - After each run, new learnings are extracted and distilled
Spec-First Workflow
Every task gets a detailed spec before any code is written. The spec engine takes your task description and combines it with:
- Project architecture — from
architecture.md - Past learnings — full-text searched via FTS5 for relevance
- Gotchas — all known pitfalls injected as warnings
- Agent profile — role-specific guidelines and conventions
This means the agent starts with a complete picture — not just your one-liner task description. You can preview any spec before running it:
# Preview the spec without executing
fellowship run "add WebSocket support" --dry-run
# Or generate just the spec file
fellowship spec "add WebSocket support" Agents & Roles
Fellowship creates a team of specialized agents, each with a role, profile, and memory. Agents are defined in .fellowship/team.yaml and have individual profile files in .fellowship/profiles/.
A typical team might include:
- Carlos (Backend) — handles API endpoints, business logic, database queries
- Atlas (Database) — schema design, migrations, query optimization
- Merlín (Coordinator) — project-level decisions and planning
- Sentinel (Reviewer) — code review on every run
Fellowship automatically selects the right agent for each task based on the agent’s role and the task description. You can also add new agents with fellowship hire.
Writer-Reviewer Pattern
Fellowship uses a writer-reviewer pattern for every run. The coding agent (writer) implements the task, then Sentinel (reviewer) checks the code against the spec.
This creates a feedback loop:
- Writer implements the code based on the spec
- Sentinel reviews against acceptance criteria, catches bugs and edge cases
- If issues found, the writer gets feedback and fixes them
- Cycle repeats up to
maxCycles(default: 2) - After passing review, changes go to human review (if
--reviewflag used)
Sentinel — The Built-in Reviewer
Every project gets Sentinel, a dedicated AI code reviewer. Unlike using another coding agent as reviewer, Sentinel has a specialized profile focused on:
- Verifying acceptance criteria from the spec
- Catching bugs and missing edge cases
- Checking architecture compliance
- Not nitpicking style or suggesting rewrites
Sentinel reviews every run automatically. Configure via review: in config.yaml.
Background Runs
Background runs let the agent work while you keep coding. Your terminal stays free — no waiting around.
# Start a background run
fellowship run "add authentication" --bg
# Check on it any time
fellowship status
fellowship log --follow
# Review when notified
fellowship review The agent works in an isolated git worktree, so there’s zero risk of conflicts with your current work. When it finishes, you get a notification.
Notifications
Fellowship notifies you when runs complete — zero config required.
Built-in (automatic)
| Platform | Sounds | Desktop Notifications |
|---|---|---|
| macOS | afplay (Glass, Basso, Ping) | osascript (native alerts) |
| Linux | paplay / aplay | notify-send |
| Windows | PowerShell SoundPlayer | PowerShell toast (Win10/11) |
Plus: terminal flash — colored bar on completion (green / red / yellow / blue).
Additional Providers
- Telegram — set bot token + chat ID in config or env vars
- Slack — set webhook URL in
FELLOWSHIP_SLACK_WEBHOOKenv var - Custom — any shell command with env vars
Environment Variables in Hooks
| Variable | Example |
|---|---|
FELLOWSHIP_TASK | "add user authentication" |
FELLOWSHIP_AGENT | "Carlos" |
FELLOWSHIP_STATUS | completed / failed / rejected |
FELLOWSHIP_BRANCH | feat/add-user-auth |
FELLOWSHIP_DURATION | 145 (seconds) |
FELLOWSHIP_TOKENS | 31000 |
FELLOWSHIP_COST | 0.47 |
FELLOWSHIP_PR_URL | https://github.com/.../pull/5 |
Security
Fellowship includes prompt injection protection:
- 30+ detection patterns — XML tags, ChatML tokens, role markers, identity overrides, authority markers
- Sanitization on every run — Learnings, gotchas, and architecture scanned before injection
fellowship sanitize— Manual scan with severity levels- Dry-run reports —
--dry-runshows sanitization results before committing to a run - strictMode — Optional throw-on-detection for zero-tolerance environments
Skills System
Fellowship ships with built-in skills and supports project-level overrides:
fellowship/skills/ ← Built-in (shipped with CLI)
code-review.md ← Sentinel's review guidelines
.fellowship/skills/ ← Project overrides (optional)
code-review.md ← Your custom review guidelines Project skills override built-in skills with the same name. Profiles reference skills with {{skill:name}}.
Platform Support
| Feature | macOS | Linux | Windows |
|---|---|---|---|
| Core CLI | ✓ | ✓ | ✓ |
| Sounds | afplay | paplay/aplay | PowerShell |
| Desktop notifications | osascript | notify-send | PowerShell toast |
| Terminal flash | ✓ | ✓ | ✓ |
| Keychain credentials | macOS Keychain | libsecret | Credential Store |
| Background runs | ✓ | ✓ | ✓ |
Supported Providers
| Provider | Agent CLI | Model |
|---|---|---|
| Anthropic | Claude Code | claude-sonnet-4-6, claude-opus-4-6 |
| OpenAI | Codex | gpt-4o, o3-mini |