Use when you need durable Yishan memory: search past decisions and preferences, read `.my-context/` files, or save a lasting decision, discovery, convention or user preference with the `yishan memory` CLI.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Yishan Memory?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/yishan-io-yishan-memory)
---
name: yishan-memory
description: Use when you need durable Yishan memory: search past decisions and preferences, read `.my-context/` files, or save a lasting decision, discovery, convention or user preference with the `yishan memory` CLI.
---
# Yishan Memory
Yishan memory keeps durable facts as entries, one fact per entry. The daemon is the only writer: always use the `yishan memory` CLI, never edit memory files by hand. Add `--output json` when you parse the result.
A session in a Yishan terminal starts with a `<memory>` block: user preferences and pinned entries in full, then one line per other entry naming its scope and slug. Read such an entry with `yishan memory get <slug> --scope <scope>` before you rely on it.
## Scopes
| Scope | What goes there |
|---|---|
| `project` (default) | Decisions and discoveries about this repository |
| `org` | Conventions and decisions of the organization, shared by its projects |
| `user` | The user's own preferences and habits: language, tone, workflow |
Company or project facts never go in `user`: user entries reach every org's sessions. When unsure, use `project`.
The project comes from `--project-id` or `YISHAN_PROJECT_ID`, which is already set in a Yishan terminal. The org scope uses the project's org unless you pass `--org-id`. Never invent or guess an ID.
## Commands
- `yishan memory search "<1-3 keywords>"`: search entries, `.my-context/` documents and task documents. Add `--include-superseded` to see replaced entries.
- `yishan memory list [--scope user|org|project]`: list the entries of one scope.
- `yishan memory get <slug> [--scope ...]`: show one entry in full.
- `yishan memory save --type decision|discovery|convention|preference --title "<one line>" (--body "<text>" | --file <path> | --file -) [--scope ...] [--slug <slug>]`: save one fact. Without `--slug` it creates a new entry named after the title. With `--slug` it updates that entry.
- `yishan memory supersede <slug> --by <slug> [--scope ...]`: mark an entry as replaced by a newer one in the same scope.
- `yishan memory delete <slug> [--scope ...]`: delete an entry that was wrong.
- `yishan memory read <path>`: read one file under `.my-context/`, relative to it.
- `yishan memory history [--scope ...]` and `yishan memory undo <batch-id>`: list recorded changes and revert one batch.
## When to search
Search before you change structure, reopen a past decision, or ask the user to repeat history. Use few, specific keywords. Read the entry or file a result points to before you rely on its snippet.
## When to save
Save when the user states a decision, a convention or a preference that should outlive this session, or when you find a non-obvious fact that a future session would otherwise rediscover. Do not save what the code, git history or `.my-context/` documents already record, or what only matters to this task.
- One fact per entry. The title is one line. The body states the fact, then `Why:` and `How to apply:`.
- Search or list first. If an entry already covers the fact, update it with `--slug`. If the new fact replaces an old one, save the new entry, then `supersede` the old one.
- Ask the user before you delete an entry or save a `user` preference they did not state.
## Failure handling
- Exit code 2 means a usage error, such as a missing project. 4 means not found. 5 means a path outside `.my-context/`. Report the message. Do not work around it.
- A stopped daemon is started for you. If the command still fails, tell the user.