@brianluby/agent-brain 1.1.0
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/marketplace.json +16 -0
- package/.claude-plugin/plugin.json +12 -0
- package/LICENSE +21 -0
- package/README.md +249 -0
- package/commands/ask.md +27 -0
- package/commands/recent.md +27 -0
- package/commands/search.md +27 -0
- package/commands/stats.md +21 -0
- package/dist/hooks/hooks.json +44 -0
- package/dist/hooks/post-tool-use.js +1643 -0
- package/dist/hooks/post-tool-use.js.map +1 -0
- package/dist/hooks/session-start.js +554 -0
- package/dist/hooks/session-start.js.map +1 -0
- package/dist/hooks/smart-install.js +109 -0
- package/dist/hooks/smart-install.js.map +1 -0
- package/dist/hooks/stop.js +1386 -0
- package/dist/hooks/stop.js.map +1 -0
- package/dist/index.d.ts +397 -0
- package/dist/index.js +1236 -0
- package/dist/index.js.map +1 -0
- package/dist/opencode/plugin.d.ts +5 -0
- package/dist/opencode/plugin.js +1820 -0
- package/dist/opencode/plugin.js.map +1 -0
- package/dist/scripts/ask.js +213 -0
- package/dist/scripts/ask.js.map +1 -0
- package/dist/scripts/find.js +213 -0
- package/dist/scripts/find.js.map +1 -0
- package/dist/scripts/stats.js +225 -0
- package/dist/scripts/stats.js.map +1 -0
- package/dist/scripts/timeline.js +210 -0
- package/dist/scripts/timeline.js.map +1 -0
- package/package.json +91 -0
- package/skills/memory/SKILL.md +71 -0
- package/skills/mind/SKILL.md +71 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "memvid",
|
|
3
|
+
"description": "Official Memvid plugins for Claude Code",
|
|
4
|
+
"owner": {
|
|
5
|
+
"name": "Memvid",
|
|
6
|
+
"url": "https://memvid.com"
|
|
7
|
+
},
|
|
8
|
+
"plugins": [
|
|
9
|
+
{
|
|
10
|
+
"name": "mind",
|
|
11
|
+
"description": "Agent-Brain - Give Claude photographic memory in ONE portable file",
|
|
12
|
+
"version": "1.1.0",
|
|
13
|
+
"source": "./"
|
|
14
|
+
}
|
|
15
|
+
]
|
|
16
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "mind",
|
|
3
|
+
"description": "Claude Mind - Give Claude photographic memory in ONE portable file. Share, version, and transfer your Claude's brain.",
|
|
4
|
+
"version": "1.1.0",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "Memvid",
|
|
7
|
+
"url": "https://memvid.com"
|
|
8
|
+
},
|
|
9
|
+
"repository": "https://github.com/brianluby/Agent-brain",
|
|
10
|
+
"homepage": "https://memvid.com",
|
|
11
|
+
"license": "MIT"
|
|
12
|
+
}
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Memvid
|
|
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,249 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
<img src="agent-brain.png" alt="Agent Brain" width="320" />
|
|
4
|
+
|
|
5
|
+
### Give your agents photographic memory.
|
|
6
|
+
|
|
7
|
+
[](https://opensource.org/licenses/MIT)
|
|
8
|
+
|
|
9
|
+
<br />
|
|
10
|
+
|
|
11
|
+
**[Install in 30 seconds](#installation)** · [How it Works](#how-it-works) · [Commands](#commands) ·
|
|
12
|
+
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
<br />
|
|
16
|
+
|
|
17
|
+
## Memvid Shoutout
|
|
18
|
+
|
|
19
|
+
Memvid's creative approach to data storage—encoding text in video frames and using decades of video codec R&D for superior compression—inspired me to fork their Claude Brain project into an agent-agnostic version. None of this would be possible without their dedication to open source. If you're working on AI memory, check them out at [github.com/memvid](https://github.com/memvid) —it's seriously clever engineering.
|
|
20
|
+
|
|
21
|
+
## The Problem
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
You: "Remember that auth bug we fixed?"
|
|
25
|
+
Agent 1: "I don't have memory of previous conversations."
|
|
26
|
+
Agent 2: "I did not work on this code yesterday.
|
|
27
|
+
You: "We spent 3 hours on it yesterday"
|
|
28
|
+
Agent 1: "I'd be happy to help debug from scratch!"
|
|
29
|
+
Agent 2: "Let me review the codebase to get an understanding" *sound of tokens burning*
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
**small context window. Zero memory between sessions.**
|
|
33
|
+
|
|
34
|
+
You're paying for a dory with a PhD.
|
|
35
|
+
|
|
36
|
+
<br />
|
|
37
|
+
|
|
38
|
+
## The Fix
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
You: "What did we decide about auth?"
|
|
42
|
+
Agent 1: "We chose JWT over sessions for your microservices.
|
|
43
|
+
The refresh token issue - here's exactly what we fixed..."
|
|
44
|
+
Agent 2: " JWT overs sessions is a more secure implementation, Here is the code we fixed"
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
One file. All your agents remember everything.
|
|
48
|
+
|
|
49
|
+
<br />
|
|
50
|
+
|
|
51
|
+
## Installation
|
|
52
|
+
|
|
53
|
+
### Claude Code (Marketplace)
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
# Optional one-time setup (if GitHub plugin URLs fail)
|
|
57
|
+
git config --global url."https://github.com/".insteadOf "git@github.com:"
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
# In Claude Code
|
|
62
|
+
/plugin add marketplace brianluby/Agent-brain
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Then in Claude Code:
|
|
66
|
+
|
|
67
|
+
1. Open `/plugins`
|
|
68
|
+
2. Go to **Installed**
|
|
69
|
+
3. Enable **mind**
|
|
70
|
+
4. Restart Claude Code
|
|
71
|
+
|
|
72
|
+
On first run, memory is created at:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
.agent-brain/mind.mv2
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
If you already have a legacy file at `.claude/mind.mv2`, migrate it safely to `.agent-brain/mind.mv2`:
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
if [ ! -f ".agent-brain/mind.mv2" ]; then
|
|
82
|
+
mkdir -p ".agent-brain" && mv ".claude/mind.mv2" ".agent-brain/mind.mv2"
|
|
83
|
+
else
|
|
84
|
+
echo "Destination .agent-brain/mind.mv2 already exists. Back up both .claude/mind.mv2 and .agent-brain/mind.mv2, then reconcile manually."
|
|
85
|
+
fi
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### OpenCode
|
|
89
|
+
|
|
90
|
+
Add this plugin package to your OpenCode config:
|
|
91
|
+
|
|
92
|
+
```json
|
|
93
|
+
{
|
|
94
|
+
"$schema": "https://opencode.ai/config.json",
|
|
95
|
+
"plugin": ["@brianluby/agent-brain"]
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Or use a local checkout while developing:
|
|
100
|
+
|
|
101
|
+
```json
|
|
102
|
+
{
|
|
103
|
+
"$schema": "https://opencode.ai/config.json",
|
|
104
|
+
"plugin": ["file:///absolute/path/to/agent-brain"]
|
|
105
|
+
}
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Then restart OpenCode. The plugin will:
|
|
109
|
+
|
|
110
|
+
- inject memory context on the first message of each session
|
|
111
|
+
- capture tool outputs to persistent memory
|
|
112
|
+
- expose a `mind` tool (`search`, `ask`, `recent`, `stats`, `remember`)
|
|
113
|
+
|
|
114
|
+
Optional: install OpenCode slash commands globally for all projects:
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
mkdir -p ~/.config/opencode/commands
|
|
118
|
+
cp .opencode/commands/mind-*.md ~/.config/opencode/commands/
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
Project-local command files are already included in `.opencode/commands/`.
|
|
122
|
+
|
|
123
|
+
<br />
|
|
124
|
+
|
|
125
|
+
## How it Works
|
|
126
|
+
|
|
127
|
+
After install, Your Agent's memory lives in one file:
|
|
128
|
+
|
|
129
|
+
```
|
|
130
|
+
your-project/
|
|
131
|
+
└── .agent-brain/
|
|
132
|
+
└── mind.mv2 # Agent's brain. That's it.
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
No database. No cloud. No API keys.
|
|
136
|
+
|
|
137
|
+
**What gets captured:**
|
|
138
|
+
- Session context, decisions, bugs, solutions
|
|
139
|
+
- Auto-injected at session start
|
|
140
|
+
- Searchable anytime
|
|
141
|
+
|
|
142
|
+
**Why one file?**
|
|
143
|
+
- `git commit` → version control Agent's brain
|
|
144
|
+
- `scp` → transfer anywhere
|
|
145
|
+
- Send to teammate → instant onboarding
|
|
146
|
+
|
|
147
|
+
<br />
|
|
148
|
+
|
|
149
|
+
## Commands
|
|
150
|
+
|
|
151
|
+
**In Claude Code:**
|
|
152
|
+
```bash
|
|
153
|
+
/mind stats # memory statistics
|
|
154
|
+
/mind search "authentication" # find past context
|
|
155
|
+
/mind ask "why did we choose X?" # ask your memory
|
|
156
|
+
/mind recent # what happened lately
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
**In OpenCode (slash commands):**
|
|
160
|
+
```bash
|
|
161
|
+
/mind-stats
|
|
162
|
+
/mind-search authentication
|
|
163
|
+
/mind-ask "why did we choose X?"
|
|
164
|
+
/mind-recent
|
|
165
|
+
/mind-remember "Project uses pnpm, not npm"
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
These are provided in `.opencode/commands/` for project-local usage.
|
|
169
|
+
To use them in every repo, copy them to `~/.config/opencode/commands/`.
|
|
170
|
+
|
|
171
|
+
Or just ask naturally: *"mind stats"*, *"search my memory for auth bugs"*, etc.
|
|
172
|
+
|
|
173
|
+
## OpenCode Support
|
|
174
|
+
|
|
175
|
+
Memvid Mind now supports the same core memory lifecycle through a platform adapter model.
|
|
176
|
+
|
|
177
|
+
- Claude and OpenCode sessions can share project memory continuity.
|
|
178
|
+
- Unknown or incompatible platforms fail open (session continues, memory capture safely skips).
|
|
179
|
+
- Adapter contracts are SemVer-checked and validated through regression and contract tests.
|
|
180
|
+
- OpenCode packaging is published through the npm package `@brianluby/agent-brain`.
|
|
181
|
+
|
|
182
|
+
<br />
|
|
183
|
+
|
|
184
|
+
## CLI (Optional)
|
|
185
|
+
|
|
186
|
+
For power users who want direct access to their memory file:
|
|
187
|
+
|
|
188
|
+
```bash
|
|
189
|
+
npm install -g memvid-cli
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
```bash
|
|
193
|
+
memvid stats .agent-brain/mind.mv2 # view memory stats
|
|
194
|
+
memvid find .agent-brain/mind.mv2 "auth" # search memories
|
|
195
|
+
memvid ask .agent-brain/mind.mv2 "why JWT?" # ask questions
|
|
196
|
+
memvid timeline .agent-brain/mind.mv2 # view timeline
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
[Full CLI reference →](https://docs.memvid.com/cli/cheat-sheet)
|
|
200
|
+
|
|
201
|
+
<br />
|
|
202
|
+
|
|
203
|
+
## FAQ
|
|
204
|
+
|
|
205
|
+
<details>
|
|
206
|
+
<summary><b>How big is the file?</b></summary>
|
|
207
|
+
|
|
208
|
+
Empty: ~70KB. Grows ~1KB per memory. A year of use stays under 5MB.
|
|
209
|
+
|
|
210
|
+
</details>
|
|
211
|
+
|
|
212
|
+
<details>
|
|
213
|
+
<summary><b>Is it private?</b></summary>
|
|
214
|
+
|
|
215
|
+
100% local. Nothing leaves your machine. Ever.
|
|
216
|
+
|
|
217
|
+
</details>
|
|
218
|
+
|
|
219
|
+
<details>
|
|
220
|
+
<summary><b>How fast?</b></summary>
|
|
221
|
+
|
|
222
|
+
Sub-millisecond. Native Rust core. Searches 10K+ memories in <1ms.
|
|
223
|
+
|
|
224
|
+
</details>
|
|
225
|
+
|
|
226
|
+
<details>
|
|
227
|
+
<summary><b>Reset memory?</b></summary>
|
|
228
|
+
|
|
229
|
+
`rm .agent-brain/mind.mv2`
|
|
230
|
+
|
|
231
|
+
</details>
|
|
232
|
+
|
|
233
|
+
<br />
|
|
234
|
+
|
|
235
|
+
---
|
|
236
|
+
|
|
237
|
+
<div align="center">
|
|
238
|
+
|
|
239
|
+
Built on **[memvid](https://github.com/brianluby/memvid)** - the single-file memory engine
|
|
240
|
+
|
|
241
|
+
<br />
|
|
242
|
+
|
|
243
|
+
**If this saved you time, [star the repo](https://github.com/brianluby/Agent-brain)**
|
|
244
|
+
|
|
245
|
+
<br />
|
|
246
|
+
|
|
247
|
+
*Send me your `.mv2` file and I'll tell you what's wrong with your code. No context needed - I already know everything.*
|
|
248
|
+
|
|
249
|
+
</div>
|
package/commands/ask.md
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Ask questions about memories and get context-aware answers
|
|
3
|
+
argument-hint: <question>
|
|
4
|
+
allowed-tools: Bash
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Memory Question
|
|
8
|
+
|
|
9
|
+
Ask Claude's memory system questions about past work, decisions, and context.
|
|
10
|
+
|
|
11
|
+
**Usage**: `/mind:ask <question>`
|
|
12
|
+
|
|
13
|
+
Execute the ask script with user's question:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
node "${CLAUDE_PLUGIN_ROOT}/dist/scripts/ask.js" "$ARGUMENTS"
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Examples
|
|
20
|
+
- `/mind:ask Why did we choose React?` - Get context about technology decisions
|
|
21
|
+
- `/mind:ask What was the CORS solution?` - Recall specific solutions
|
|
22
|
+
- `/mind:ask How did we fix the authentication bug?` - Get details about past fixes
|
|
23
|
+
|
|
24
|
+
## Response Format
|
|
25
|
+
- Provide context-aware answers based on stored memories
|
|
26
|
+
- Reference specific memories when applicable
|
|
27
|
+
- Include timestamps for referenced information
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Show recent memories and activity timeline
|
|
3
|
+
argument-hint: [count]
|
|
4
|
+
allowed-tools: Bash
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Recent Memories
|
|
8
|
+
|
|
9
|
+
Display the most recent memories and activity from Claude's persistent storage.
|
|
10
|
+
|
|
11
|
+
**Usage**: `/mind:recent [count]`
|
|
12
|
+
|
|
13
|
+
Execute the timeline script to show recent activity:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
node "${CLAUDE_PLUGIN_ROOT}/dist/scripts/timeline.js" ${ARGUMENTS:-20}
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Examples
|
|
20
|
+
- `/mind:recent` - Show 20 most recent memories (default)
|
|
21
|
+
- `/mind:recent 10` - Show 10 most recent memories
|
|
22
|
+
- `/mind:recent 50` - Show 50 most recent memories
|
|
23
|
+
|
|
24
|
+
## Response Format
|
|
25
|
+
- Display memories in reverse chronological order (newest first)
|
|
26
|
+
- Convert timestamps to human-readable format
|
|
27
|
+
- Group by session or time period when helpful
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Search memories for specific content or patterns
|
|
3
|
+
argument-hint: <query> [limit]
|
|
4
|
+
allowed-tools: Bash
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Memory Search
|
|
8
|
+
|
|
9
|
+
Search through Claude's persistent memories for specific content, patterns, or keywords.
|
|
10
|
+
|
|
11
|
+
**Usage**: `/mind:search <query> [limit]`
|
|
12
|
+
|
|
13
|
+
Execute the search script with user's query:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
node "${CLAUDE_PLUGIN_ROOT}/dist/scripts/find.js" "$ARGUMENTS" 10
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Examples
|
|
20
|
+
- `/mind:search authentication` - Find memories related to authentication
|
|
21
|
+
- `/mind:search "database schema"` - Search for exact phrase
|
|
22
|
+
- `/mind:search API errors` - Find memories about API errors
|
|
23
|
+
|
|
24
|
+
## Response Format
|
|
25
|
+
- Show matching memories with relevance scores
|
|
26
|
+
- Include timestamps (convert to human-readable format)
|
|
27
|
+
- Highlight matched keywords in context
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Show memory statistics and storage information
|
|
3
|
+
allowed-tools: Bash
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Memory Statistics
|
|
7
|
+
|
|
8
|
+
Show statistics about Claude's persistent memory file including total memories, storage size, and recent activity.
|
|
9
|
+
|
|
10
|
+
**Usage**: `/mind:stats`
|
|
11
|
+
|
|
12
|
+
Execute the stats script:
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
node "${CLAUDE_PLUGIN_ROOT}/dist/scripts/stats.js"
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Response Format
|
|
19
|
+
- Convert Unix timestamps to human-readable (Xm ago, Xh ago, Xd ago)
|
|
20
|
+
- Summarize key findings in a table when appropriate
|
|
21
|
+
- If file was just created, tell the user memories will appear as they work
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "Memvid Mind - Persistent memory for Claude Code and OpenCode",
|
|
3
|
+
"hooks": {
|
|
4
|
+
"SessionStart": [
|
|
5
|
+
{
|
|
6
|
+
"hooks": [
|
|
7
|
+
{
|
|
8
|
+
"type": "command",
|
|
9
|
+
"command": "node \"${CLAUDE_PLUGIN_ROOT}/dist/hooks/smart-install.js\"",
|
|
10
|
+
"timeout": 30
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"type": "command",
|
|
14
|
+
"command": "node \"${CLAUDE_PLUGIN_ROOT}/dist/hooks/session-start.js\"",
|
|
15
|
+
"timeout": 5
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
}
|
|
19
|
+
],
|
|
20
|
+
"PostToolUse": [
|
|
21
|
+
{
|
|
22
|
+
"matcher": "*",
|
|
23
|
+
"hooks": [
|
|
24
|
+
{
|
|
25
|
+
"type": "command",
|
|
26
|
+
"command": "node \"${CLAUDE_PLUGIN_ROOT}/dist/hooks/post-tool-use.js\"",
|
|
27
|
+
"timeout": 10
|
|
28
|
+
}
|
|
29
|
+
]
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
"Stop": [
|
|
33
|
+
{
|
|
34
|
+
"hooks": [
|
|
35
|
+
{
|
|
36
|
+
"type": "command",
|
|
37
|
+
"command": "node \"${CLAUDE_PLUGIN_ROOT}/dist/hooks/stop.js\"",
|
|
38
|
+
"timeout": 30
|
|
39
|
+
}
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
}
|