/kagura-memory:session-summaryfrom kagura-memory
Saves key session learnings to Kagura Memory Cloud with configurable depth. Proposes decisions, patterns, bugs, and plans; user chooses what to keep. Supports light/standard/deep/auto modes.
Ships in kagura-memory. Installing the plugin adds it to Claude Code.
Propose the current session's key learnings and save the ones the user chooses to keep to Kagura Memory Cloud.
Arguments: $ARGUMENTS — [light|standard|deep|auto], the save mode. Nothing given (a workflow invoking the command without an argument, too) means auto. A word that is not a mode is asked about, not guessed.
When the user asks for it — by running this command, or through a workflow the user started (for example /gh-issue-driven:ship, which runs it at the end) — typically at the end of a development session or before switching to a different task. Proposes decisions, patterns, bugs, plans and memos for later that would be useful in future sessions; the user decides what is kept.
The user waits while each memory is written, so the mode sets how much is written:
| Mode | Candidates | Fields per item | 4a pin / 4b tool guardrail | 4c keep touched memories current |
|---|---|---|---|---|
light | up to 3, decisions and traps first | summary + tags; content one short line (the evidence or source); no context_summary (put the search terms in the summary instead). A supersedes the user picked still applies, and so does details.observed_at (and details.trigger on a time item) | skipped | only the completed follow-up offer |
standard | up to 7 | the fields in step 4 | proposed when one applies | runs |
deep | about 15 (one remember_batch call holds about 20) | standard + linked_memory_ids to related memories, and a supersede pair proposed per item — both only from ids already in this session's results, no extra recall — and dated follow-ups as type="time" | considered for every item | runs |
auto picks one of the three:
lightstandarddeepOpen the run with one line naming the mode and, for auto, why — for example auto → standard (2 decisions, 1 trap). The user can rerun with an explicit mode.
Load the tools once. When this client lists the kagura-memory tools as deferred (a ToolSearch tool is present), load every tool this skill may call in one call before step 1:
ToolSearch(query="select:mcp__kagura-memory__remember_batch,mcp__kagura-memory__remember,mcp__kagura-memory__update_memory,mcp__kagura-memory__create_edge,mcp__kagura-memory__forget,mcp__kagura-memory__reference")
— add mcp__kagura-memory__list_contexts and mcp__kagura-memory__get_context_info to that same list only when step 3 has no default context to skip to; load_pinned is loaded only when step 4a pins. mcp__kagura-memory__ is the prefix the client gives the tools of the server entry named kagura-memory; when your deferred tool list shows another prefix for these tools, use that one. A client that lists the tools directly has no ToolSearch: skip this paragraph. Never call ToolSearch a second time for these tools.
Review the conversation and collect all GitHub issue numbers that were worked on, referenced, or discussed. Use gh issue view <number> if needed to confirm titles.
Review the conversation and categorize knowledge into one of the canonical types (see remember skill for the full vocabulary). Keep development knowledge to the mode's candidate count, the most reusable first:
| Type | What to capture | Importance |
|---|---|---|
decision | Architecture decisions, approach choices, rejected alternatives with WHY | 0.8-1.0 |
pattern | Implementation patterns, technical solutions, reusable approaches | 0.7-0.9 |
bug-fix | Root cause analysis, regression lessons, "never do this again" | 0.8-0.9 |
troubleshooting | Error solutions, workarounds, environment-specific fixes | 0.5-0.7 |
learning | SDK benchmark results, performance findings, tool limitations | 0.6-0.8 |
note | Milestone status, roadmap changes, issue relationships | 0.6-0.8 |
fact | A stated fact about the user, a person, a thing or a place | 0.6-0.8 |
preference | A like, dislike, habit or opinion the user states | 0.6-0.8 |
event | Something that happened, with when it happened | 0.6-0.8 |
time | Forward-looking plans and dated follow-ups (a deadline, an appointment, "re-check on date X", a scheduled flag flip). Set details={"trigger": {"year": 2026, "month": 11, "day": 3}} (integers, year required) so recall_upcoming surfaces it at the right time instead of letting it decay into the backlog. A plan with no date is a fact. | 0.6-0.8 |
A conversation about the user's own life (not a development session): propose every distinct fact the user stated about themselves and their world — facts, preferences, events, plans, counts, amounts, prices, durations, names — each as its own candidate, with every name, number, date and quantity exactly as stated (a per-item price and a total are two facts). The mode's candidate count limits development knowledge only, not these. Include the assistant's suggestions only when they are specific (a named product, a recipe, a place, a figure). A name or value inside a stated fact is the fact itself; contact details, home addresses, and account, card or ID numbers stay out, as do secrets and credentials.
Memos — what the session leaves for later. An observation that is not a decision, pattern or trap — a refactor, a duplicated helper, dead code, a nit, a hardening idea — or a question only the owner can answer can be kept as a memo instead of an issue, to be picked up when a later change touches its files. Offer it in one of two buckets; a memo keeps these fields in every mode:
| Bucket | type | importance | summary starts with |
|---|---|---|---|
| work to pick up later | tech-debt | 0.45 | tech-debt (<area>): |
| a question for the owner | needs-decision | 0.5 | needs-decision (<area>): |
Problem:, Proposal: and Source: lines (the review, PR or file it came from), then Related issues: #… — the one place a related-issues line belongs in content.status:open, source:review when a review raised it, issue:#N, pr:#N, area:<area>, and file:<repo path> for every file concerned. The file tags are how a later change finds the memo, so the about-6 cap of step 4 does not apply.One memo per theme. /kagura-memory:maintain lists the open ones and closes them.
When the connection has a default context — the server instructions say "Default context: ; omit context_id", or the session-start line from the kagura-memory plugin hook begins "Kagura Memory: default context" (either way the MCP URL carries ?context=<context-id>, or the credential carries a default) — skip this step: call remember_batch / remember without context_id. The response's context_id / context_name confirm which context it is; switch with list_contexts(name_contains="...") only when the user asks for another one, or when this session's knowledge belongs elsewhere (a conversation about the user's own life goes to the context the user names or a private one).
Otherwise:
list_contexts()
list_contexts() returns a slim name→id directory (id, name, is_private, is_locked, last_used_at — no summaries), most recently used first, 100 per page (when has_more is true, pass next_cursor as cursor). If you already know the context name, narrow it with list_contexts(name_contains="..."); if you already resolved the id earlier in this session, reuse it instead of listing again.
Default: the project's development context; a conversation about the user's own life goes to the context the user names or a private one (is_private), not a shared project context. When names alone don't settle it, call get_context_info(context_id=...) for the candidate only — do not load details for every context. Ask the user which context to save to if still unclear.
Show the candidates (type + one-line summary) and save only the ones the user chooses to keep. If the user already said to save everything, save them all.
One call when the server lists remember_batch (v0.93.0 and later): save every kept item with remember_batch(context_id=..., items=[{...}, ...], tags_normalize=true) — each item carries the remember fields below (no context_id). Read the per-item results: status: "success" with memory_id, or status: "error" with error / message for the item to fix and resend alone; a lint entry tag_normalized {subject, replacement} says a tag was stored under the context's established spelling. Keep a call to about 20 items; split a longer list. Leave atomic off — a session summary is a list of independent facts. For an item the user flagged as a possible duplicate of a memory whose id is not in this session's results, save that item alone with remember(..., dedupe="check"): a duplicate_candidate reply names the existing memory, then store it with supersedes=<candidate.memory_id>, update the existing one, or repeat with dedupe="off". Older servers (no remember_batch in the tool list): one remember per item.
For each kept item (a batch item or a single remember), set the fields below. Each says a thing once — the wait is the length of what is written:
YYYY-MM-DD when the conversation is dated (the date the fact was stated, never the time you write it); a relative date in the material ("last Tuesday") goes in details.event_phrase as stated — do not compute it; keep the phrase as stated and add no date; the row carries the resolved days (the item's response returns event_start / event_end). For an upcoming day named by a bare weekday ("on Sunday") add details.event_direction: "future".category:{domain} + entity tags + issue:#N for each related issue. tags_normalize=true stores each tag under the context's established spelling and reports the mapping as tag_normalized, so no list_tags call before the save and no spelling variants.light leaves it out.)supersedes=<old_memory_id> on this remember call only when the user picked the replacement — "save everything" is not that pick. The old memory is shadowed out of default recall, not deleted.deep): ids of related memories, copied verbatim from this session's tool results — never guessed, never fetched by an extra recall.["vault://my-vault/related-note.md"]). Unresolved URIs are silently skipped.delivery_mode="always") — sparinglylight skips 4a and 4b.
A pinned memory is loaded deterministically every session via load_pinned (see session-start). That makes it the right home for a true standing invariant — an active prod color, a non-negotiable policy, a release gate — but it also means every pinned memory costs context budget on every future session. Over-pinning degrades the signal of every session that follows.
Pin only when the knowledge must be seen every session, not merely recalled when relevant. Concretely:
pinned_load_cap, default 100) is a truncation safety net, not the editorial budget — do not let it stand in for judgment. Decisions, patterns, and status notes are NOT pin material; they belong in normal recall.load_pinned(context_id=...). If the context already has ≥7 pinned, unpin a stale one first.green → blue), unpin the old one in the same step — never leave two competing invariants pinned:
update_memory(memory_id=<old>, context_id=..., delivery_mode="on_recall")
Then remember(..., delivery_mode="always") (or update_memory(... delivery_mode="always")) the new one.To pin at save time: remember(..., delivery_mode="always").
details.tool_trigger)A pin is read every session; a tool guardrail is delivered at the one tool call it is about — by a client hook or the server digest — so it costs nothing until that call happens. When a troubleshooting lesson from this session names a specific command, file or MCP tool, save it with details.tool_trigger instead of (or as well as) recording it as a plain memory:
remember(..., type="troubleshooting",
summary="<the safe alternative, stated as a fact>",
details={"tool_trigger": {"tool": "Bash|PowerShell", "match": "<regex of the command that failed>", "action": "inform"}})
Bash|PowerShell for shell traps, mcp__.*__remember for a write-tool trap, Edit|Write for a file trap); on: "result" matches the tool's output or error instead of its input.summary is the text the model reads — write the safe alternative as a fact.action: "block" only when the call itself does the damage (hangs, destroys, irreversible); it needs on: "pre" and a match with at least one literal character. Otherwise inform.details is replaced wholesale on update — resend tool_trigger with any later update_memory(details=...), or use details_patch, which merges. Authoring needs the context editor role and a user API key. Keep a context at 20 or fewer guardrails.Full contract: docs/mcp-tools.md#tool-guardrails.
light: the follow-up bullet only. Only for memories this session saved or read. No extra recall, no review of the whole context. Show what applies as a numbered list; each change is applied only after the user picks it. The step prints nothing when nothing applies.
supersedes: link the two with create_edge(source_id=<the memory just saved>, target_id=<the older memory>, edge_type="supersedes", context_id=...). Never save the item a second time. If the client does not list create_edge, say so (core lists it since v0.129.0; the client cannot call it until the MCP URL carries ?profile=full or ?tools=…).recall / reference result carried supersede_candidate: show the pair. The carrier is the recalled memory that has the field, not the one just saved. Accept with update_memory(memory_id=<memory_id of the result that carries the candidate>, accept_supersede_candidate=true, context_id=...); reject with update_memory(memory_id=<memory_id of the result that carries the candidate>, dismiss_supersede_candidate=true, context_id=...).type="time") was completed in this session: offer to retire it with forget(memory_id=..., context_id=...). If step 4 did not already save the outcome, offer to record it first with remember(context_id=..., type="note", summary=..., content=...). There is no "mark done": a time memory leaves recall_upcoming only when forgotten.Rules for this step:
forget by memory_id only, never the query mode. Before a delete, show the summary and full id again. recall_upcoming returns no importance: read it with reference(memory_id=..., context_id=..., fields=[]) and warn when it is above 0.8.For a sweep of the whole context, use /kagura-memory:maintain.
type="troubleshooting" with tags=["dev-environment"] so future sessions can avoid the same mistakeAfter saving, print a summary:
## Session Knowledge Saved
Related issues: #12, #34
| # | Type | Summary | Importance |
|---|------|---------|------------|
| 1 | decision | ... | 0.9 |
| 2 | pattern | ... | 0.8 |
...
Total: N items saved to context {context_name}
💡 Learnings are saved to Kagura Memory. If you're **continuing** work, run `/compact` now to free up context. Skip it if you're ending the session — compaction isn't needed when you're done.
The /compact line is a continue-only nudge, not an instruction to run: saving to Kagura Memory is a durable save point, so the transcript can be compacted afterward with little loss when work continues. Leave the continue/end decision with the user — omit or ignore the nudge on a true session end.
Do not attempt to auto-invoke /compact — it is a Claude Code harness (CLI) built-in, not a shell command or a skill action, so it cannot be triggered from this skill or a hook. The nudge is the whole mechanism.
What the command file sets; muted values are Claude Code's defaults
memory, knowledge-management, session-summary, kagura-memory
7-day visitors to each command page
npx claudepluginhub kagura-ai/memory-cloud --plugin kagura-memory10 commands in this plugin
/digestWhen to useTurn earlier sessions of this project into memories the user chooses to keep/guideStepsShow Kagura Memory Cloud usage guide, connection status, and setup help/loginRulesSign the Kagura Memory MCP connection in again (expired or revoked token, new machine, insufficient_scope) and verify itOther plugins' commands for the same job