/knowledge-and-memory:session-memoryfrom knowledge-and-memory
Maintains structured running-notes during long work sessions to preserve context across compressions. Activated by phrases like 'session notes' or when state risks being lost.
Ships in knowledge-and-memory. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Maintain a single structured markdown document that tracks what is happening
right now in the current work session. This is within-session continuity,
distinct from remember() (cross-session semantic memory) and stash
(coarse checkpoint).
Invoke on any of these triggers:
Do NOT invoke for:
remember()stashEvery session note uses exactly these sections, in this order, with these
headers. Preserve the structure on every update. Never rename or reorder
sections. Update the content within sections; leave empty sections present
with a single _(nothing yet)_ placeholder.
# Session: {short title, 3-8 words, derived from the initial task}
## Current State
_What is actively being worked on right now. Explicit next step._
## Task Specification
_What the user originally asked for. Constraints, acceptance criteria,
design decisions that framed the work._
## Files and Functions
_Important paths touched or referenced, one per line, with a one-line
note on what they contain and why they matter._
## Errors & Corrections
_Errors encountered and how they were fixed. User corrections to my
approach — these have priority over routine progress entries._
## Key Decisions
_Choices made during the session with their rationale. One bullet per
decision. Lead with the choice, then the why._
## Worklog
_Terse, append-only, chronological. One line per attempt or step.
Prefix with ✓ (done), ✗ (failed), → (in progress), or ↺ (reverted)._
Persist as a procedure memory via the remembering skill, so notes
survive container death within the session thread.
from remembering.scripts import remember, recall, supersede
# First write in a session: create the memory
note_id = remember(
note_markdown,
"procedure",
tags=["session-memory", "active"],
priority=1,
)
# Subsequent updates: find the active note and supersede it
existing = recall(tags_all=["session-memory", "active"], n=1)
if existing:
note_id = supersede(existing[0].id, updated_markdown, "procedure",
tags=["session-memory", "active"], priority=1)
Session boundary: when the user says "session done", "wrap up",
"end session", or the conversation is clearly winding down, retag the
active note from active to archived by superseding it with the same
body and tags=["session-memory", "archived"].
One note is active at a time. If recall(tags_all=["session-memory", "active"]) returns more than one, the oldest is stale — archive it before
updating the current one.
On each invocation:
recall(tags_all=["session-memory", "active"], n=1). Work from its current body — do not regenerate from
scratch.## Worklog.
Do not drop prior content unless it is now wrong (then move the correction
to ## Errors & Corrections).## Errors & Corrections before other updates.remember() call, reference it by ID rather
than restating. Notes are supplementary, not duplicative.supersede(). This keeps exactly one active note per session.Target ~12K tokens for the note document. Prefer concise phrasing, but do
not truncate substantive content to hit the target — trigger
## Key Decisions consolidation (collapse related bullets) before cutting.
If the document exceeds ~20K tokens, compress ## Worklog first (merge
consecutive ✓ entries into a single summary line, keep corrections and
decisions intact).
Rationale: we run on 200K–1M context models, so the original 2K budget from the issue spec was over-constrained. 12K matches Claude Code's upstream design and leaves ample room for the surrounding conversation.
When the user asks to "show session notes", print the current note body verbatim in a fenced code block. Do not paraphrase.
When updating silently (you triggered it yourself), confirm with a single
line: Updated session notes (note id: <short-id>). Do not dump the full
body unsolicited.
session-memory + active memory exists per session. Stale
actives are archived, not left dangling.remembering — cross-session memory store (where these notes persist)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub oaustegard/claude-skills --plugin knowledge-and-memory9 skills in this plugin
/asking-questionsGuidance for asking clarifying questions when user requests are ambiguous, have multiple valid approaches, or require critical decisions. Use when implementation choices exist that could significantly affect outcomes./bm25Ranked content search over a text corpus you point it at, using BM25 (via xhluca/bm25s). Corpus-agnostic: cloned repos, project knowledge stores, uploaded files and archives, any local directory. In-memory BM25 index per invocation, with a session-local disk cache for repeat runs against the same corpus. Use for "rank these documents", "search this corpus", "which files are most about X", "find content about Y", or any multi-word concept query against a known body of text where grep would return everything or nothing. Needs a corpus on disk. Not for searching stored memories or prior-session decisions (remembering), not for a named symbol or a file's structure (tree-sitting), and not for a literal string you could grep./cloning-projectExports a Claude.ai workspace — its custom instructions and its uploaded knowledge files — into a bundle that can be re-imported elsewhere. Use for "back up my project instructions", "export my project knowledge", "copy this workspace to a new one", "migrate my project to another account", or "recreate this setup somewhere else". Operates on the Claude.ai workspace you are talking in, and reads nothing from disk./creating-kbBuilds a portable, embedding-free knowledgebase from a set of files and delivers it as a self-contained `.skill` bundle (BM25 index + bundled searcher + query protocol). Use when a user wants to turn uploaded files, a folder, or a corpus into a searchable knowledgebase they can hand to any agent — phrased as "make a knowledgebase", "build a KB skill", "package these docs for retrieval", "create a searchable bundle", or references to a `.skill` KB. The output runs anywhere with Node or Python — no model, no install, no network. Distinct from `bm25` (ephemeral in-session search) and `building-github-index` (markdown project-knowledge index)./iteratingMulti-conversation methodology for iterative stateful work with context accumulation. Use when users request work that spans multiple sessions (research, debugging, refactoring, feature development), need to build on past progress, explicitly mention iterative work, work logs, project knowledge, or cross-conversation learning./mapping-documentsGenerate navigable semantic maps from PDF documents. Extracts section structure via font analysis, then runs LLM extraction per section for claims, symbols, and dependencies — all page-anchored. Produces _MAP.md (progressive disclosure), .symbols.json (definition index), .anchors.json (claim references), and a _USAGE.md snippet for CLAUDE.md. Use when analyzing papers, specs, or legal docs; when asked to "map this document", "index this PDF", "what does this paper say"; or when a coding agent needs grounded reference material from a PDF source. Analogous to tree-sitting but for prose documents.Other plugins' skills for the same job