claude-threads 1.24.2 → 1.25.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/CHANGELOG.md +26 -0
- package/README.md +1 -0
- package/dist/index.js +1229 -577
- package/dist/mcp/mcp-server.js +371 -51
- package/docs/CONFIGURATION.md +72 -0
- package/package.json +4 -4
package/docs/CONFIGURATION.md
CHANGED
|
@@ -23,6 +23,7 @@ platforms:
|
|
|
23
23
|
botName: claude-code
|
|
24
24
|
allowedUsers: [alice, bob]
|
|
25
25
|
permissionMode: default
|
|
26
|
+
memory: true # persistent memory (default on; see Memory below)
|
|
26
27
|
|
|
27
28
|
# Slack
|
|
28
29
|
- id: slack-eng
|
|
@@ -174,6 +175,76 @@ platforms:
|
|
|
174
175
|
|
|
175
176
|
Note: the per-platform `stickyMessage: <mode>` field is distinct from the top-level `Config.stickyMessage: { description, footer }` block, which still customizes the full sticky for platforms not in `hidden` mode.
|
|
176
177
|
|
|
178
|
+
### Memory (`memory`, default: fully enabled)
|
|
179
|
+
|
|
180
|
+
Each platform instance (≈ one channel) can carry persistent memory, modeled on
|
|
181
|
+
how Anthropic's own products do it:
|
|
182
|
+
|
|
183
|
+
- **Repo layer** (Claude Code style): Claude Code's native *auto-memory* is
|
|
184
|
+
redirected into a bot-managed directory scoped per **(platform, repository)**.
|
|
185
|
+
Claude saves and recalls project knowledge (build commands, conventions,
|
|
186
|
+
gotchas) across sessions in the same repo, using its built-in memory
|
|
187
|
+
machinery — worktrees of one repo share the same memory, mirroring native
|
|
188
|
+
behavior. Requires Claude CLI 2.1.235+ (the `autoMemoryDirectory` setting).
|
|
189
|
+
- **Channel layer** (Claude Tag style): a shared per-channel `MEMORY.md` of
|
|
190
|
+
team notes — decisions, conventions, stable facts — injected into every
|
|
191
|
+
session's system prompt (capped at 200 lines / 25 KB, mirroring native
|
|
192
|
+
limits). Written by users (`!remember`) and by end-of-session
|
|
193
|
+
**distillation**: when a session ends, a one-shot haiku pass extracts up to
|
|
194
|
+
3 durable facts from the thread.
|
|
195
|
+
|
|
196
|
+
```yaml
|
|
197
|
+
platforms:
|
|
198
|
+
- id: mattermost-main
|
|
199
|
+
type: mattermost
|
|
200
|
+
# ... credentials ...
|
|
201
|
+
memory: true # default — everything on; `false` disables all layers
|
|
202
|
+
# or per-layer:
|
|
203
|
+
# memory:
|
|
204
|
+
# repoLayer: true # native auto-memory redirect
|
|
205
|
+
# channelLayer: true # shared channel notes in the system prompt
|
|
206
|
+
# distillation: false # no end-of-session haiku pass
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
**Commands** (any session-authorized user; `forget` is owner-gated):
|
|
210
|
+
|
|
211
|
+
- `!remember <text>` — save a note to the channel's shared memory
|
|
212
|
+
- `!memory` — show the channel memory as a numbered list
|
|
213
|
+
- `!memory forget <n|text>` — remove one entry; `!memory forget all` clears it
|
|
214
|
+
|
|
215
|
+
**Storage & privacy:**
|
|
216
|
+
|
|
217
|
+
- Everything lives under `~/.config/claude-threads/memory/` (override with
|
|
218
|
+
`CLAUDE_THREADS_MEMORY_DIR`), dirs `0700` / bot-written files `0600`.
|
|
219
|
+
- **The platform instance is a hard privacy boundary**: memory never crosses
|
|
220
|
+
platform instances, even for the same repository — mirroring Claude Tag's
|
|
221
|
+
per-channel isolation. The storage location is also independent of the
|
|
222
|
+
Claude-account pool's per-session `HOME` overrides.
|
|
223
|
+
- When memory is disabled, the bot also sets `CLAUDE_CODE_DISABLE_AUTO_MEMORY=1`
|
|
224
|
+
on the Claude CLI child so native auto-memory can't silently accumulate
|
|
225
|
+
cross-channel context under a shared pooled-account `$HOME`.
|
|
226
|
+
- `!memory forget` removes the entry atomically for all **future** sessions;
|
|
227
|
+
sessions already running keep their injected copy until their next
|
|
228
|
+
respawn/resume. Repo-layer files are owned by the Claude CLI — ask Claude
|
|
229
|
+
in-session to update its memory, or delete the directory on disk.
|
|
230
|
+
- Channel memory is chat-derived content that persists into future sessions'
|
|
231
|
+
prompts. The system-prompt framing tells Claude to treat it as background
|
|
232
|
+
context — never as instructions or authorization — but memory is only as
|
|
233
|
+
trusted as the channel's membership. Distillation currently reads the whole
|
|
234
|
+
thread, including messages from non-allowed users that entered via the
|
|
235
|
+
approval flow. There is no automatic expiry. Both are candidates for
|
|
236
|
+
follow-up options.
|
|
237
|
+
- Distillation runs one `claude -p` haiku call per session end, billed to the
|
|
238
|
+
bot's default account (not the session's pooled account). In an OAuth
|
|
239
|
+
`claudeAccounts` pool where only the per-account HOMEs are logged in, the
|
|
240
|
+
bot's own environment may have no credentials — distillation then fails
|
|
241
|
+
silently (debug-logged) and the channel only learns via `!remember`. Give
|
|
242
|
+
the bot process its own credentials (`claude login` under the bot's HOME,
|
|
243
|
+
or `ANTHROPIC_API_KEY` in its env) if you want distillation in that setup.
|
|
244
|
+
- Note for exotic setups: the Claude CLI disables auto-memory when
|
|
245
|
+
`CLAUDE_CODE_REMOTE` is set (unless `CLAUDE_CODE_REMOTE_MEMORY_DIR` is
|
|
246
|
+
configured) — the repo layer will be inert in such environments.
|
|
247
|
+
|
|
177
248
|
## Claude Accounts (optional, multi-account mode)
|
|
178
249
|
|
|
179
250
|
By default every session spawns `claude` with the bot's own `process.env`, so they all share one subscription's token budget. Add a `claudeAccounts` block to spread load across multiple accounts. Omit the block entirely to stay in single-account mode (unchanged behavior).
|
|
@@ -215,6 +286,7 @@ Exactly one of `home` or `apiKey` should be set per account. Persisted sessions
|
|
|
215
286
|
| `CLAUDE_CODE_SUBPROCESS_ENV_SCRUB` | Strip `ANTHROPIC_*`, `AWS_*_TOKEN`, `CLAUDE_CODE_OAUTH_TOKEN`, `GOOGLE_APPLICATION_CREDENTIALS`, and similar from Bash, hook, and stdio-MCP subprocesses Claude spawns. Bot-specific vars like `PLATFORM_TOKEN` pass through. **Also forces permission mode to `default`**; `--dangerously-skip-permissions` will be rejected. Requires Claude CLI 2.1.83+. | - |
|
|
216
287
|
| `CLAUDE_THREADS_SESSIONS_PATH` | Override the path to the persisted sessions file (default `~/.config/claude-threads/sessions.json`). | - |
|
|
217
288
|
| `CLAUDE_THREADS_GITHUB_EMAILS_PATH` | Override the path to the GitHub-emails store used for commit attribution. | - |
|
|
289
|
+
| `CLAUDE_THREADS_MEMORY_DIR` | Override the root of the persistent memory storage (default `~/.config/claude-threads/memory/`). | - |
|
|
218
290
|
| `NO_UPDATE_NOTIFIER` | Disable update checks | - |
|
|
219
291
|
|
|
220
292
|
### Forwarded to Claude CLI automatically
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-threads",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.25.0",
|
|
4
4
|
"description": "Run Claude Code from Slack or Mattermost. Sessions stream live into threads where your whole team can watch and steer.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"package.json"
|
|
69
69
|
],
|
|
70
70
|
"dependencies": {
|
|
71
|
-
"@hono/node-server": "2.1.
|
|
71
|
+
"@hono/node-server": "2.1.1",
|
|
72
72
|
"@inkjs/ui": "^2.0.0",
|
|
73
73
|
"@modelcontextprotocol/sdk": "^1.26.0",
|
|
74
74
|
"@redactpii/node": "^1.0.16",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"commander": "^14.0.2",
|
|
77
77
|
"diff": "^8.0.3",
|
|
78
78
|
"express-rate-limit": "^8.3.0",
|
|
79
|
-
"hono": "4.13.
|
|
79
|
+
"hono": "4.13.2",
|
|
80
80
|
"ink": "^6.6.0",
|
|
81
81
|
"ink-scroll-view": "^0.3.5",
|
|
82
82
|
"js-yaml": "^4.3.1",
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
"@types/ws": "^8.18.0",
|
|
100
100
|
"eslint": "^10.7.0",
|
|
101
101
|
"husky": "^9.1.7",
|
|
102
|
-
"knip": "6.32.
|
|
102
|
+
"knip": "6.32.2",
|
|
103
103
|
"lint-staged": "^17.0.4",
|
|
104
104
|
"prettier": "^3.9.5",
|
|
105
105
|
"typescript": "^6.0.2",
|