mem
Use at the start of work, after every decision, hurdle or state change, and when continuing a previous session, to keep the session log current with mem.
Synopsis
The YAML description states when to use this skill. disable-model-invocation is unset.
Source file: skills/mem/SKILL.md.
Front matter
- name
mem- description
- Use at the start of work, after every decision, hurdle or state change, and when continuing a previous session, to keep the session log current with mem.
- disable-model-invocation
- unset
Full contents
---
name: mem
description: Use at the start of work, after every decision, hurdle or state change, and when continuing a previous session, to keep the session log current with mem.
---
# Session memory
The session log survives compaction and outlives the turn. A fact you never
wrote down is a fact the next session has to rediscover.
## Flush on a rhythm
Flush at least every five turns, and after every decision, hurdle or state
change. A milestone-only habit loses the middle of the work.
```console
$ mem flush
```
`mem flush` rewrites the log from the transcript. Run it at the end of a block
of work, not only when a task ends.
## Keep the plan current
`mem now` holds five fields: goal, next, state, blockers and paths. It stays
current throughout the work, not only at the start.
```console
$ mem now goal "add the mem skill to the pack"
$ mem now next "register the skill on the site"
$ mem now state "SKILL.md drafted"
$ mem now blockers "none"
$ mem now paths "skills/mem/SKILL.md, website/render-skill-pages.py"
```
`mem now` with no argument shows the current plan.
## Record facts explicitly
Every durable fact you learn goes in with `mem add ID "fact"`, and comes out
with `mem rm ID` the moment it stops being true. IDs are uppercase, one or two
hyphenated words.
```console
$ mem add MEM-ROOT 'logs live under $MEM_ROOT, default ~/.local/share/llm-sessions'
$ mem add READY "the build passes on the feature branch"
$ mem rm READY
```
`mem add` replaces the same ID in place, so use it to correct a fact rather
than adding a second version. `mem list` and `mem get ID` read the session's
knowledge back.
## Notes
`mem note` keeps numbered lines. `add` appends, and `--at N`, `--after TEXT`
or `--before TEXT` insert. `set N`, `rm N` and `--match TEXT` edit and delete.
```console
$ mem note add "the pack lists skills in website/render-skill-pages.py ORDER"
$ mem note add --after "ORDER" "and in website/deploy.nix staticPaths"
$ mem note set 2 "and in the homepage sheet"
$ mem note rm 2
```
## Name the session
A few turns in, once the task is clear, give the session a name.
```console
$ mem rename mem-skill
```
## Hand the log to a later session
`mem export` writes Now, Knowledge and Notes as markdown. `mem import` reads
such a file back into the current session: facts keep their IDs, and an
existing fact with the same ID is replaced.
```console
$ mem export --out notes/2026-11-24/mem-skill.md
$ mem import notes/2026-11-24/mem-skill.md
```
Export before a handoff. Import at the start of the session that continues the
work.
## Facts that outlive the project
`mem global add` writes to the global knowledge file. Use it for a fact that
holds beyond this repository, and remove it with `mem global rm` when it stops
holding.
```console
$ mem global add BUN "Bun is the app runtime for SlopKit projects"
```
## Never edit session files directly
Write through `mem`. It owns the file format, the index and the log rewrite.
Hand-edited log lines are lost on the next `mem flush` unless they are
`decision` or `hurdle` lines inside a turn block.