remember
Capture insights to knowledge store and update conversational threads — invoke anytime to ensure nothing is lost
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Capture insights to knowledge store and update conversational threads — invoke anytime to ensure nothing is lost
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Drive a feature end-to-end across multiple protocol sessions — the coordinator role's protocol home
Create a GitHub pull request from the current branch, deriving the PR body from the associated work item's plan and notes.
Holistic multi-lens PR review with adaptive lens selection, cross-lens synthesis, and structured findings; --self runs the same pipeline as an author's self-review. Use individual lens skills (/pr-correctness, /pr-security, etc.) for focused single-concern analysis.
Create a technical specification — `/spec short` for single-pass plans, `/spec` for full team-based investigation
Check project status, remaining tasks, and session context — USE FIRST when asked 'what's left', 'what should I do', 'remaining work', or status questions. Also: create, update, archive, search work items.
Focused lens review: trace the impact of PR changes on code outside the diff. Use /pr-review for integrated multi-lens coverage.
| name | remember |
| description | Capture insights to knowledge store and update conversational threads — invoke anytime to ensure nothing is lost |
| user_invocable | true |
| argument_description | [optional: focus area or capture constraints] |
Pause and review the current session for uncaptured knowledge and unupdated threads. Combines knowledge capture with thread updates.
Session-start first-turn handlers are triggered by two hook output lines from the SessionStart hook:
[capture] N pending candidates — process via /remember first-turn (emitted by load-knowledge.sh when _pending_captures/ exists)[threads] Pending session digest — process via /remember first-turn (emitted by load-threads.sh when _pending_digest.md exists)When either line appears, execute Step 0a (pending captures intake) or Step 0b (pending digest intake) before any other step. This skill also handles the interactive invocation path — the same 4-condition gate applied to conversation context rather than stop-hook candidate files.
D3 trigger contract: the bracket prefix, pending-state description, and owning-skill name (/remember) in both trigger lines must remain stable across future edits to load-knowledge.sh and load-threads.sh.
lore resolve
Set KNOWLEDGE_DIR to the result. Set THREADS_DIR to $KNOWLEDGE_DIR/_threads.
source ~/.lore/scripts/lib.sh
SKILLS_DIR=$(resolve_harness_install_path skills)
REMEMBER_TEMPLATE_VERSION=$(bash ~/.lore/scripts/template-version.sh "$SKILLS_DIR/remember/SKILL.md")
When invoked by another skill (e.g., /implement or /spec post-work extraction), the caller passes its own template-version via the delegation prompt — see Step 5 for the lead-synthesis path. Interactive invocations use $REMEMBER_TEMPLATE_VERSION directly. On hash-command failure, fall through with an empty string; downstream scripts treat that as "no template version."
When _pending_captures/ directory exists in the knowledge store at session start (triggered by [capture] N pending candidates — process via /remember first-turn):
Glob _pending_captures/*.md — each file contains one candidate segment extracted by the stop hook's novelty detection
For each file, read it and evaluate the candidate against the 4-condition gate (reusable, non-obvious, stable, high-confidence) OR the orientation gate (see Step 2 canonical body for both gates' full criteria; a candidate qualifies if either gate passes) and assess synthesis level for tier placement. Trigger-type guidance:
debug-root-cause and debug-narrative candidates: apply the debugging narrative lens — most valuable when it captures expected → found → meaning. Evaluate whether the root cause reveals something non-obvious about how the system works; format qualifying insights in that narrative structure. (debug-narrative is the expanded form emitted by stop-novelty-check.py when debug context is included — same trigger family.)structural-* candidates (e.g., structural-footprint, structural-signal): evaluate as architectural observations — module roles, integration points, change constraints. Often qualify as Architectural models or Cross-cutting conventions.preference-signal candidates: evaluate as scoped working-style preferences. If related_files names a skill, file, or directory (non-none), route to lore capture --category preferences --related-files <paths> via Step 3 branch. If related_files: none, route to thread accumulated_preferences instead — not to a knowledge entry.design-decision, gotcha, self-correction): evaluate normally against capture gate.Low-context candidates: If the candidate excerpt is too sparse to evaluate the gate confidently, read the Related files: field and skim those files before deciding. Do not reject a candidate solely because the excerpt is thin — the stop hook pre-filter has already established baseline relevance. Rejection requires a positive reason (fails Reusable, Non-obvious, Stable, or High confidence), not an absence of evidence.
Staleness branch: when the "non-obvious" check reveals a similar entry may already exist, run lore search "<key terms>" --type knowledge --scale-set <candidate-scale> --limit 3 (declare the candidate's own scale — the conflict check compares like with like), read the top match, and branch: (a) same claim — skip the candidate, (b) divergent (contradicts or supersedes) — edit the existing entry file in-place to reflect the new insight, update its learned date to today, then skip the new capture. Note: [staleness] Updated "<existing title>" — superseded by new finding.
For qualifying insights, determine the emission path before running the capture command:
lore promote): use when ALL four predicates are true: (a) backed by a Tier 2 evidence artifact (worker/researcher observation from execution-log.md or plan.md), (b) expressible as a validate-tier3.sh-accepted row with claim, why_future_agent_cares, falsifier, and source_artifact_ids, (c) source_artifact_ids non-empty, and (d) reusable outside the current work item.lore capture): everything else — interactive candidates, candidates without Tier 2 backing, and any candidate that fails any Tier 3 predicate.Pass --related-files using the **Related files:** field from the candidate file (skip if the field is none):
lore capture --insight "..." --context "..." --category "..." --confidence "high" --related-files "<value from Related files field>"
Delete each file after evaluation (whether the candidate qualified or not)
Remove the _pending_captures/ directory once empty
Brief feedback: [capture] Reviewed N candidates from previous session, captured M insights
If none qualify, delete all files, remove the directory, and note: [capture] Reviewed N candidates, none met capture gate
When _threads/_pending_digest.md exists at session start:
## YYYY-MM-DD + Summary, Key points, Shifts (optional), Preferences (optional), Related._meta.json accumulated_preferences:
last_reinforced; append new entry filename to source_entries{preference, first_seen, last_reinforced (both today), source_entries}_pending_digest.md file.[thread: topic-name] Updated with previous session discussion (or [thread: new] Created "..." if new).If no pending digest, skip silently.
If an argument was provided, interpret it as capture constraints that adjust the 4-condition gate for this invocation. Constraints narrow what gets captured — they never expand it (the base gate always applies).
The argument can be:
When called from another skill, the argument typically distinguishes what's worth persisting vs ephemeral. Apply these constraints throughout Steps 2-5.
Examples of how constraints tighten the gate:
| Calling context | Capture | Skip |
|---|---|---|
| PR review | Architectural feedback, corrected misconceptions, non-obvious patterns | Style preferences, formatting nits, subjective code taste |
| Debugging session | Root causes, misleading error messages, environment-specific gotchas | Dead-end hypotheses, one-off typos, transient state |
| Dependency upgrade | Breaking changes, migration patterns, compatibility gotchas | Version numbers, changelog summaries, routine deprecation warnings |
| Refactoring | Discovered coupling, extraction patterns, invariants that weren't obvious | Mechanical renames, import reordering, formatting changes |
Run work item resolution once; the result flows to Step 5 (execution-log write):
lore work list --json --all
Parse the JSON output and match the current git branch against each item's branches array:
RESOLVED_SLUG to that item's slug.RESOLVED_SLUG.RESOLVED_SLUG unset. Subsequent steps skip the execution-log write silently.Review the full conversation context (filtered by any Step 1 constraints) and identify moments that match capture triggers:
Debugging narrative format: When a debugging session surfaces a non-obvious root cause, structure the capture using this 5-field template:
Target: 2-5 captures per substantial session. Err on the side of capturing — it's cheap to drop an entry later, expensive to lose an insight.
After capturing: Briefly mention what you captured (e.g., "Captured to knowledge store: evaluators use template-method pattern"). The user can immediately say "don't keep that" to remove it.
Do NOT capture: task-specific details, info already in docs, speculation, transient state.
For each candidate, assess against the capture gate — all 4 conditions must be true:
Whose perspective the gate evaluates. Condition 2's "non-obvious" test is agent-centric, not reader-centric — ask "would a future agent re-derive this from sources they already read, or would they have to dig?" rather than treating the agent's knowledge state as identical to a human reader skimming the repo. The commons is curated by agents for agents; the gate evaluates against that audience.
Capture when the candidate passes the 4-condition gate OR the orientation gate. The two gates are parallel paths, not stacked filters — a candidate that passes either is captured. The 4-condition gate above governs facts (gotchas, rationale, conventions, directives). The orientation gate below governs system maps — content whose pieces are individually readable from source but whose assembly takes meaningful cross-boundary search.
Orientation gate — all 5 conditions must be true:
--related-files). Unanchored orientation goes stale invisibly.architecture, subsystem, or architecture,subsystem. Implementation-scale orientation is malformed — route to the 4-condition gate as a fact, or drop.Routing-gate hygiene (the parallel gates form a routing gate; name each leg explicitly):
--scale.lore capture (Tier 1) or lore promote (Tier 3) per Step 5's tier routing; if the orientation gate passes, capture the same way with --scale architecture, --scale subsystem, or --scale architecture,subsystem and concrete --related-files._inbox/.--scale to implementation to make it land; that defeats the altitude constraint.If capture constraints were provided in Step 1, apply them as an additional filter: candidates that pass the base gate but fall into the "skip" category for the current context are dropped silently.
High-value capture categories (entries in these categories often involve synthesis and load at startup):
SELECT count(*) FROM fts_entries, (3) check tokenizer config in the CREATE VIRTUAL TABLE statement."lore search returns 0 results for a term you know exists. Likely cause: hyphenated term not being quoted in FTS5 query. Verify: run the query manually in sqlite3 with explicit quoting."Calibration examples:
Staleness branch: when the "non-obvious" check reveals a similar entry may already exist, run lore search "<key terms>" --type knowledge --scale-set <candidate-scale> --limit 3 (declare the candidate's own scale — the conflict check compares like with like), read the top match, and branch: (a) same claim — skip the candidate; (b) divergent (contradicts or supersedes) — edit the existing entry file in-place to reflect the new insight, update its learned date to today, then skip the new capture. Note: [staleness] Updated "<existing title>" — superseded by new finding.
Synthesis as a loading signal: After an entry qualifies, assess whether it required combining information from multiple files, sessions, or components. Synthesis entries load at startup; single-source entries are still captured — they provide real token savings when retrieved on demand — but rank lower in auto-loading naturally. Strong positive indicators of synthesis: architectural models, design rationale, cross-cutting conventions, behavioral directives, mental models, and directional intent.
The existence ≠ recoverability anti-pattern: Information existing in a file is not the same as understanding being recoverable from that file. An agent reading lib.sh can find what slugify does in seconds. What cannot be recovered from a single read is: why that approach was chosen, what alternatives were rejected, or how this function's behavior constrains callers across the codebase. Captures of the latter are reusable; captures of the former are not.
Why > what: A statement explaining why a choice was made is more valuable than a statement describing what was chosen. When both a rationale statement and a factual observation pass the gate, prefer the rationale.
When capturing interactively (outside Step 5's automated flow), use the CLI directly. The --scale flag is required — missing it is an error, not a default:
lore capture --insight "..." --scale "<bucket>" --context "..." --category "..." --confidence "high" --related-files "..."
Scale values: abstract, architecture, subsystem, implementation (single label or two adjacent labels comma-delimited, e.g. subsystem,implementation). See Step 5 for --producer-role, --protocol-slot, and --template-version provenance flags.
Review the conversation for thread-worthy content:
Read the thread index at $THREADS_DIR/_index.json
For each thread, check if this session discussed its topic
While scanning, also detect preference signals — patterns of user behavior or explicit statements that reveal reusable working-style preferences. Look for:
Not preferences: One-off requests, task-specific instructions, or transient choices that won't apply next session.
Scoped vs. global routing: For each detected preference signal, classify before acting:
/pr-review, /implement), a specific file or directory, or only applies under a particular workflow or tool → route to lore capture --category preferences --related-files <paths> --producer-role interactive --protocol-slot Reflection. Use the skill's SKILL.md path or the relevant source file(s) as related_files. Do NOT also write it to thread accumulated_preferences.lore capture and continue to Step 5 thread accumulation as usual.When scope is ambiguous, ask: "would this preference be irrelevant or wrong in a different skill or file context?" If yes → scoped. If it applies equally everywhere → global.
If the thread was discussed, write a new entry file at $THREADS_DIR/<slug>/<date>.md (e.g., how-we-work/2026-02-08.md). If a file for today already exists, disambiguate with session suffix: 2026-02-08-s2.md. Entry files do NOT contain the ## heading — it is reconstructed from the filename at load time. Entry content starts with **Summary:**:
**Summary:** One-sentence overview of what was discussed
**Key points:**
- Specific decisions, shifts, or ideas
**Shifts:** Change from previous entries (optional)
**Preferences:** User preferences or working-style signals observed this session (optional — **include only global preferences here**; scoped preferences were already routed to `lore capture` in step 3 above)
**Related:** [[work:name]], [[knowledge:file#heading]]
Check for new topics that don't match existing threads and had >2 substantive exchanges — these become new thread candidates. Create the directory $THREADS_DIR/<slug>/ with a _meta.json file:
{
"topic": "Human-readable thread name",
"tier": "pinned | active | dormant",
"created": "ISO-8601 timestamp",
"updated": "ISO-8601 timestamp",
"sessions": 0,
"accumulated_preferences": [
{
"preference": "Short description of the preference",
"first_seen": "YYYY-MM-DD",
"last_reinforced": "YYYY-MM-DD",
"source_entries": ["2026-02-06.md", "2026-02-07-s18.md"]
}
]
}
The accumulated_preferences array distills user preferences from thread entries — each entry records first_seen, last_reinforced, and source_entries evidence. Added during /remember and pending digest evaluation. May be empty but must be present for new threads.
Then write the first entry file as in step 4. Update $THREADS_DIR/_index.json to include the new thread.
Mid-session thread awareness: After significant topic shifts or decisions, consider whether a thread update is warranted. Do NOT force updates — only note when genuinely useful. Look for:
_work/ for branch match or recent activity.Capture every qualifying candidate now. This step is mandatory and must not be skipped. /implement Step 5 and /spec Step 5.4 both delegate capture invocation to /remember — a missed capture here propagates silently to every upstream caller with no recovery path. Do NOT defer with "I'll capture later." Do NOT skip because the insight seems obvious. Do NOT skip because the session was short. None of these are valid rationales.
Before capturing, confirm the candidate passes the 4-condition gate OR the orientation gate (Step 2 canonical body has the full criteria for both):
--related-files, (5) Stable at architecture or subsystem altitude only.If neither gate passes, drop the candidate silently and move on. Do NOT downgrade an orientation candidate's --scale to implementation to make it pass — fail closed and drop.
Before invoking lore capture, evaluate whether each qualifying candidate is a Tier 3 commons promotion or a Tier 1 work-scoped / interactive capture:
Use lore promote (Tier 3 path) when ALL four predicates are true:
execution-log.md or plan.md Observations)validate-tier3.sh-accepted Tier 3 row (with claim, why_future_agent_cares, falsifier, source_artifact_ids)source_artifact_ids non-empty (traceability back to Tier 2 source is required)echo '<tier3-json-row>' | lore promote --work-item "$RESOLVED_SLUG" \
--producer-role <role> --protocol-slot Synthesis \
--source-artifact-ids "<artifact-ids>" \
--template-version <hash>
Use lore capture (Tier 1 path) for everything else — interactive sessions, work-scoped insights, scoped preference captures, and any candidate that fails any of the four Tier 3 predicates:
lore capture --insight "..." --context "..." --category "..." --confidence "..." --related-files "..." \
--producer-role <role> --protocol-slot <slot> --template-version <hash> [--work-item <slug>]
Always populate --related-files with concrete file paths the insight describes or depends on. This is the strongest staleness signal — when those files change, the entry gets flagged for review. Err on the side of including files.
Always populate --producer-role, --protocol-slot, and --template-version when values are known; omit the flags entirely (do not pass empty strings) when values are unavailable. capture.sh treats flag presence as a deliberate provenance marker.
--producer-role interactive --protocol-slot Reflection --template-version $REMEMBER_TEMPLATE_VERSIONimplement-lead or spec-lead with --protocol-slot Synthesis), AND the --template-version the caller passesWork item association: When RESOLVED_SLUG is set, add --work-item $RESOLVED_SLUG. Absence of a work item never errors. Scale declaration (--scale) is always required — missing declaration is an error, not a default.
Scale rubric: the 4-bucket definitions (abstract / architecture / subsystem / implementation), boundary tests, and ±1 query pattern live canonically at skills/memory/SKILL.md Scale-Aware Navigation. Consult that section when classifying.
When /remember is delegated by /implement or /spec to promote a specific worker or researcher observation, preserve the original producer's role — not the lead's:
--producer-role <worker|researcher> — the role of whoever produced the observation--capturer-role <implement-lead|spec-lead> — the lead doing the synthesis write--source-artifact-ids "<task-id or report-id>[,<id2>,...]" — IDs pointing back to the producer's artifact--template-version <original-producer-template-hash> — the template hash of the original producer, not the leadSplit on multi-producer synthesis. When a single synthesized claim draws on observations from multiple distinct producers, file one capture call per distinct producer — do NOT merge into a single call with a multi-role --producer-role. Each call keeps its own --source-artifact-ids pointing to that producer's artifact. Rationale: the scale matrix and downstream scorecard attribution both key on a single producer_role; merging erases the hierarchy the matrix exists to preserve.
If RESOLVED_SLUG was set in Step 1b, append a session summary to execution-log.md:
printf 'Captures: %s\nThreads updated: %s\nSummary: %s\n' \
"<N entries captured: title1, title2, ...>" \
"<thread slugs updated or created>" \
"<one-sentence summary of what was done this session>" \
| bash ~/.lore/scripts/write-execution-log.sh --slug "$RESOLVED_SLUG" --source remember --template-version "$REMEMBER_TEMPLATE_VERSION"
If no captures were made and no threads updated, omit the write.
_threads/<slug>/<date>.md, update _meta.json)_meta.json, first entry file, update _index.json)Scope gate: Only accumulate preferences that were NOT routed to lore capture in Step 3. Scoped preferences are stored in the knowledge store (preferences/ category) and must not also be written to accumulated_preferences — that is the double-capture scenario to avoid.
After writing thread entries that contain a **Preferences:** field, update the thread's _meta.json accumulated_preferences array:
_meta.json and its accumulated_preferences array**Preferences:** field:
last_reinforced to today's date and append the entry filename to source_entries{
"preference": "Short description of the preference",
"first_seen": "YYYY-MM-DD",
"last_reinforced": "YYYY-MM-DD",
"source_entries": ["<entry-filename>.md"]
}
[thread: <slug>] Preference updated: "<old>" → "<new>"_meta.jsonAfter all captures are filed, check each new entry for conflicts with existing entries:
lore search "<key terms from entry title>" --type knowledge --scale-set <candidate-scale> --limit 5
learned date than the new entry, compare content. Look for direct contradiction, supersession, or overlap.[conflict] Updated "old title" — superseded by "new title"[conflict] Merged "entry A" into "entry B"related-files metadata and learned dateException: external feedback. If an insight originates from external sources (PR review comments, code review suggestions), prompt the user before capturing — unless capture constraints from Step 1 already specify how to handle external input.
[external] PR reviewer suggested "use dependency injection for testability"
→ Capture to knowledge? [Their rationale: ...]
After capturing, print a concise summary:
[remember] Done.
[knowledge] Captured N entries: "insight 1", "insight 2"
[thread: topic] Updated with today's discussion
[thread: new] Created "topic-name"
[plan: name] Updated session notes
The user can say "don't keep that" or "drop the X entry" after seeing the summary to remove anything.
After capturing:
_meta.json: set updated to now and increment sessions.lore heal.lore work heal.After running heal, check for renormalize flags:
cat "$KNOWLEDGE_DIR/_meta/renormalize-flags.json" 2>/dev/null
If the file exists, sum flags across oversized_categories, stale_related_files, zero_access_entries. If 2 or more total, append to Step 6 report:
[renormalize] N flags detected (oversized: X, stale refs: Y, zero-access: Z) — run /memory renormalize
If 1 flag:
[renormalize] 1 flag (oversized: conventions at 41 entries) — /memory renormalize available when ready
After the checkpoint, return to whatever was being worked on. The checkpoint is a pause, not a redirect.