/linksee-memory:linksee-memoryfrom Linksee Memory
Persists agent learnings, caveats, and implementation history across Claude Code sessions. Automatically recalls past context before tasks, file edits, or after failures to prevent repeated mistakes.
Ships in Linksee 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.
None: SKILL.md is the whole skill.
This skill is the only way to persist agent growth across sessions.
Claude Code forgets everything when a session ends. The solution the user taught yesterday, the failure you hit today, the decision made three days ago — all of it is normally lost. linksee-memory is the "memory that doesn't disappear" device.
Writes happen automatically only when linksee-memory setup installed the Stop hook. The Claude Code plugin alone has no hooks: nothing is saved unless the agent calls remember. Either way, reads require the agent to actively pull. This skill instills that "go look first" habit in the agent.
JP: Claude Code は session が終わると全部忘れる。linksee-memory は「消えない記憶」を作る装置。書き込みの自動保存は setup で Stop hook を入れた場合だけ。plugin 単独では hook が無いので、remember を呼ばない限り何も保存されない。読み出しはどちらでもエージェントが能動的にやる必要がある。
Tool names depend on how linksee-memory was installed. The examples below use the short tool name (recall, remember, …). Registered with npx -y linksee-memory setup or claude mcp add, the full name is mcp__linksee__<tool>; installed as the Claude Code plugin, it is mcp__plugin_linksee-memory_linksee__<tool> (why). Use whichever is present in your tool list.
Which layer you record into determines later retrieval accuracy.
| Layer | When to use | Example |
|---|---|---|
🎯 goal | The user states a clear goal | "want to integrate with freee", "want to npm publish" |
📍 context | Background on when/why this is happening | "because there's a meeting with company X on Wednesday" |
💭 emotion | User's temperature / tone | "tired", "excited", "stressed", 「疲れた」「焦ってる」 |
🔧 implementation | Code written, configured, worked / didn't work | success: "OAuth flow works" / failure: "stopped with auth_expired" |
⚠️ caveat | Lessons you never want to repeat (auto-protected from forgetting) | "freee OAuth expires in 24h", "never edit this file" |
📈 learning | Learned something new, prior belief updated | "AST chunking beats line diff for token savings" |
Important: caveat layer is automatically protected from forgetting. Pain records are never deleted.
Pin-via-importance (v0.1.0+): Calling remember with importance: 1.0 pins the memory across all layers, protecting it from auto-forget even outside the caveat layer. Use for "mission-critical goals", "key decisions", etc.:
remember({
entity_name: "KanseiLink", entity_kind: "project",
layer: "goal", content: "Plugin Marketplace submission under review",
importance: 1.0 // pin
})
Layer aliases — no need to memorize canonical names. Natural language aliases resolve automatically:
| Natural alias | → canonical |
|---|---|
decisions / insights / learned | learning |
warnings / rules / pitfalls / dont | caveat |
how / tried / attempts / success / failure | implementation |
why / intent / goals / targets | goal |
background / reason / situation / timing | context |
tone / feelings / mood | emotion |
remember() callsThe 6-layer system tells you WHICH DRAWER. The 3-axis system tells you WHAT KIND of memory goes in it. Every content field must be a JSON string containing these 3 axes:
| Level | Description | Survives |
|---|---|---|
mission | Company/product-level direction ("KanseiLINK is the intelligence layer for the Agent Economy") | Permanent |
strategy | Approach to achieving mission ("AEO-first, 引き出しカタログ model") | Permanent |
architecture | System design decisions ("2-layer: Memory=agent-optimized, Dashboard=human-optimized") | Long-lived |
implementation | Specific code/config changes ("Added FTS5 trigram index") | Auto-archives after 30d if untouched |
| Type | Description |
|---|---|
question | User asked something, answer pending or delivered |
comparison | Multiple options analyzed (e.g., Stripe vs Square) |
decision | A choice was made — store agent_proposal + user_approval_scope |
work | Code written, config changed, command run |
outcome | Result of work (success/failure + what happened) |
learning | Insight gained, prior belief updated |
note | General context — chitchat = DISCARD, do NOT save |
open → decided → in_progress → done
→ stalled (blocked, can't proceed)
→ parked (intentionally paused)
→ superseded (replaced by newer decision)
contentEvery remember() call MUST use this JSON format in the content field:
{
"title": "<one-line: WHAT this memory IS — future-agent skims this>",
"altitude": "strategy",
"type": "decision",
"state": "decided",
"what": "<the actual content — 5W1H extracted, NOT raw chat>",
"why": "<why this matters — the reasoning>",
"affects": ["src/mcp/server.ts", "lib/db.ts"],
"next_action": "Implement the schema migration next session",
"supersedes_id": null,
"evidence_refs": [
{"type": "session", "id": "b78dc5ba", "label": "Architecture discussion"}
]
}
| Field | Type | Description |
|---|---|---|
title | string | One-line summary. Future agents read ONLY this when scanning. Make it specific: "freee OAuth 24h expiry caveat" not "OAuth issue" |
altitude | enum | mission / strategy / architecture / implementation |
type | enum | question / comparison / decision / work / outcome / learning |
state | enum | open / decided / in_progress / done / stalled / parked / superseded |
what | string | The semantic content. Extract 5W1H from conversation — NEVER store raw chat like "そうだね。全部やろう。" |
why | string | Why this matters. Without this, future agents can't judge relevance |
| Field | Type | Description |
|---|---|---|
agent_proposal | string | What the agent proposed (the full context the user was responding to) |
user_approval_scope | string | What EXACTLY the user approved — "うん全部やって" → translate to "approved all 6 panels of Agent Brain Dashboard including data layer, API route, and view component" |
| Field | Type | Description |
|---|---|---|
affects | string[] | File paths or areas this touches. Critical for future recall_file accuracy |
next_action | string / null | What should happen next. Null if done/completed |
supersedes_id | number / null | Memory ID this replaces. Content only — the link that recall acts on is the remember argument supersedes: <id> (0.18.0) |
prior_belief | string | What we used to think (for learnings — enables belief-update tracking) |
evidence_refs | object[] | Links to evidence: `{"type": "session" |
| ❌ DO NOT | ✅ INSTEAD |
|---|---|
Store raw chat: "決めた。それでいこう" | Extract: "Decided to use 2-layer architecture splitting Memory (agent-optimized) from Dashboard (human-optimized)" |
Store ambient chat: "書斎で無糖のサイダー飲んでる" | Discard. Not a memory. |
Store vague approval: "うん全部やって" | Extract the SCOPE: "Approved: (1) agent-brain data layer, (2) API route, (3) 6-panel view component implementation" |
| Paste back assistant output as memory | Summarize the KEY INSIGHT from the output in YOUR words |
Store without why | Always include WHY — without it, memory is noise |
First call of a session: recall() with no arguments. It returns the session brief — what
needs attention (🔴/🟡 anchors), where you are on the Map, open loops (proposals to triage,
raw memories to distill, friction at the gate), and the top entities. One call, small, complete.
Then search with recall({ query }) for the task at hand.
Before starting any new task, inject past context.
At the very beginning of a conversation, use list_entities first to understand what you know:
list_entities({ min_memories: 5, limit: 10 })
The returned "high-momentum entities" are the projects likely to be discussed. Each entity's layer_breakdown reveals patterns ("this project has many caveats", "goal is unfinished", etc.).
Then, once a specific task starts, recall:
recall({
query: "<keywords of current task — project name + technology>",
max_tokens: 2000
})
Example: User says "let's add a new tool to KanseiLink":
recall({ query: "KanseiLink new tool", max_tokens: 2000 })
In the returned memories, pay special attention to:
caveat layer — traps to absolutely avoidlearning layer — previously-reached conclusionsimplementation.failure — past failure patternsUsing the results:
From past caveat: "Watch out for MCP tool name collisions"
→ Before adding a new tool, check existing tool names first.
The recall engine uses FTS5 full-text search + heat_score ranking. Your query determines what comes back.
| Pattern | Query style | Example |
|---|---|---|
| Entity + topic | "<entity> <topic keyword>" | "KanseiLink OAuth" |
| Error recall | "<error message core> <technology>" | "401 freee token expired" |
| Decision recall | "<entity> decided strategy approach" | "Linksee Memory plugin vs MCP" |
| File-related | Use recall_file instead | recall_file({ path_substring: "server.ts" }) |
| Cross-entity | Call recall TWICE for each entity | recall({ query: "KanseiLink" }) then recall({ query: "Linksee Memory" }) |
Anti-patterns:
recall({ query: "what happened" }) — too vague, FTS5 matches everythingrecall({ query: "the user said to fix the bug in the auth flow" }) — natural language sentences score poorly in FTS5recall({ query: "auth bug fix caveat", layer: "caveat" }) — keywords + layer filter = preciseBefore touching a specific file, check its edit history:
recall_file({
path_substring: "<file path or substring match>",
max_intents: 5
})
Returns: the file's entire edit history + the user message that drove each edit.
This is the key differentiator. Mem0 / Letta don't have this. "Why was this file changed last time" is preserved.
When you need to read a file, use read_smart instead of the standard Read tool:
read_smart({
path: "<absolute path>"
})
Effect:
Especially effective for large files (>1000 lines).
When facts change / goal updated / caveat detail needs correction: forget + remember breaks memory_id continuity, cutting the session_file_edits links. Use update_memory instead:
update_memory({
memory_id: 1234,
content: '{"primary": "Plugin Marketplace under review (day 7)", "deadline": "2026-04-25"}',
importance: 1.0 // strengthen pin
})
layer can also be changed, but demoting from caveat to another layer is not allowed (auto-protected).
The moment an error, failure, or "doesn't work" happens, record immediately:
remember({
entity_name: "<project name or service name>",
entity_kind: "project",
layer: "caveat",
content: JSON.stringify({
title: "<one-line: what failed + the rule>",
altitude: "implementation",
type: "outcome",
state: "done",
what: "<what failed + workaround found>",
why: "<root cause analysis>",
affects: ["<file paths where the error occurred>"],
next_action: null
}),
importance: 0.8 // failures are high-importance
})
Example:
{
"title": "freee OAuth token expires in 24h — must refresh proactively",
"altitude": "implementation",
"type": "outcome",
"state": "done",
"what": "freee MCP OAuth token expires in 24 hours. Reusing access_token directly causes 401. Must call refresh_token endpoint proactively.",
"why": "freee's OAuth implementation uses short-lived tokens unlike most SaaS (usually 30-90 day expiry)",
"affects": ["src/integrations/freee/auth.ts"],
"next_action": null,
"evidence_refs": [{"type":"session", "id":"02759...", "label":"freee auth_expired incident"}]
}
Why this matters: caveat is auto-protected from forgetting. Once recorded, a future agent in a different session avoids the same failure.
When you understand something new, change approaches, or solve a problem:
remember({
entity_name: "<entity>",
entity_kind: "project | concept | ...",
layer: "learning",
content: JSON.stringify({
title: "<one-line: what was learned>",
altitude: "<strategy|architecture|implementation>",
type: "learning",
state: "done",
what: "<the insight>",
why: "<why this changes how we work>",
prior_belief: "<what we used to think>",
affects: ["<file paths if applicable>"],
next_action: "<follow-up action if any>"
}),
importance: 0.7
})
Recording prior_belief leaves a belief-update history. Later, this becomes the evidence for "why was this decision made".
recall first (even briefly)recall_fileread_smart over Read for larger filescaveat immediately (on the spot — don't defer)learningRead everywhere instead of read_smart (wastes tokens)consolidate tool — there is none; consolidation is a CLI subcommand / server opt-in (see below)recall({ query: "what happened last time" }) — use specific keywordsThere is no consolidate tool. Consolidation clusters cold, low-importance memories older than 7 days into one learning-layer entry. Since 0.18.1 it keeps the originals: each gets consolidated_into: <summary id> and recall hides it by default (consolidated_hidden says how many; include_consolidated: true shows them). Up to 0.18.0 it deleted them — rows lost that way come back only from a backup. It never runs on its own: the user runs npx -y linksee-memory consolidate --dry-run (shows) / --apply (folds), or starts the server with LINKSEE_AUTO_CONSOLIDATE=1 (at start-up, at most weekly).
Do not suggest turning it on as routine housekeeping. If the user asks about a large DB, say what it does (summaries + hidden originals, nothing deleted) and point at --dry-run first.
caveat memories and active goal memories are never consolidated away.
User: "Today I'm back on the XYZ project"
1. recall({ query: "XYZ", max_tokens: 2500 })
2. Review returned caveat / learning / goal
3. Tell user "Picking up from last time..." with a one-line status
4. Resume work grounded in that context
User: "Wait, I feel like I've seen this error before..."
1. recall({ query: "<core keywords of the error message>", max_tokens: 1000 })
2. Pull workaround from past caveat
3. Reply: "Last time (DATE), we hit the same error and solved it with X."
4. Apply the workaround
User: "Fix server.ts"
1. recall_file({ path_substring: "server.ts" })
2. Review past edit frequency and reasons
3. Report: "This file has been edited N times. Last edit was to <reason>."
4. Perform the edit in that context
5. After editing, record success / failure via implementation layer
User: "Let's switch to Stripe for payments"
Key: BEFORE recording a decision, check if a past decision on the same topic exists. This prevents flip-flopping and builds on prior reasoning.
1. recall({ query: "<entity> <topic> decided strategy", layer: "learning", max_tokens: 1000 })
→ Look for: type="decision", state="decided" memories on the same topic
2. If past decision found:
a. Tell user: "Previously we decided <X> because <reason>. Override?"
b. If user confirms override → `remember({ content, supersedes: <old memory_id> })` (recall then hides the old decision)
c. If user says "oh right, keep it" → no new memory needed, proceed
3. If no past decision found → proceed to record (see Case E below)
Example: Past memory says "Decided: Square over Stripe due to SG tax handling". When user now says "switch to Stripe", surface that context FIRST. The user may not remember the original reasoning.
User: "Alright, let's switch to Sonnet"
Key: capture WHAT was decided, WHY, and what the user was responding to — not the raw chat.
1. remember({
entity_name: "<project>",
entity_kind: "project",
layer: "learning",
content: JSON.stringify({
title: "Model switch: Opus → Sonnet for this project",
altitude: "architecture",
type: "decision",
state: "decided",
what: "Switched default model from Opus to Sonnet for this project",
why: "Sonnet is faster and cheaper for implementation-heavy work; Opus reserved for architecture decisions",
agent_proposal: "Suggested Sonnet for faster iteration on implementation tasks",
user_approval_scope: "Approved switching default model to Sonnet for all tasks in this project",
prior_belief: "Was using Opus for everything",
affects: [".claude/settings.json"],
next_action: null
}),
importance: 0.8
})
2. Brief confirmation: "Recorded."
3. From here, proceed assuming Sonnet
User: "That's it for today"
Key: extract the SEMANTIC decisions and outcomes, not raw chat dumps.
1. For each major decision made during the session:
remember({
entity_name: "<project>",
entity_kind: "project",
layer: "learning",
content: JSON.stringify({
title: "<one-line: what was decided>",
altitude: "<strategy|architecture|implementation>",
type: "decision",
state: "decided",
what: "<5W1H extraction of the decision>",
why: "<reasoning behind it>",
agent_proposal: "<what you proposed>",
user_approval_scope: "<what exactly user approved>",
affects: ["<file paths>"],
next_action: "<what's next>",
evidence_refs: [{"type":"session", "id":"<current_session_id>", "label":"<topic>"}]
}),
importance: 0.85
})
2. For each failure/lesson:
remember({
...,
layer: "caveat",
content: JSON.stringify({
title: "<one-line: what went wrong and the fix>",
altitude: "implementation",
type: "outcome",
state: "done",
what: "<what failed + workaround found>",
why: "<root cause>",
affects: ["<file paths>"],
next_action: null
}),
importance: 0.8
})
3. Report: "Recorded N decisions, M caveats. Retrievable via recall."
Conversations are tree-shaped but experienced linearly. When you present multiple options and the user engages with only some, the rest become "orphaned proposals" — unresolved decision branches that both you and the user lose track of.
WHEN TO FLAG:
1. Review the session: which proposals did you make that the user never addressed?
2. For each one:
declare_anchor({
kind: "proposal",
statement: "[未解決] LinkedIn B2B: SaaS企業のCTO/VPE向けDMアウトリーチ",
rationale: "3つのGTMチャネルを提示したがX/Twitterのみ採用。LinkedIn経由の検討が未着手",
domain: "growth",
confidence: 0.5,
decided: "X/Twitter data-driven growth",
siblings: ["X/Twitter", "LinkedIn B2B", "Dev Community"],
session_context: "GTM channel strategy discussion"
})
→ { anchor_id, candidate_id }
3. Report: "Flagged N unresolved proposals for dashboard review."
Each proposal becomes a review-state anchor on the Linksee Dashboard — visible until the user decides. This is declaration, not mining: you are the curator recognizing what went unaddressed.
Not all orphaned proposals are worth surfacing. Many are outdated, already implicitly resolved, or irrelevant to the current direction. recall({ dream: true }) returns the project's North Star (direction/goals/ICP/phase) alongside accumulated proposals so you can evaluate each one.
Think like a General Doctor doing triage: the North Star is the patient's chart, each proposal is a symptom. Not every symptom needs treatment.
When to run the triage (recall({ dream: true })):
1. recall({ dream: true })
→ Returns: north_star + candidates[] (each with candidate_id)
2. For each candidate, evaluate against North Star:
- Does this affect the current phase/goals? → surface
- Is this for a different ICP or future phase? → dismiss
- Already implicitly resolved by later decisions? → dismiss
3. resolve_drift({
candidate_id: <id>,
action: "surface" | "dismiss",
rationale: "North Star says ICP = solo devs; this is enterprise-only → dismiss"
})
Example evaluation against North Star:
North Star: "local-first agent memory for solo devs, HN Launch phase"
Candidate A: "CLI-first onboarding wizard"
→ SURFACE: directly improves DX for ICP, relevant to HN launch
Candidate B: "AR glasses integration (2027-28)"
→ DISMISS: outside current phase, future vision only
Candidate C: "kintone enterprise integration"
→ DISMISS: ICP mismatch (enterprise B2B vs solo devs)
The North Star is declared via declare_anchor(node_type: "north_star") and should be updated when the project enters a new phase (e.g., post-HN → growth phase). This keeps the Doctor's judgment frame current.
recall({ dream: true }) call)Only if setup installed the hooks. The Stop hook (auto-capture) and the SessionStart digest exist only when linksee-memory setup wrote them into settings.json. With the plugin alone, or in Cursor / Codex / Gemini, nothing is captured automatically and no digest appears: the queue holds only what was imported by hand, and is usually empty. recall({ dream: true }) works either way.
When the Stop hook is installed, it captures decisions/caveats as RAW user utterances (no LLM runs in the hook path — heuristic extraction is the best it can do). recall({ dream: true }) returns them as distill_queue. You are the distiller.
When: every recall({ dream: true }) call — drain up to 8 items while triaging proposals. When setup installed the SessionStart hook, its boot digest reminds you while the queue is non-empty.
1. recall({ dream: true }) → distill_queue: [{memory_id, layer, title, altitude, type, state,
raw_what, context_hint, affects, created,
truncated?, content_full}]
raw_what / context_hint are cut at 220 characters; `truncated` lists the ones that were.
Read content_full (every stored key, uncut). Never copy a cut value back.
One reply carries at most 200 KiB of content_full: `more: true` means call again;
a row with content_full_omitted is too large — read it from the database first.
2. For each item, rewrite into ONE clean record:
- what = the actual decision/warning in one line — RESOLVE references
("a)やろう" → what option a actually was, using context_hint)
- why = the real reason, never "detected by pattern match"
- keep layer as-is (protected caveats cannot move —
put the true type in the content `type` field instead)
- "distilled": true ← REQUIRED. This marker protects your rewrite from the
next session re-import. Omit it and the raw utterance silently resurrects.
- "needs_distill": null, "context_hint": null ← null removes the key
3. remember({ memory_id: <id>, merge: true, content: <JSON with ONLY the keys you change> })
merge keeps every key you do not send (title, affects, evidence_refs, session_id, axes).
Without merge: true, content replaces the whole record and every key you leave out is gone.
4. No real decision in raw_what? → type: "note", state: "superseded"
(false positives get retired in place, never deleted).
Referent unresolvable (another session's numbered list)? → distill honestly:
state what IS known, point evidence_refs at the source session.
Quality bar (measured 2026-06-10, n=32): 81% fully resolvable. What resolves references is YOUR cross-session memory — if raw_what mentions unfamiliar codenames, recall the project first, then distill.
User: "Remember this: DocuSign is more stable than CloudSign"
1. remember({
entity_name: "CloudSign vs DocuSign",
entity_kind: "concept",
layer: "caveat",
content: JSON.stringify({
title: "DocuSign-JP >> CloudSign for reliability",
altitude: "strategy",
type: "comparison",
state: "decided",
what: "CloudSign (61% success) is significantly less reliable than DocuSign-JP (100% success). Recommend DocuSign when advising customers.",
why: "Based on KanseiLINK agent success rate data across multiple integrations",
affects: [],
next_action: null
}),
importance: 0.9 // user-explicit instruction = high priority
})
2. Confirm: "Recorded. Since it's in the caveat layer, it won't be forgotten."
This is the precision memory killer feature. When you're about to take an action that could go wrong, check for past caveats BEFORE acting — even if the user didn't ask.
Trigger: You are about to do something risky or irreversible:
1. recall({ query: "<entity> <action keyword>", layer: "caveat", max_tokens: 800 })
2. If caveat found:
a. STOP before acting
b. Tell user: "⚠️ Past caveat: <title>. <what>. Proceed anyway?"
c. Wait for confirmation
3. If no caveat → proceed normally
Example: About to run npm publish:
recall({ query: "npm publish", layer: "caveat", max_tokens: 500 })
→ Caveat found: "npm token rotation — always verify token validity before publish"
→ "⚠️ Past caveat: npm token may need rotation. Want me to check `npm whoami` first?"
Why this matters: This is what separates precision memory from ambient memory. Ambient memory passively injects everything. Precision memory actively intervenes at the moment it matters most — when you're about to make the same mistake twice.
linksee-memory is fully local:
~/.linksee-memory/memory.db (inside the user's PC)If the user asks "does our data leave my machine?", answer:
"By default, nothing leaves. Unless you explicitly enable telemetry, everything is in a local DB. A copy of ~/.linksee-memory/memory.db is the only backup you need."
The KanseiLink skill and linksee-memory skill work best together:
User: "Create an invoice via freee"
↓
[linksee-memory skill fires] recall({query: "freee"})
→ past caveat: "fetch company_id first"
→ past learning: "OAuth 24h refresh required"
↓
[kansei-link skill fires] search_services({intent: "invoice"})
→ freee verified, trust 0.9
→ get_service_tips reveals pitfalls
↓
Now you have both bodies of knowledge before starting
KanseiLink = collective knowledge about external SaaS / linksee-memory = collective knowledge about your own past. Two wheels of the same cart.
| Moment | recall precision | Why |
|---|---|---|
| Day 1 | low (little data) | the Stop hook (if setup installed it) or your own remember calls are still collecting |
| Week 1 | medium | thousands of memories, FTS5 kicks in |
| Month 1 | high | heat_score stabilizes, important memories surface |
| Month 3+ | strongest | learnings crystallized (distilled) |
"Gets smarter with use" — time is on your side. Today's record is read by tomorrow's you.
This skill runs on top of linksee-memory MCP v0.4.0+.
Auto-write via the Stop hook when setup installed it (the plugin has no hooks), explicit read via recall.
Listed in MCP Official Registry, PulseMCP, mcpservers.org, Glama.
MIT License — Synapse Arrows PTE. LTD.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
memory, session-persistence, agent-memory, context-recall, linksee
npx claudepluginhub michielinksee/linksee-memory --plugin linksee-memoryOther plugins' skills for the same job