Working-memory bookmark records a slash-command caveat as the session goal
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- javascript, node.js
- Domain
- backend
Research direction
Start in integrations/claude-code-plugin/lib/working-memory.mjs at firstUserPrompt, then compare its row filtering with lib/session-brief.mjs:157 and lib/test-gate.mjs:1090. Run the reproduction command in the issue and check both plugin copies, including the Codex plugin’s lib/working-memory.mjs. Done when caveat rows and local command echoes are skipped, while a command with arguments can still be used as the goal and sessions without a typed request retain the journal fallback.
Written by the indexing model from the issue text.
Description
Company
ClickHouse
Component
Agent plugin (Claude Code, Codex, Cursor)
Describe what's wrong
The Stop hook's working-memory bookmark (block session:<project>) records the text Claude Code injects for a local slash command as the session's goal:, not the person's first request. A session that starts with /clear is saved as:
goal: <local-command-caveat>The command below was run directly in Claude Code, not sent to you as a request…
The next session's primer shows that line as the goal of the work it resumes.
firstUserPrompt (integrations/claude-code-plugin/lib/working-memory.mjs:40) skips sidechain rows and tool results. It does not skip rows the client wrote itself: the isMeta: true caveat row, and the <command-name>/clear</command-name> row that echoes the command. lib/session-brief.mjs:157 and lib/test-gate.mjs:1090 already skip isMeta rows. The Codex plugin's lib/working-memory.mjs is the same file.
Does it reproduce on the latest release or main?
Yes
How to reproduce
From the repository root on main:
node --input-type=module -e '
import { firstUserPrompt } from "./integrations/claude-code-plugin/lib/working-memory.mjs";
const rows = [
{ type: "user", isMeta: true, message: { role: "user", content: "<local-command-caveat>Caveat: ...</local-command-caveat>" } },
{ type: "user", message: { role: "user", content: "<command-name>/clear</command-name>\n<command-message>clear</command-message>\n<command-args></command-args>" } },
{ type: "user", message: { role: "user", content: "fix the failing search test" } },
];
console.log(JSON.stringify(firstUserPrompt(rows)));
console.log(JSON.stringify(firstUserPrompt(rows.slice(1))));
'
The first line prints the caveat. The second, with the caveat row removed, prints the /clear echo. Both should print "fix the failing search test".
In a live session: start Claude Code with the plugin, run /clear, send a request, end the session, then read the session:<project> working-memory block.
Expected behavior
goal: holds the first request the person typed. firstUserPrompt skips isMeta rows and the echoes of local commands (<command-name> with empty <command-args>, <local-command-stdout>). A command with arguments, such as /<skill> <args>, is a request and can stand as the goal in that form. A session with no typed request falls back to the turn journal, as it does today.
Environment
mainatb97367188600bb12a5c3acdd4ac25903019b0b44- Claude Code and Codex plugins 1.2.158
- Node 25.8.0
How this was found
An AI tool found it, and I have not reproduced it myself
Additional context
It happens in every session whose first input is a local slash command such as /clear or /model: the transcript starts with the caveat row, then the command echo, then the request.
Redaction
- I removed tokens, keys, passwords and personal or customer data from everything above.
- Dominant language
- Python
- Stars
- 263
- Forks
- 47
- Avg merge
- 14h 13m
- Merged PRs (30d)
- 868
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ClickHouse/loom
-
Options of loom reconcile, reembed, settings history and code lint-instructions print no help textOpenbug good first issue help wanted up-for-grabs
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
ClickHouse/loom#2072 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 76/100
ClickHouse/loom#2014 · 1 comment ·
Maintainers usually reply within 1 day
-
Options of loom period-digest, reextract, reconcile-status and demote-activity-narration print no help textPossibly taken @VanshajPoonia claimed this 1 day ago. Openbug good first issue help wanted up-for-grabs
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ClickHouse/loom#1988 · 1 comment ·
Maintainers usually reply within 1 day
-
enhancement help wanted up-for-grabs
Difficulty 5/5 Over a week Newbie friendliness 45/100
ClickHouse/loom#2079 ·
Maintainers usually reply within 1 day
-
enhancement help wanted up-for-grabs
Difficulty 5/5 Over a week Newbie friendliness 45/100
ClickHouse/loom#2078 ·
Maintainers usually reply within 1 day
Similar issues
-
roadmap/v1.3.0 scope/entitlement type/improvement
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
databrickslabs/ontos#1778 ·
Maintainers usually reply within 2 days
-
[Bug]: pip install -U cudaq-qec fails with a conflict that names cudaq-qec itselfPossibly taken @fedonman claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 69/100
StevenBlack/hosts#3314 ·
-
task
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
SparseLinearAlgebra/spla#316 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 87/100
kajisho5/ffmpeg-skill#861 ·
Maintainers usually reply within 1 day