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
9 changes: 5 additions & 4 deletions docs/features/integrations/claude-code.md
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ the first Loom call of a session costs one tool-search request, and the startup
instructions say nothing about the code tools (in code mode there are none).
Measured in the opt-in configuration, with `prompt_pack` on, on a scripted
session whose prompt carried three pointers, in a project that holds the
pointers block, the plugin adds about 2,400 bytes to the first request in code
pointers block, the plugin adds about 1,900 bytes to the first request in code
mode: the three skill descriptions, the tool names, the pointers, the block and
the checkout's line. A default install adds no pointers to that request. The
three schemas would be about 4,100 bytes more. A server that does not read the
Expand Down Expand Up @@ -716,7 +716,8 @@ claude plugin install loom@loom --config mode=code
neither list and leaves the names of its three resource tools out of the session's
requests.
- **The three skills are listed in every mode**: a skill's description is fixed text the
client loads at start.
client loads at start. Each says when to load its skill in one line of at most 160
bytes, 480 for the three.
- **The listing needs a server that reads `?mode=`** ([MCP reference](../../reference/mcp.md)).
An older server ignores it and lists both planes; the hooks follow the mode either way.

Expand Down Expand Up @@ -1117,9 +1118,9 @@ the Grep tool and the Bash tool respectively.

