一键导入
context
Manage Serena memories and session context — load, save, refresh, inspect, and clear project knowledge
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Manage Serena memories and session context — load, save, refresh, inspect, and clear project knowledge
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Analyze prompt cache hit rates, estimate cost savings from cached system prompts and memories, and recommend improvements to caching strategy. Use when checking cache performance, investigating high token costs, optimizing cache hit rates, or diagnosing slow cache warmup.
Initialize Claude Code optimization for a new project — detect stack, create memories, generate constitution, configure settings
Reduce token usage by selecting a planning strategy, loading Serena memories, enforcing symbol-first exploration, and reporting savings. Use when starting a non-trivial task, asking to reduce token costs, requesting efficient execution, or wanting optimized Claude Code workflows.
Search the web for latest Claude API changes, compare findings to existing documentation, and apply targeted updates to keep prompts and configs current. Use when docs are outdated, after a Claude API update, to refresh system prompts, or to validate documentation accuracy.
Close the loop on a skill/prompt/convention library: mine recurring review feedback into rules, fold them back into the generator, and gate every change through a three-tier evaluation (deterministic lint + trigger accuracy + LLM judge) that converges instead of drifting. Use when a correction keeps recurring across skills/PRs, when adding or revising skills warrants a quality gate, or when asked to "harden the skill library", "run the eval", "lint skills", or "close the loop". Composes with your existing execution, memory, and governance layers.
Preserve the OPERATIONAL THREAD across coding sessions with a repo-local, inspectable .continuity/ surface and a resume -> work -> finalize lifecycle. Not another memory store — a thin lifecycle layer over the memory you already have. Use at the START of substantial work on a repo ("resume", "where were we", "pick up") and at the END ("finalize", "hand off", "wrap up") so the next session starts from bounded, evidence-weighted state instead of re-orienting from scratch. Complements (never replaces) Serena/Svod/codebase-memory/auto-memory.
| name | context |
| description | Manage Serena memories and session context — load, save, refresh, inspect, and clear project knowledge |
| version | 1.0.0 |
Manages the Serena memory system that stores architectural knowledge, conventions, and project context. Loading memories at the start of a session saves 60-70% of tokens by eliminating repeated file reads.
| Use this skill for | Use a simpler approach for |
|---|---|
Starting a session on a project with existing memories — load before any code work | A repo with no memories yet and one quick edit — just read the one file |
Capturing durable architecture / conventions / deploy knowledge that outlives the session (save, create) | An ephemeral session fact — let auto-memory / MEMORY.md hold it |
| Refreshing a memory after a major refactor so Claude stops making stale assumptions | A memory touched days ago on an unchanged codebase — it's still current |
Auditing what's loaded and what caching is buying you (inspect, list) | A single-file lookup where symbolic exploration answers it directly |
Start simple. Reach for this skill only when the project has (or clearly warrants) reusable
memories — don't scaffold a memory set for a one-off task. Without Serena, use
/optimize instead; it has fallback strategies.
/context [action] [name]
/context load # Load all relevant memories for current project
/context list # Show all available memories
/context save architecture # Create or update the architecture memory
/context refresh codebase-conventions # Regenerate a stale memory
/context inspect # Show what's currently loaded + cache status
/context clear # Unload all memories from context
Compact dispatch below. For the full process steps, parameters, and output formats of any action, read references/actions.md.
| Action | What it does | When to run |
|---|---|---|
load | Load core memories (architecture, codebase-conventions) + conditionally load module/testing/docker/deployment memories by task context | Start of every session, before code work |
list | List all project memories with last-updated + load/cache status | To see what's available |
save [name] | Gather context → structure as Markdown → write .serena/memories/[name].md | After learning something durable worth persisting |
refresh [name] | Re-explore the code and overwrite an existing memory with current state | After a major refactor, a new module, or a memory >2 weeks old |
inspect | Show loaded memories, token sizes, cache hit rate, and project/Serena/constitution status | To audit context + caching |
clear | Unload all memories from the current conversation (does not delete files) | Switching projects or context is stale |
create [name] | Interactive memory creation — asks what to document and how to structure it | When you want to build a memory step by step |
save/create follow the house memory structure and per-topic template catalog in
references/memory-templates.md — read it before writing a memory.
| Without memories | With memories |
|---|---|
| Read files per session | Load cached memories |
| ~15-25K tokens/session for context | ~1.5-2.5K tokens/session |
| 100% cost each time | 10% cost after first load (cached) |
| Savings: 60-70% per session |
Always
load at the start of a session before code work — it's the whole point of the memory system.Ask first
refresh and save overwrite an existing memory — confirm before discarding curated, user-authored content..serena/ (they become visible in diffs to teammates).Never
clear — clear only unloads from context; the files stay on disk.Common failure modes (no memories found, Serena not connected, memory outdated) and their fixes are in references/troubleshooting.md.
/optimize — Uses loaded context for token-efficient work; the fallback when Serena is unavailable/init-project — Creates initial memory set for a new project/cache-inspector — Monitor cache performance