claude-teams-brain 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/plugin.json +21 -0
- package/CHANGELOG.md +79 -0
- package/CONTRIBUTING.md +65 -0
- package/LICENSE +21 -0
- package/README.md +281 -0
- package/assets/logo.png +0 -0
- package/cli.mjs +288 -0
- package/commands/brain-clear.md +13 -0
- package/commands/brain-export.md +18 -0
- package/commands/brain-forget.md +21 -0
- package/commands/brain-github-export.md +3 -0
- package/commands/brain-query.md +18 -0
- package/commands/brain-remember.md +22 -0
- package/commands/brain-replay.md +1 -0
- package/commands/brain-runs.md +11 -0
- package/commands/brain-search.md +15 -0
- package/commands/brain-seed.md +1 -0
- package/commands/brain-stats.md +36 -0
- package/commands/brain-status.md +19 -0
- package/commands/brain-update.md +23 -0
- package/hooks/hooks.json +102 -0
- package/mcp/executor.mjs +59 -0
- package/mcp/output_filter.mjs +1029 -0
- package/mcp/server.mjs +341 -0
- package/package.json +40 -0
- package/profiles/fastapi.json +21 -0
- package/profiles/github-actions-conventions.yml +183 -0
- package/profiles/go-microservices.json +21 -0
- package/profiles/nextjs-prisma.json +22 -0
- package/profiles/python-general.json +22 -0
- package/profiles/react-native.json +21 -0
- package/scripts/brain_engine.py +1981 -0
- package/scripts/hook_runner.py +797 -0
- package/scripts/install.sh +202 -0
- package/scripts/on-pretooluse-task.sh +13 -0
- package/scripts/on-session-end.sh +23 -0
- package/scripts/on-session-start.sh +117 -0
- package/scripts/on-subagent-start.sh +76 -0
- package/scripts/on-subagent-stop.sh +97 -0
- package/scripts/on-task-completed.sh +71 -0
- package/scripts/on-teammate-idle.sh +24 -0
- package/scripts/pretooluse_inject.py +106 -0
- package/scripts/update.sh +216 -0
- package/settings.json +18 -0
- package/skills/brain-clear/SKILL.md +28 -0
- package/skills/brain-export/SKILL.md +25 -0
- package/skills/brain-forget/SKILL.md +36 -0
- package/skills/brain-github-export/SKILL.md +123 -0
- package/skills/brain-learn/SKILL.md +60 -0
- package/skills/brain-query/SKILL.md +48 -0
- package/skills/brain-remember/SKILL.md +24 -0
- package/skills/brain-replay/SKILL.md +64 -0
- package/skills/brain-runs/SKILL.md +26 -0
- package/skills/brain-search/SKILL.md +42 -0
- package/skills/brain-seed/SKILL.md +77 -0
- package/skills/brain-stats/SKILL.md +54 -0
- package/skills/brain-status/SKILL.md +33 -0
- package/skills/brain-update/SKILL.md +31 -0
- package/skills/claude-teams-brain/SKILL.md +125 -0
- package/start.mjs +3 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "claude-teams-brain",
|
|
3
|
+
"version": "1.5.1",
|
|
4
|
+
"description": "Persistent cross-session memory for Agent Teams. Automatically indexes teammate outputs, decisions, and file changes — then injects role-specific context into each new teammate so your team never starts blind.",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "claude-teams-brain contributors",
|
|
7
|
+
"url": "https://github.com/Gr122lyBr/claude-teams-brain"
|
|
8
|
+
},
|
|
9
|
+
"homepage": "https://github.com/Gr122lyBr/claude-teams-brain",
|
|
10
|
+
"repository": "https://github.com/Gr122lyBr/claude-teams-brain",
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"keywords": ["agent-teams", "memory", "context", "persistence", "multi-agent", "mcp", "token-optimization", "ai-agents", "sqlite", "claude-code"],
|
|
13
|
+
"mcpServers": {
|
|
14
|
+
"claude-teams-brain": {
|
|
15
|
+
"command": "node",
|
|
16
|
+
"args": ["${CLAUDE_PLUGIN_ROOT}/start.mjs"]
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"skills": "./skills/",
|
|
20
|
+
"commands": "./commands/"
|
|
21
|
+
}
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|
6
|
+
|
|
7
|
+
## [1.1.0] - 2026-03-10
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
- **Cross-platform Python hook runner** (`hook_runner.py`) — replaces all bash scripts; works natively on macOS, Linux, WSL2, and Windows. Requires only Python 3.8+ (already a dependency). No WSL2 required on macOS
|
|
11
|
+
- **Solo mode** — memory now builds even without Agent Teams enabled. Previous session context is injected into the main Claude instance at every `SessionStart`. Solo mode is now a first-class supported workflow
|
|
12
|
+
- **`/brain-seed <profile>`** — instantly seed the brain with pre-built stack conventions. Five built-in profiles: `nextjs-prisma`, `fastapi`, `go-microservices`, `react-native`, `python-general`. Accepts custom JSON profile files
|
|
13
|
+
- **`/brain-replay [run-id]`** — time-travel through any past session as a chronological Markdown narrative: timeline of tasks, decisions, files touched, and session summary. Use `latest` for the most recent run
|
|
14
|
+
- **`/brain-github-export`** — export CONVENTIONS.md and open a GitHub Pull Request via `gh` CLI. Includes reusable GitHub Actions workflow template (`profiles/github-actions-conventions.yml`) for automatic PR creation after every session
|
|
15
|
+
- Auto-seed from existing `.cursorrules`, `AGENTS.md`, and `CONVENTIONS.md` files at session warm-up (zero-config onboarding)
|
|
16
|
+
- New `brain_engine.py` commands: `replay-run`, `seed-profile`, `list-profiles`
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
- All hooks now use `python3 hook_runner.py <event>` instead of bash — identical behaviour, all platforms
|
|
20
|
+
- Session start message distinguishes solo mode from Agent Teams mode with appropriate messaging
|
|
21
|
+
- Agent Teams env var absence no longer shows a warning — replaced with a friendly "solo mode active" tip
|
|
22
|
+
|
|
23
|
+
## [1.0.4] - 2026-03-10
|
|
24
|
+
|
|
25
|
+
### Added
|
|
26
|
+
- Agent Teams env var check on SessionStart — warns if `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1` is not set
|
|
27
|
+
- TaskCompleted confirmation — shows `🧠 Indexed: [agent] task` so users see the brain capturing work in real time
|
|
28
|
+
- `/brain-search <query>` — search the full brain knowledge base directly from conversation
|
|
29
|
+
- `/brain-stats` — full stats summary: persistent memory + session KB
|
|
30
|
+
|
|
31
|
+
### Improved
|
|
32
|
+
- SessionStart status now shows decisions count alongside tasks and sessions
|
|
33
|
+
|
|
34
|
+
## [1.0.3] - 2026-03-10
|
|
35
|
+
|
|
36
|
+
### Added
|
|
37
|
+
- Smart context pruning: memories ranked by relevance to the current task description
|
|
38
|
+
- Command result caching in batch_execute (60s TTL) — identical commands served from cache
|
|
39
|
+
- Session warm-up: CLAUDE.md, git log, directory tree, and config files indexed at SessionStart
|
|
40
|
+
- Cache hit counter in stats output
|
|
41
|
+
|
|
42
|
+
### Improved
|
|
43
|
+
- Deduplication of decisions and files before context injection
|
|
44
|
+
- Large command output auto-summarized before indexing (keeps KB lean)
|
|
45
|
+
|
|
46
|
+
## [1.0.2] - 2026-03-10
|
|
47
|
+
|
|
48
|
+
### Added
|
|
49
|
+
- `/brain-remember <text>` — manually store rules and conventions that get injected into every future teammate
|
|
50
|
+
- `/brain-forget <text>` — remove a manually stored memory by partial text match
|
|
51
|
+
- `/brain-export` — distill all accumulated brain knowledge into a committable `CONVENTIONS.md` file
|
|
52
|
+
- Manual memories shown as "Project Rules & Conventions" section in teammate context (before team decisions)
|
|
53
|
+
|
|
54
|
+
## [1.0.1] - 2026-03-10
|
|
55
|
+
|
|
56
|
+
### Added
|
|
57
|
+
- `/brain-update` skill — pull the latest version from GitHub without reinstalling
|
|
58
|
+
- Version check on `SessionStart` — non-intrusive hint when a new version is available
|
|
59
|
+
- Token-efficient tool guidance injected into every subagent on spawn (`batch_execute`, `search`, `execute`, `index`)
|
|
60
|
+
- Skill files for all user commands: `brain-status`, `brain-query`, `brain-runs`, `brain-clear`
|
|
61
|
+
- First-run welcome message on cold start (empty brain)
|
|
62
|
+
- `SECURITY.md` with vulnerability reporting process
|
|
63
|
+
- GitHub Actions CI — validates JSON, lints shell scripts, checks Python syntax, enforces version consistency
|
|
64
|
+
|
|
65
|
+
### Fixed
|
|
66
|
+
- `marketplace.json` source path corrected to `./claude-teams-brain`
|
|
67
|
+
|
|
68
|
+
## [1.0.0] - 2026-02-10
|
|
69
|
+
|
|
70
|
+
### Added
|
|
71
|
+
|
|
72
|
+
- Persistent memory system for Claude Code Agent Teams
|
|
73
|
+
- SQLite brain engine with FTS5 full-text search (`brain_engine.py`)
|
|
74
|
+
- 6 lifecycle hooks: SessionStart, SubagentStart, TaskCompleted, SubagentStop, TeammateIdle, SessionEnd
|
|
75
|
+
- Auto-injection of context from past sessions into agent conversations
|
|
76
|
+
- 4 user commands: `brain-status`, `brain-query`, `brain-runs`, `brain-clear`
|
|
77
|
+
- Semantic memory organization by topic
|
|
78
|
+
- Claude Code marketplace plugin integration
|
|
79
|
+
- Configurable settings via `settings.json`
|
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# Contributing to Claude Teams Brain
|
|
2
|
+
|
|
3
|
+
Thank you for your interest in contributing. This guide covers how to get involved.
|
|
4
|
+
|
|
5
|
+
## Bug Reports
|
|
6
|
+
|
|
7
|
+
Open an issue with:
|
|
8
|
+
|
|
9
|
+
- A clear, descriptive title
|
|
10
|
+
- Steps to reproduce the problem
|
|
11
|
+
- Expected vs actual behavior
|
|
12
|
+
- Your environment (OS, shell, Claude Code version)
|
|
13
|
+
|
|
14
|
+
## Feature Requests
|
|
15
|
+
|
|
16
|
+
Open an issue describing:
|
|
17
|
+
|
|
18
|
+
- The problem your feature would solve
|
|
19
|
+
- Your proposed solution
|
|
20
|
+
- Any alternatives you considered
|
|
21
|
+
|
|
22
|
+
## Pull Requests
|
|
23
|
+
|
|
24
|
+
1. Fork the repository
|
|
25
|
+
2. Create a feature branch (`git checkout -b feature/your-feature`)
|
|
26
|
+
3. Make your changes
|
|
27
|
+
4. Commit with a clear message (see Commit Messages below)
|
|
28
|
+
5. Push to your fork and open a pull request
|
|
29
|
+
|
|
30
|
+
Keep PRs focused on a single change. Include a description of what changed and why.
|
|
31
|
+
|
|
32
|
+
## Code Style
|
|
33
|
+
|
|
34
|
+
- **Python**: Follow PEP 8. Run a linter before submitting.
|
|
35
|
+
- **Shell scripts**: Write shellcheck-compatible scripts. Use `set -euo pipefail` where appropriate.
|
|
36
|
+
|
|
37
|
+
## Development Setup
|
|
38
|
+
|
|
39
|
+
1. Clone the repo and install the plugin locally:
|
|
40
|
+
```bash
|
|
41
|
+
git clone https://github.com/Gr122lyBr/claude-teams-brain
|
|
42
|
+
# In Claude Code:
|
|
43
|
+
/plugin marketplace add /path/to/clone
|
|
44
|
+
/plugin install claude-teams-brain@claude-teams-brain
|
|
45
|
+
```
|
|
46
|
+
2. Make changes to scripts or the MCP server, then reload Claude Code.
|
|
47
|
+
3. Inspect the brain database at any time:
|
|
48
|
+
```bash
|
|
49
|
+
sqlite3 ~/.claude-teams-brain/projects/<hash>/brain.db ".tables"
|
|
50
|
+
```
|
|
51
|
+
4. Test the brain engine directly:
|
|
52
|
+
```bash
|
|
53
|
+
python3 scripts/brain_engine.py status /your/project/path
|
|
54
|
+
python3 scripts/brain_engine.py query-role backend /your/project/path
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
**Requirements:** Python 3.8+, Node.js 18+, Claude Code v2.1+
|
|
58
|
+
|
|
59
|
+
## Testing
|
|
60
|
+
|
|
61
|
+
The project does not yet have an automated test suite. When adding new functionality, manually verify using the steps above and check brain output with `/claude-teams-brain:brain-status`.
|
|
62
|
+
|
|
63
|
+
## Commit Messages
|
|
64
|
+
|
|
65
|
+
Use the imperative mood in the subject line (e.g., "Add feature" not "Added feature"). Keep the subject under 72 characters. Use the body to explain what and why, not how.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025–2026 Shay Tal
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="assets/logo.png" alt="claude-teams-brain" width="120" />
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
# claude-teams-brain
|
|
6
|
+
|
|
7
|
+
[](LICENSE)
|
|
8
|
+
[](https://python.org)
|
|
9
|
+
[](https://nodejs.org)
|
|
10
|
+
[](https://claude.ai/claude-code)
|
|
11
|
+
|
|
12
|
+
**Persistent cross-session memory for Claude Code Agent Teams.**
|
|
13
|
+
|
|
14
|
+
Claude Code's Agent Teams are powerful — but ephemeral. Every teammate spawns with a blank slate. Every session forgets what the last one built. claude-teams-brain fixes this by automatically indexing everything your team produces and injecting role-specific memory into every new teammate the moment they spawn.
|
|
15
|
+
|
|
16
|
+
Your AI team gets smarter with every session. No extra prompting. No manual context copying. No more starting from zero.
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Why this matters
|
|
21
|
+
|
|
22
|
+
Agent Teams introduced true multi-agent parallelism to Claude Code — teammates that communicate directly, own separate file scopes, and collaborate without a single-session bottleneck. But they have one fundamental weakness:
|
|
23
|
+
|
|
24
|
+
> *Teammates exist for the duration of a session and then they're gone. No persistent identity, no memory across sessions, no `/resume`.*
|
|
25
|
+
|
|
26
|
+
This creates a compounding problem on real projects. Your backend agent spent two hours establishing architecture decisions, learning your conventions, and building the auth system. Tomorrow, a new backend agent spawns and rediscovers everything from scratch — making inconsistent decisions, touching files already settled, asking questions already answered.
|
|
27
|
+
|
|
28
|
+
claude-teams-brain solves this at the infrastructure level. It hooks into the Agent Teams lifecycle, indexes every task completion, file change, and architectural decision, and injects the relevant history directly into each new teammate's context before they write a single line of code.
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## How it works
|
|
33
|
+
|
|
34
|
+
claude-teams-brain hooks into six lifecycle events:
|
|
35
|
+
|
|
36
|
+
| Hook | What happens |
|
|
37
|
+
|------|-------------|
|
|
38
|
+
| `SessionStart` | Brain initializes, reports how much memory exists for this project |
|
|
39
|
+
| `SubagentStart` | ⭐ Role-specific memory injected directly into each new teammate |
|
|
40
|
+
| `TaskCompleted` | Task subject and agent identity indexed immediately on completion |
|
|
41
|
+
| `SubagentStop` | Rich indexing: files touched, decisions made, output summary extracted from transcript |
|
|
42
|
+
| `TeammateIdle` | Passive checkpoint |
|
|
43
|
+
| `SessionEnd` | Full session compressed into a summary entry |
|
|
44
|
+
|
|
45
|
+
The `SubagentStart` hook is the core mechanism. When a teammate named `backend` spawns, the brain queries everything the backend agent has done across all past sessions — tasks completed, files owned, decisions made — and injects it as context before the agent processes its first message. The teammate starts informed, not blank.
|
|
46
|
+
|
|
47
|
+
All data lives in `~/.claude-teams-brain/projects/<project-hash>/brain.db` — a local SQLite database. Nothing is sent anywhere. No external dependencies beyond Python 3.8+ stdlib.
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## MCP Tools
|
|
52
|
+
|
|
53
|
+
claude-teams-brain includes an MCP server that exposes five tools to all Task subagents. These tools keep large command output out of context windows by indexing it into a session knowledge base and returning only relevant search results.
|
|
54
|
+
|
|
55
|
+
### batch_execute
|
|
56
|
+
|
|
57
|
+
Run multiple shell commands, auto-index all output, and search with queries in a single call.
|
|
58
|
+
|
|
59
|
+
```json
|
|
60
|
+
{
|
|
61
|
+
"commands": [
|
|
62
|
+
{"label": "git log", "command": "git log --oneline -20"},
|
|
63
|
+
{"label": "test results", "command": "npm test 2>&1"}
|
|
64
|
+
],
|
|
65
|
+
"queries": ["recent commits about auth", "failing tests"],
|
|
66
|
+
"timeout": 60000
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### search
|
|
71
|
+
|
|
72
|
+
Search the session knowledge base built by previous batch_execute or index calls.
|
|
73
|
+
|
|
74
|
+
```json
|
|
75
|
+
{
|
|
76
|
+
"queries": ["authentication middleware", "error handling patterns"],
|
|
77
|
+
"limit": 3
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### index
|
|
82
|
+
|
|
83
|
+
Manually index content (findings, analysis, data) for later retrieval.
|
|
84
|
+
|
|
85
|
+
```json
|
|
86
|
+
{
|
|
87
|
+
"content": "The auth module uses RS256 JWT tokens with 15-minute expiry...",
|
|
88
|
+
"source": "auth-analysis"
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### execute
|
|
93
|
+
|
|
94
|
+
Run code in a sandboxed subprocess. Set `intent` to auto-index and search large output.
|
|
95
|
+
|
|
96
|
+
```json
|
|
97
|
+
{
|
|
98
|
+
"language": "python",
|
|
99
|
+
"code": "import ast; print(ast.dump(ast.parse(open('main.py').read())))",
|
|
100
|
+
"timeout": 30000,
|
|
101
|
+
"intent": "find all class definitions"
|
|
102
|
+
}
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Supported languages: `shell`, `javascript`, `python`.
|
|
106
|
+
|
|
107
|
+
### stats
|
|
108
|
+
|
|
109
|
+
Show session context savings metrics.
|
|
110
|
+
|
|
111
|
+
```json
|
|
112
|
+
{}
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
Returns bytes indexed vs bytes returned, call counts, and context savings ratio.
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## Installation
|
|
120
|
+
|
|
121
|
+
**Requirements:** Python 3.8+, Node.js 18+, Claude Code v2.1+
|
|
122
|
+
|
|
123
|
+
### 1. Install the plugin
|
|
124
|
+
|
|
125
|
+
In Claude Code, run:
|
|
126
|
+
|
|
127
|
+
```
|
|
128
|
+
/plugin marketplace add https://github.com/Gr122lyBr/claude-teams-brain
|
|
129
|
+
/plugin install claude-teams-brain@claude-teams-brain
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### 2. Enable Agent Teams
|
|
133
|
+
|
|
134
|
+
Add to `~/.claude/settings.json`:
|
|
135
|
+
|
|
136
|
+
```json
|
|
137
|
+
{
|
|
138
|
+
"env": {
|
|
139
|
+
"CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1"
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
If `settings.json` already has content, merge the `env` block:
|
|
145
|
+
|
|
146
|
+
```json
|
|
147
|
+
{
|
|
148
|
+
"someExistingSetting": true,
|
|
149
|
+
"env": {
|
|
150
|
+
"YOUR_EXISTING_VAR": "value",
|
|
151
|
+
"CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1"
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
Restart Claude Code after saving.
|
|
157
|
+
|
|
158
|
+
### 3. Configure CLAUDE.md (recommended)
|
|
159
|
+
|
|
160
|
+
Add to your project's `CLAUDE.md` to make Claude automatically use Agent Teams:
|
|
161
|
+
|
|
162
|
+
```markdown
|
|
163
|
+
## Agent Teams
|
|
164
|
+
|
|
165
|
+
Always use agent teams for tasks that can be parallelized across concerns.
|
|
166
|
+
Spawn specialized teammates with role-specific names rather than doing everything
|
|
167
|
+
in a single session. Good team structures:
|
|
168
|
+
|
|
169
|
+
- Feature work: `backend`, `frontend`, `tests`
|
|
170
|
+
- Reviews: `security`, `performance`, `coverage`
|
|
171
|
+
- Architecture: `architect`, `devil-advocate`, `implementer`
|
|
172
|
+
- Debugging: name teammates after the hypothesis they're testing
|
|
173
|
+
|
|
174
|
+
The claude-teams-brain plugin is active — each teammate will automatically receive
|
|
175
|
+
memory from past sessions relevant to their role.
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
## Usage
|
|
181
|
+
|
|
182
|
+
Once installed, the brain works silently in the background. Just use Agent Teams normally.
|
|
183
|
+
|
|
184
|
+
**First session (cold start):**
|
|
185
|
+
```
|
|
186
|
+
You: Create an agent team to build the payments module.
|
|
187
|
+
backend: API endpoints and business logic
|
|
188
|
+
database: schema and migrations
|
|
189
|
+
tests: integration test coverage
|
|
190
|
+
|
|
191
|
+
[Agent Teams session runs — claude-teams-brain indexes everything]
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
**Second session (warm start):**
|
|
195
|
+
```
|
|
196
|
+
You: Create an agent team to add webhook support to payments.
|
|
197
|
+
backend: extend the existing payment API
|
|
198
|
+
|
|
199
|
+
[backend agent spawns and immediately receives:]
|
|
200
|
+
"## 🧠 claude-teams-brain: Memory for role [backend]
|
|
201
|
+
|
|
202
|
+
### Your Past Work
|
|
203
|
+
- Built payment API endpoints in /src/payments/api.ts
|
|
204
|
+
- Implemented idempotency key validation middleware
|
|
205
|
+
|
|
206
|
+
### Key Team Decisions
|
|
207
|
+
- [database] Using UUID v7 for all payment record IDs
|
|
208
|
+
- [backend] Chose RS256 over HS256 for JWT — better key rotation
|
|
209
|
+
- [backend] All payment endpoints require idempotency keys
|
|
210
|
+
|
|
211
|
+
### Files You Own
|
|
212
|
+
- /src/payments/api.ts
|
|
213
|
+
- /src/payments/middleware/idempotency.ts"
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
The teammate starts with full context from day one.
|
|
217
|
+
|
|
218
|
+
---
|
|
219
|
+
|
|
220
|
+
## Commands
|
|
221
|
+
|
|
222
|
+
| Command | Description |
|
|
223
|
+
|---------|-------------|
|
|
224
|
+
| `/claude-teams-brain:brain-status` | Memory stats for this project |
|
|
225
|
+
| `/claude-teams-brain:brain-query <role>` | Preview the context a new teammate would receive |
|
|
226
|
+
| `/claude-teams-brain:brain-runs` | List past Agent Team sessions |
|
|
227
|
+
| `/claude-teams-brain:brain-clear` | Reset all memory for this project |
|
|
228
|
+
|
|
229
|
+
---
|
|
230
|
+
|
|
231
|
+
## Project structure
|
|
232
|
+
|
|
233
|
+
```
|
|
234
|
+
claude-teams-brain/ ← repo root (marketplace)
|
|
235
|
+
.claude-plugin/
|
|
236
|
+
marketplace.json
|
|
237
|
+
claude-teams-brain/ ← the plugin
|
|
238
|
+
.claude-plugin/
|
|
239
|
+
plugin.json
|
|
240
|
+
hooks/
|
|
241
|
+
hooks.json ← 6 lifecycle hooks
|
|
242
|
+
scripts/
|
|
243
|
+
brain_engine.py ← SQLite engine (pure stdlib)
|
|
244
|
+
on-session-start.sh
|
|
245
|
+
on-subagent-start.sh ← core: injects memory into teammates
|
|
246
|
+
on-subagent-stop.sh ← rich indexing from transcript
|
|
247
|
+
on-task-completed.sh
|
|
248
|
+
on-teammate-idle.sh
|
|
249
|
+
on-session-end.sh
|
|
250
|
+
commands/ ← /brain-* slash commands
|
|
251
|
+
skills/claude-teams-brain/ ← auto-activates for agent team workflows
|
|
252
|
+
settings.json ← enables CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
---
|
|
256
|
+
|
|
257
|
+
## Memory storage
|
|
258
|
+
|
|
259
|
+
```
|
|
260
|
+
~/.claude-teams-brain/
|
|
261
|
+
└── projects/
|
|
262
|
+
└── <project-hash>/
|
|
263
|
+
└── brain.db ← SQLite, one file per project
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
Each project has its own isolated brain. Memory never crosses project boundaries. The SQLite file is fully inspectable with any database viewer.
|
|
267
|
+
|
|
268
|
+
---
|
|
269
|
+
|
|
270
|
+
## Tips
|
|
271
|
+
|
|
272
|
+
- **Use descriptive agent names** that match their role (`backend`, `database`, `security`) — the brain routes memory by role name
|
|
273
|
+
- **Memory compounds** — the first session is cold, but quality improves significantly from the second session onwards
|
|
274
|
+
- **Check `/claude-teams-brain:brain-status`** before starting a large session to confirm memory is available
|
|
275
|
+
- **Run `/claude-teams-brain:brain-query backend`** to preview exactly what context the backend agent will receive before spawning
|
|
276
|
+
|
|
277
|
+
---
|
|
278
|
+
|
|
279
|
+
## License
|
|
280
|
+
|
|
281
|
+
MIT
|
package/assets/logo.png
ADDED
|
Binary file
|