Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
By mahuebelv0.13.1In 1 marketplace
Segmented, scoped memory for agents: one file, SQLite, no daemon. Wake at session start, recall on every prompt, staleness nag at stop.
Claude loads one when your task matches it, or you run it by name.
1 critical · 1 caution to review before installing
JavaScript or TypeScript that runs inside Claude Code as you, unsandboxed. Read from its source, it sees, changes or blocks tool calls; runs programs; reads or rewrites your prompts; changes what Claude reads (system prompt, context, reminders).
A hook runs when Claude uses the Bash tool
Static checks of hooks, mods, MCP servers and commands. Not a security audit.
1 marketplace, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Long-term memory for coding agents that knows the difference between who you are, how this repo works, and what happened on Tuesday.
One Python file. SQLite. No server, no daemon, no API key. Works with any agent that can run a shell command. On Claude Code and Codex CLI, hooks make the startup read and per-prompt recall automatic.
An agent forgets everything when the session ends. Bolt-on memory tools fix that by appending every note to one timeline, and two things go wrong:
Both come from the same mistake: storing facts with different lifetimes on one axis. segmem gives each fact a kind (how it decays) and a scope (where it applies), then loads only what the current project needs.
At the start of a session, in the segmem repo:
## Memory (project: segmem)
### Identity
#3 prefers short commits, one concern each (global)
### Procedural
#7 prefers pnpm (global) OVERRIDDEN by #12 uses npm, Lambda runtime needs it (segmem)
#9 tests: python3 test_segmem.py (segmem)
### People known: alice
Run `segmem recall <name>` before acting on or about them.
### Episodic (segmem), oldest first
#0-3 2026-08-21 chose SQLite over DuckDB; stdlib, WAL, FTS5
#4 2026-08-21 naps come due only for blocks the wake cover prints
#5 2026-08-22 wake runs from a SessionStart hook; the agent skipped it once
You are awake.
Global preferences load whole. The project's conventions load whole and win over global ones, with both shown so the agent knows why. History loads with detail that decays: yesterday verbatim, last month as one line. People load as names only; the agent looks them up when they come up.
Requires Python 3.8 or later and git. Nothing else.
/plugin marketplace add mahuebel/segmem
/plugin install segmem@segmem
That's the whole install: the three hooks register automatically, and the
doctrine (what to record and when) is injected at session start, so there is
no CLAUDE.md paste and no settings.json merge. Skip the manual steps below.
The hooks they print claim each session with --once, so running both no
longer doubles wake and recall, but it still starts a second process per event.
git clone https://github.com/mahuebel/segmem ~/.segmem/src
~/.segmem/src/segmem init
init prints two things:
## Memory block. Paste it into ~/.claude/CLAUDE.md (or your agent's
AGENTS.md). It tells the agent what to record and when.hooks block. Merge it into ~/.claude/settings.json (Claude Code) or
save it as ~/.codex/hooks.json (Codex CLI); both use the same shape. It
makes the harness run wake at every session start and search memory on
every prompt, so neither depends on the agent remembering.On a harness without hooks (Cursor, Aider, your own), skip step 2. The prompt
block alone carries it: the agent runs wake and recall itself. That works,
but it relies on the agent following instructions. If your harness can run a
command at session start or pipe each prompt to a command, point it at
segmem wake and segmem hook; hook accepts the JSON that Claude Code and
Codex send, or plain text, on stdin.
Start a new session. The first wake prints an empty header; the agent fills
it in as you work.
| Kind | Holds | At wake | Replaced by newer facts? |
|---|---|---|---|
identity | who you are, how you like to work: "prefers" | loaded whole | yes |
procedural | how this project works and why: "uses" | loaded whole | yes |
episodic | decisions with reasons, root causes, handoffs | decaying window | no, it's history |
people | who someone is | names only | yes |
The word choice is the classification. Prefers is about you and goes global. Uses is about a repo and stays there.
--entities=a,b tags a fact with its subjects: people, components, files.
Tags are one vocabulary across projects. When you write one that matches an
existing tag ignoring case, the stored spelling wins; when it's new but close
to an existing one, note says so (new tag: github_actions (similar: github-actions)), and you use the suggestion next time. A tag that looks
like a name with no people record gets a nudge to create one. recall
prints tags in brackets so you can see what's in use.
Tags earn their keep in three places: they pair project facts with the
global facts they override, they let promote match the same fact across
projects, and they're what makes a capitalized word in a prompt count as
something worth looking up.
npx claudepluginhub mahuebel/segmem --plugin segmemBuilt from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
Plugins from other owners that cover similar ground