Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Content Versions

- **v52**: Generalize `/delegate` to support any task type
- Documentation clarified: works for coding, research, analysis, information gathering, documentation
- Examples updated to include non-development tasks (sports analysis, competitor pricing, academic research)
- **v51**: `/claude-code-setup` offers Agent Teams configuration
- Agent Teams status check and enable option added to `/claude-code-setup` command
- Fixes: `/claude-code-setup` used `install.sh --update --yes` which silently skipped Agent Teams
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
[![macOS](https://img.shields.io/badge/platform-macOS-blue.svg)](https://www.apple.com/macos/)
[![Linux](https://img.shields.io/badge/platform-Linux-blue.svg)](https://www.linux.org/)
[![WSL](https://img.shields.io/badge/platform-WSL-blue.svg)](https://docs.microsoft.com/en-us/windows/wsl/)
[![Content v51](https://img.shields.io/badge/content-v51-blue.svg)](CHANGELOG.md)
[![Content v52](https://img.shields.io/badge/content-v52-blue.svg)](CHANGELOG.md)

**Persistent memory for Claude Code via Markdown files.**

Expand Down
32 changes: 28 additions & 4 deletions commands/delegate.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@

Spawn a teammate to work on a separate task independently. You continue your own work and get notified when the teammate finishes.

Works for any independent task: coding, research, data analysis, information gathering, documentation, etc.

## Usage

```
/delegate "write unit tests for the auth module"
/delegate "research how other CLIs handle plugin systems, summarize findings"
/delegate "refactor the database layer to use connection pooling"
/delegate "analyze the last 10 Milan matches and summarize their performance"
/delegate "summarize key findings from the 5 most cited papers on topic X"
/delegate "compare pricing models of top 5 SaaS competitors"
```

## Tasks
Expand Down Expand Up @@ -37,12 +41,13 @@ Stop here. Do not proceed. Otherwise, continue.

### 3. Classify task type

Determine whether the delegate needs to modify repo files or only read/research:
Determine whether the delegate needs to modify repo files or only read/research.
This applies to all tasks: development work, research, analysis, documentation, etc.

| Task type | Where delegate works | Examples |
|-----------|---------------------|----------|
| **Write** (code, tests, refactoring) | `git worktree` on separate branch | "write tests", "refactor module", "add feature" |
| **Read-only** (research, analysis) | Scratchpad in `/tmp` | "research how X works", "analyze performance", "summarize findings" |
| **Write** (code, docs, config) | `git worktree` on separate branch | "write tests", "refactor module", "add feature", "add documentation to repo" |
| **Read-only** (research, analysis, information gathering) | Scratchpad in `/tmp` | "research how X works", "analyze Milan's last games", "compare competitor pricing", "summarize key findings from papers" |

### 4. Create team and spawn delegate

Expand Down Expand Up @@ -221,6 +226,25 @@ Continue your work. The delegate will:
[Delegate sends research summary]
```

### Read-only task (non-development)

```
User: /delegate "analyze Milan's last 10 matches and summarize their performance"

Claude: Analyzing task... Research only — no repo changes needed.

Delegate active for: analyze Milan's last 10 matches

sports-analyst: researching in background

Continue your work. The delegate will:
- Ask you if it needs clarification
- Notify you when done with findings

[User continues working]
[Delegate sends analysis summary with match results, stats, and performance trends]
```

### Task better suited for /with-advisor

```
Expand Down
9 changes: 6 additions & 3 deletions docs/records/038-pair-programming-with-agent-teams.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,13 @@ This should be reflected in the documentation — `/with-advisor` is not just re

An on-demand command that spawns a teammate to work on a separate task independently. The user continues their own work and gets notified when the teammate finishes.

Works for any independent task: coding, research, data analysis, information gathering, documentation, etc.

```
/delegate "write unit tests for the auth module"
/delegate "research how other CLIs handle plugin systems, summarize findings"
/delegate "refactor the database layer to use connection pooling"
/delegate "analyze Milan's last 10 matches and summarize their performance"
/delegate "compare pricing models of top 5 SaaS competitors"
```

### How it works
Expand All @@ -240,8 +243,8 @@ Delegates that need to modify files in the repo work in a **git worktree** — a

| Task type | Where delegate works | Why |
|-----------|---------------------|-----|
| Read-only (research, analysis) | Scratchpad / `/tmp` | No repo changes needed |
| Write (code, tests, refactoring) | `git worktree` on separate branch | Isolated from Main, no conflicts |
| Read-only (research, analysis, information gathering) | Scratchpad / `/tmp` | No repo changes needed |
| Write (code, docs, config) | `git worktree` on separate branch | Isolated from Main, no conflicts |

The delegate creates a worktree, works on its branch, and when done the user decides whether to merge.

Expand Down
2 changes: 1 addition & 1 deletion templates/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
51
52
2 changes: 1 addition & 1 deletion templates/base/global-CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ Use `/with-advisor` and `/delegate` during implementation when the task benefits
| Command | When | What happens |
|---------|------|-------------|
| `/with-advisor "task"` | Unfamiliar domain, multiple approaches, quality matters | Expert advisor(s) monitor your work and send findings |
| `/delegate "task"` | Independent parallel work (tests, research, refactoring) | Teammate works on separate task, notifies when done |
| `/delegate "task"` | Independent parallel work (coding, research, analysis, documentation) | Teammate works on separate task, notifies when done |

Both commands use `/catchup` for onboarding — teammates learn the project automatically.

Expand Down
10 changes: 7 additions & 3 deletions website/pages/commands/delegate.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { Callout } from 'nextra/components'

Spawn a teammate to work on a separate task independently. You keep working on your own thing and get notified when the teammate finishes.

Works for any independent task: coding, research, data analysis, information gathering, documentation, etc.

<Callout type="info">
Requires [Agent Teams](/guides/agent-teams) (experimental) to be enabled.
</Callout>
Expand All @@ -13,7 +15,9 @@ Requires [Agent Teams](/guides/agent-teams) (experimental) to be enabled.
```
/delegate "write unit tests for the auth module"
/delegate "research how other CLIs handle plugin systems"
/delegate "refactor the database layer to use connection pooling"
/delegate "analyze Milan's last 10 matches and summarize their performance"
/delegate "summarize key findings from the 5 most cited papers on topic X"
/delegate "compare pricing models of top 5 SaaS competitors"
```

## When to Use
Expand Down Expand Up @@ -47,8 +51,8 @@ Claude classifies the task automatically:

| Task type | Where delegate works | Examples |
|-----------|---------------------|----------|
| **Write** | `git worktree` on separate branch | "write tests", "refactor module", "add feature" |
| **Read-only** | Scratchpad in `/tmp` | "research how X works", "analyze logs", "summarize findings" |
| **Write** | `git worktree` on separate branch | "write tests", "refactor module", "add feature", "add documentation to repo" |
| **Read-only** | Scratchpad in `/tmp` | "research how X works", "analyze Milan's last games", "compare competitor pricing", "summarize key findings from papers" |

**Write tasks use git worktree** — the delegate works on an isolated branch, so there are no conflicts with your work. When they're done, you review and decide whether to merge.

Expand Down
5 changes: 5 additions & 0 deletions website/pages/guides/agent-teams.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,17 @@ Add to `~/.claude/settings.json`:

### Quick comparison

Both commands work for software development AND general research tasks:

```
/with-advisor "implement OAuth login"
→ Advisor challenges your approach, then advises at decision points while you implement

/delegate "write tests for the auth module"
→ Teammate writes tests, you keep coding, get notified when done

/delegate "analyze Milan's last 10 matches and summarize performance"
→ Teammate researches and summarizes, you keep working, get notified when done
```

## How Onboarding Works
Expand Down