| Skill | Loads when | Does |
| -------------------------- | ------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `loom-code` | about to grep, glob or open files in an indexed repository | which `code.*` op replaces the reflex and how to read its answer |
| `loom-code` | about to grep or open files in an indexed repository | which `code.*` op replaces the reflex and how to read its answer |
| `loom-memory` | a fact is stated, decided or corrected; the end of a substantial task | what is durable memory and what is scratchpad, how to write a fact a later session can trust, the end-of-task review |
| `loom-mentor` | a hint names a plane or op you do not know; "what can Loom do" | the situation → plane → op map and what each hint code means |
| `loom-mentor` | which operation serves documents or records; a hint; "what can Loom do" | the situation → plane → op map and what each hint code means |
| `loom-optimize` | "optimize my namespace", "memory search is bad", a namespace-health line | `namespace.audit`, a plan the owner approves, `memory.move` with redirects ([guide](../../guides/optimize-namespace.md)) |
| `loom-session` | "save this session", "resume", "where was I on this branch" | lists the saved briefs, restores the one the user picks (the brief with the client's compaction summary, or with `--transcript` every recorded turn as well), or saves one; it never loads a brief unasked |
| `loom-setup` | only when you run `/loom:loom-setup`; the model cannot load it | writes, updates or removes [the instruction block](#the-instruction-block) in `CLAUDE.md` (`bin/loom-setup.mjs`) |
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.119",
"version": "1.2.120",
"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
23 changes: 12 additions & 11 deletions integrations/claude-code-plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ the plane it uses: `claude plugin install loom@loom --config mode=code`.
none after a call that has only memory's. The recording scripts are
loaded in every mode, and each checks its plane itself.
- **The three skills are listed in every mode.** A skill's description is
fixed text the client loads at start.
fixed text the client loads at start. Each says when to load its skill in
one line of at most 160 bytes, 480 for the three.
- **The listing needs a server that reads `?mode=`.** An older server ignores
it and lists both planes; the hooks follow the mode either way.
- **Other clients** set `LOOM_MODE` for the hooks (the option outranks it
Expand Down Expand Up @@ -637,16 +638,16 @@ saving is 82%.

Eight skills ship with the plugin and load on their triggers:

| Skill | Trigger | What it settles |
| -------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `loom-code` | about to grep, glob or open files in a loom-indexed repo | which `code.*` op replaces the reflex, how to read a result, when to stop |
| `loom-memory` | about to write a fact; the user states, decides or corrects one; end of a substantial task | durable vs scratchpad, how to write a fact a future session can trust (no laundered inferences, source pointer, same key on change), how to read `memory_id` / `conflict` / `abstain` / `verification`, the end-of-task review |
| `improve-loom-for-my-repo` | end of a session in which loom's code tools missed | turns this session's transcript into reproducible findings for the maintainers |
| `loom-status` | a loom tool answers "unauthenticated" or empty for something the user says was saved; the primer did not appear; "is loom working?"; a hook says it found no Node | read-only checks in order — the hook runtime (`ensure-node.sh --check`), the packaged client check (`bin/loom-client-status.mjs`: server, token, where the token came from, auth, writer grant, stranded captures), plugin and MCP registration — and the one cause and fix |
| `loom-optimize` | "optimize my loom namespace", "audit memory", "my memory search is bad"; a mentor hint naming rows to rework | runs `namespace.audit`, writes a plan the owner approves, reworks rows with `memory.move` so every old key stays readable through a redirect; retires nothing |
| `loom-setup` | only when the user runs `/loom:loom-setup` (Codex: an explicit "set Loom up in this repository" or "remove the Loom block"); a line saying the block is missing is not a request | writes, updates or removes the instruction block in the repository's `CLAUDE.md` (`bin/loom-setup.mjs`), which says when to search the index, or, with `prompt_pack` on, that Loom's pointers arrive with a prompt |
| `loom-session` | only an explicit "save this session", "hand this off", "resume", "where was I on this branch"; a brief the primer mentions is not a request | loads a session brief with what moved in the checkout since it was saved (`bin/loom-brief.mjs get`), or saves one the agent writes from its own context — goal, status, decisions and why, dead ends, done, next steps, files, rules, pointers |
| `loom-mentor` | a hint (a result's `hint`, or a "Loom mentor" line) names a plane or op you do not know how to use; "what can loom do", "am I using loom well" (a hint that names its op needs no skill) | the situation → plane → op table for every plane (code index, tracker record, documents, records, working memory, offload, graph, runs, decisions, procedures, duplicates, conflicts, bisect), what each hint code means and what to do, and `mentor.brief` for the evidence |
| Skill | Trigger | What it settles |
| -------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `loom-code` | about to grep or open files in a loom-indexed repo | which `code.*` op replaces the reflex, how to read a result, when to stop |
| `loom-memory` | about to write a fact; the user states, decides or corrects one; end of a substantial task | durable vs scratchpad, how to write a fact a future session can trust (no laundered inferences, source pointer, same key on change), how to read `memory_id` / `conflict` / `abstain` / `verification`, the end-of-task review |
| `improve-loom-for-my-repo` | end of a session in which loom's code tools missed | turns this session's transcript into reproducible findings for the maintainers |
| `loom-status` | a loom tool answers "unauthenticated" or empty for something the user says was saved; the primer did not appear; "is loom working?"; a hook says it found no Node | read-only checks in order — the hook runtime (`ensure-node.sh --check`), the packaged client check (`bin/loom-client-status.mjs`: server, token, where the token came from, auth, writer grant, stranded captures), plugin and MCP registration — and the one cause and fix |
| `loom-optimize` | "optimize my loom namespace", "audit memory", "my memory search is bad"; a mentor hint naming rows to rework | runs `namespace.audit`, writes a plan the owner approves, reworks rows with `memory.move` so every old key stays readable through a redirect; retires nothing |
| `loom-setup` | only when the user runs `/loom:loom-setup` (Codex: an explicit "set Loom up in this repository" or "remove the Loom block"); a line saying the block is missing is not a request | writes, updates or removes the instruction block in the repository's `CLAUDE.md` (`bin/loom-setup.mjs`), which says when to search the index, or, with `prompt_pack` on, that Loom's pointers arrive with a prompt |
| `loom-session` | only an explicit "save this session", "hand this off", "resume", "where was I on this branch"; a brief the primer mentions is not a request | loads a session brief with what moved in the checkout since it was saved (`bin/loom-brief.mjs get`), or saves one the agent writes from its own context — goal, status, decisions and why, dead ends, done, next steps, files, rules, pointers |
| `loom-mentor` | unsure which operation serves documents, issue history, queued work or typed records; "what can loom do"; a "Loom mentor" line (a hint that names its op needs no skill) | the situation → plane → op table for every plane (code index, tracker record, documents, records, working memory, offload, graph, runs, decisions, procedures, duplicates, conflicts, bisect), what each hint code means and what to do, and `mentor.brief` for the evidence |

The memory skill complements ambient capture: the hooks record what happened
(conversation turns included, by the Stop hook); the skill covers the facts
Expand Down
7 changes: 3 additions & 4 deletions integrations/claude-code-plugin/skills/loom-code/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
name: loom-code
description: >
Use before you grep, glob or open files to answer a question about a
Loom-indexed codebase: where something is defined, how it works, who calls
it, what a change or a stack trace touches. NOT for unindexed repositories
or your own uncommitted files. NOT for LOCAL-FIRST sessions.
Use before you grep or open files to answer how Loom-indexed
code works, where it is defined, who calls it,
what a change touches. NOT for LOCAL-FIRST sessions.
---

# loom-code — the indexed answer before the grep reflex
Expand Down
6 changes: 2 additions & 4 deletions integrations/claude-code-plugin/skills/loom-memory/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
---
name: loom-memory
description: >
Loom memory, not code. Use before you write anything to Loom, when the user
states, decides or corrects a fact to keep, and to review what to save at
the end of a substantial task. Settles durable versus scratchpad, the shape
of a write and how to read Loom's answer. NOT for duplicate or bisect checks.
Loom memory, not code. Use before you write to Loom, when the user states,
decides or corrects a fact to keep, and at the end of a substantial task.
---

# loom-memory — write facts a future session can trust
Expand Down
8 changes: 3 additions & 5 deletions integrations/claude-code-plugin/skills/loom-mentor/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
---
name: loom-mentor
description: >
Use when Loom should serve documents, issue history, queued work,
typed records, decisions or procedures and you do not know which operation
does, when a Loom hint names a plane or op you do not know how to use, or
when the user asks what Loom can do or whether they use it well. A hint that
names its op needs no skill. NOT for code questions or the shape of a write.
Use when unsure which Loom operation serves documents, issue history,
queued work or typed records, or what Loom can do. A hint naming its op
needs no skill.
---

# loom-mentor — the store's advice, and where each plane lives
Expand Down
18 changes: 11 additions & 7 deletions integrations/claude-code-plugin/tests/skills.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,10 @@ test("every plugin skill's SKILL.md stays under the size a host reads whole; lon
assert.match(mentor, /toolset=tracker/);
});

test("the skill listing stays within its bytes: three listed skills, short descriptions", () => {
test("the skill listing stays within its bytes: three listed skills, one short line each", () => {
// The client puts every listed skill's description in the first request of
// every session, in every mode, whether or not the skill is used. Detail
// every session, in every mode, whether or not the skill is used. So a
// description holds when to load the skill and nothing else. Detail
// belongs in the body, which loads on use.
const root = path.join(here, "..", "skills");
const listed = {};
Expand All @@ -101,12 +102,15 @@ test("the skill listing stays within its bytes: three listed skills, short descr
if (/^disable-model-invocation:\s*true\s*$/m.test(frontmatter)) continue;
const folded = frontmatter.match(/^description: >\n((?: {2}.*\n?)+)/m);
assert.ok(folded, `${name}: a folded description`);
listed[name] = Buffer.byteLength(folded[1].trim().replace(/\s*\n\s*/g, " "));
listed[name] = folded[1].trim().replace(/\s*\n\s*/g, " ");
}
assert.deepEqual(Object.keys(listed).sort(), ["loom-code", "loom-memory", "loom-mentor"]);
for (const [name, bytes] of Object.entries(listed)) {
assert.ok(bytes <= 400, `${name}: description is ${bytes} bytes (cap 400)`);
let total = 0;
for (const [name, text] of Object.entries(listed)) {
const bytes = Buffer.byteLength(text);
assert.ok(bytes <= 160, `${name}: description is ${bytes} bytes (cap 160)`);
assert.match(text, /\bUse (when|before)\b/, `${name}: the description says when to load the skill`);
total += bytes;
}
const total = Object.values(listed).reduce((a, b) => a + b, 0);
assert.ok(total <= 1100, `listed descriptions are ${total} bytes (cap 1100)`);
assert.ok(total <= 480, `listed descriptions are ${total} bytes (cap 480)`);
});
2 changes: 1 addition & 1 deletion integrations/codex-plugin/.codex-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "loom",
"version": "1.2.119",
"version": "1.2.120",
"description": "Shared long-term memory and code intelligence for Codex, 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