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
23 changes: 15 additions & 8 deletions docs/features/integrations/claude-code.md
Original file line number Diff line number Diff line change
Expand Up @@ -460,18 +460,19 @@ The wiring is `hooks/hooks.json`; `hooks/HOOKS.md` has per-hook notes.
| SessionStart | `loom-session-start.mjs` | one budgeted `context.pack` primer (working-memory note, pins, profile, memories, decisions, procedures, recent runs), one line naming an indexed checkout's code namespace and the repository's memory tag, a line naming the project's saved session briefs, a task-inbox line (`task.counts`), and a few lines naming the collections the token can read (`collection.list`) | `LOOM_INJECT_CONTEXT=false`, `LOOM_CODE_MAP=false`, `LOOM_TASK_INBOX_LINE=off`, `LOOM_COLLECTIONS_LINE=off` |
| UserPromptSubmit | `loom-prompt-pack.mjs` | up to three `code.search` pointers for the prompt, only when the index rates its answer low-risk | `LOOM_PROMPT_PACK=off` |
| UserPromptSubmit | `loom-prompt-recall.mjs` | one bounded `context.pack` recall for the prompt (memories, decisions, procedures), injected only when memory does not abstain | `LOOM_PROMPT_RECALL=first` (default) / `on` / `off` |
| UserPromptSubmit | `loom-run.mjs` | opens the session's run (`run.begin`, `run_id = cc-<session_id>`, goal = the first prompt) | `LOOM_RUN_LEDGER=off` |
| UserPromptSubmit | `loom-run.mjs` | opens the session's run (`run.begin`, `run_id = cc-<session_id>`, goal = the first prompt); the prompt does not wait for it | `LOOM_RUN_LEDGER=off` |
| PreToolUse (Read, Grep, Bash) | `loom-code-shunt.mjs` | the code shunt and the tracker shunt ([next section](#the-code-shunt)) | `LOOM_CODE_SHUNT=off`, `LOOM_TRACKER_SHUNT=off` |
| PreToolUse (Edit, Write, MultiEdit, NotebookEdit) | `loom-file-context.mjs` | what Loom knows about the file about to change (`memory.for_file`): your rules and the repository's shared rules and design decisions; once per file per 30 min | `LOOM_FILE_CONTEXT=off` |
| PostToolUse (Loom tools) | `loom-mentor-hint.mjs` | lifts a result's `hint` into context, once per hint code per session | `LOOM_MENTOR_HINTS=off` |
| PostToolUse (Edit, Write, MultiEdit) | `loom-blast-radius.mjs` | one line from `code.impact`: callers, tests reaching the change, co-change files not yet touched | `LOOM_BLAST_RADIUS=off` |
| UserPromptSubmit | `loom-record.mjs` | the prompt's one process: runs `loom-prompt-pack` and `loom-prompt-recall` in the hook and prints their context as one answer, writes the run's begin to the session's run state, and hands the prompt's recording scripts (`loom-run`, the namespace audit) to a detached process | each script's own |
| PostToolUse, PostToolUseFailure, Stop, SessionEnd | `loom-record.mjs` | runs the event's recording scripts (the rows below for those events, the gates excepted) in one process: detached after a tool call and at Stop, so the session does not wait for their requests, and in the hook itself at SessionEnd | each script's own |
| PostToolUse, PostToolUseFailure (any tool) | `loom-capture.mjs` | one episodic observation per tool call (`observe.record`); a failed call is typed `error` | none |
| Stop, SessionEnd | `loom-conversation.mjs` | appends new chat turns to the conversation plane (`conversation.append`) | `LOOM_CAPTURE_CONVERSATIONS=false` |
| Stop | `loom-usage.mjs` | posts the session's token usage to `cost.record_turns` | `LOOM_USAGE=off` |
| Stop | `loom-test-gate.mjs` | for changes this session made, blocks "done" once with the tests `code.test_gate` says the change obliges, unless your latest prompt ends with "Do not run the tests", or pytest already ran them to its summary line, failures included, and nothing was edited or run since (exact conditions: **Answered stops** in the plugin README) | `LOOM_TEST_GATE=off` |
| Stop | `loom-validate-gate.mjs` | blocks once when `namespace.validate` finds errors or warnings on the memory keys this session wrote | `LOOM_VALIDATE_GATE=off` |
| Stop | `loom-namespace-health.mjs` | on the first Stop, one line when `namespace.audit` finds a critical misuse of the namespace, pointing at the `loom-optimize` skill | `LOOM_NAMESPACE_HEALTH=off` |
| Stop | `loom-namespace-health.mjs` | one line when `namespace.audit` finds a critical misuse of the namespace, pointing at the `loom-optimize` skill; the audit is asked once per session, by the first prompt's detached process, and told at a Stop | `LOOM_NAMESPACE_HEALTH=off` |
| Stop, PreCompact | `loom-working-memory.mjs` | refreshes the working-memory note (`session:<project>`): goal, git status, files edited, last reply | `LOOM_WORKING_MEMORY=off` |
| Stop, PreCompact, SessionEnd | `loom-capture.mjs` | crystallises the session (`observe.crystallize`) | none |
| PreCompact, SessionEnd | `loom-session-brief.mjs` | revises the branch's session brief (`session.brief_save`, key `auto/<project>/<branch>`) | `LOOM_SESSION_BRIEF=off` |
Expand Down Expand Up @@ -507,17 +508,23 @@ that knows its outcome calls `run.complete` itself.

**Safety.** A hook never blocks the agent on the network.

- The scripts that only record (tool observations, conversation turns, usage, the
working-memory note) do not hold the session after a tool call or at Stop: one launcher
(`hooks/loom-record.mjs`) writes the event to a private file, starts one detached
process that runs them, and exits. That process outlives the hook and the client's
process. It does not outlive a machine or container that is torn down when the client
exits, which loses what the process had not sent by then.
- The scripts that only record (the run's open, tool observations, conversation turns,
usage, the working-memory note) do not hold the session at a prompt, after a tool call
or at Stop: one launcher (`hooks/loom-record.mjs`) writes the event to a private file,
starts one detached process that runs them, and exits. That process outlives the hook
and the client's process. It does not outlive a machine or container that is torn down
when the client exits, which loses what the process had not sent by then.
- At a prompt the launcher also runs the two lookups the prompt waits for (the code
pointers and the recall) in its own process and prints what they found as one answer,
so a prompt starts one process.
- At SessionEnd the launcher runs the scripts itself (the last turns, the run's close,
session memory, the session brief) and returns when they have, in about half a second.
The run's close is answered by then. What the flusher carries (the last turns, session
memory, the brief) has been handed to it, and a host torn down in that instant can lose
it. PreCompact runs the scripts as hooks of their own.
- The namespace audit is asked once per session by the first prompt's detached process,
and the first Stop that finds its verdict tells it. A Stop asks in place only when
that process died before its answer.
- Their writes are fire-and-forget; slow ones (conversation, session memory, session
brief) go to a detached flusher (`hooks/loom-flush.mjs`).
- Every request aborts after 5 × the `/v1/health` round trip, clamped to 3–8 s and cached
Expand Down
2 changes: 1 addition & 1 deletion integrations/claude-code-plugin/.claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "loom",
"displayName": "ClickHouse Loom",
"version": "1.2.64",
"version": "1.2.66",
"description": "Shared long-term memory and code intelligence for Claude Code, self-hosted on ClickHouse. MCP tools to save and recall decisions, preferences and corrections across sessions and teammates; lifecycle hooks that capture each session with no model call; a code index that answers where-is, who-calls and blast-radius questions with line-accurate units instead of whole-file reads.",
"author": {
"name": "ClickHouse"
Expand Down
Loading
Loading