engram

command module
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 5, 2026 License: MIT Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

engram

A terminal UI for browsing, searching, and sharing your Claude Code memories.

engram is a fast, single-binary TUI that surfaces the memories Claude Code keeps on your machine — across all your projects — in one searchable place. Browse them, read them rendered as markdown, edit them in your $EDITOR, and share the useful ones with your team over any git host.

The name comes from neuroscience: an engram is the physical trace a memory leaves in the brain. That's exactly what these files are — the traces Claude keeps so it can remember things across sessions.

Latest release: v0.5.0 · open source (MIT) · website: engram.im · what's next: ROADMAP.md · design: SPEC.md

Why

Claude Code already stores memories as markdown files under ~/.claude/projects/<project>/memory/. But they're scattered one-folder-per-project, they're awkward to read raw in a pager, and there's no good way to share the team-useful ones with colleagues. engram fixes all three.

It is not a replacement for committing a CLAUDE.md to a repo — it covers the gap that can't: cross-project memories, personal-vs-team layering, and a proper UI.

Install

Homebrew (macOS — installs the latest release):

brew install ertugrulhaskan/tap/engram

Go (requires Go 1.23+; Linux too):

go install github.com/ertugrulhaskan/engram@latest

Prebuilt binaries for macOS / Linux (amd64 + arm64) are attached to each release. Windows binaries are published as well but untested — engram targets macOS/Linux today; on Windows, use WSL.

From source:

git clone https://github.com/ertugrulhaskan/engram.git && cd engram
go mod tidy        # fetches dependencies (needs network, first time only)
go run .           # run it
go build -o engram # or build a binary

Usage

Just run it:

engram

The left pane lists every memory found across all your projects, grouped under colored headers; the right pane shows the selected memory rendered as markdown. The list reloads automatically when memory files change on disk.

Key Action
↑/↓ j/k move through the list
pgup/pgdn page through the list
/ filter / search the list
tab switch focus between list and preview
shift+tab cycle the source tabs: memories → plans → files
e edit the selected memory in $EDITOR
n create a new memory in the current project and open it in $EDITOR
d delete the selected item (asks y/n first)
space mark the memory for a batch promote (esc clears all marks)
a mark every memory in the list — with a type filter set, that is the whole type. Press again to clear those marks
t cycle the type filter
g toggle grouping: by project ⇄ by type
R reconcile the project's MEMORY.md index (shown when out of sync)
1–3 switch theme
P / p / r promote / pull / resolve — the status bar offers the one that fits the selected row's sync state. P promotes every marked memory as one commit when marks are set
@ pick an assistant to hand the selected project to (opens the palette's @ list)
ctrl+p / ctrl+k open the command palette (see below)
? help — a keybinding cheat-sheet overlay (any key closes)
q / ctrl+c quit

n, d, and e keep the project's MEMORY.md index in sync, so Claude Code picks up the changes. When an index drifts anyway, a banner above the list names the project and the cause — files with no index line, index lines whose file is gone, with counts — and R reconciles it after a confirm that names the actual files and what will be written. esc dismisses the banner for the session (per project); the status bar keeps offering R while the drift lasts.

The command palette (ctrl+p / ctrl+k)

One field, no prefix required: the palette opens to a sectioned list of everything — every memory and plan under Jump to, then Sources, Team, and Assistant — and typing filters all of it at once (fuzzy over titles and project names for jumps, name prefixes for commands). The first result is preselected; ↵ runs it.

The old prefixes survive as accelerators that scope the search — nothing needs them anymore:

  • / — sources. /memories (the default; /memory still works), /plans (grouped by recency), /files (see below), or /settings (opens engram's config file in your $EDITOR).

  • @ — assistants. @Claude, @Gemini, @Codex and @Copilot each hand off to an interactive session with that assistant's CLI, seeded with the selected project's memory/plan health, to fix what R can't (malformed frontmatter, broken [[links]], memories stranded by a renamed project folder) and to create, rewrite, or merge memories on request. engram reloads when the session exits and tells you which one ran.

    The list shows whichever CLIs you actually have on PATH — they're all optional, and engram runs fine with none of them, in which case it lists all four rather than nothing, and picking one tells you where to get it. Pressing @ on its own opens this list rather than picking for you.

  • > — team commands. >init, >promote, >pull, >resolve, >withdraw, >alias — covered in Team sharing below.

/files — read-only view of your instruction files

/files lists your global instruction files, each project's instruction files (when its directory resolves on disk), and each project's MEMORY.md index. A badge names each one:

File Badge Read by
CLAUDE.md rules Claude Code
AGENTS.md agents Codex, Cursor, Copilot — and Claude Code
GEMINI.md gemini Gemini CLI
.github/copilot-instructions.md copilot GitHub Copilot
.cursor/rules/*.mdc cursor Cursor
.github/instructions/*.instructions.md copilot GitHub Copilot (path-scoped)
MEMORY.md index Claude Code (engram keeps it in sync)

Three of these also have a global form that applies to every project, listed first under global: ~/.claude/CLAUDE.md, ~/.codex/AGENTS.md and ~/.gemini/GEMINI.md. These are read straight from your home folder, so they show up even if you've never opened a project in Claude Code. Copilot has no home-folder equivalent — VS Code keeps user-level instructions in its profile settings rather than a file — and engram reads Codex's default ~/.codex/AGENTS.md only, not a relocated CODEX_HOME or an AGENTS.override.md.

These are view-only — e/d point you at an assistant (@) instead of editing them directly, so the index and your instructions don't get hand-corrupted.

By default engram surfaces these for projects it already knows about — ones with a folder under ~/.claude/projects/. To include repos you've never opened in Claude Code, add scan roots to ~/.config/engram/config.json:

{ "scanRoots": ["~/Documents/workspace", "~/work"] }

Each root and its immediate children are checked, and a directory counts as a project only if it carries one of the instruction files above. Depth is 1 on purpose — engram re-checks this every couple of seconds to notice external edits, so a recursive walk over a big workspace would be wasteful. Dotted directories are skipped, and a project Claude already knows about is never listed twice. Scanned projects show instruction files only; they have no MEMORY.md.

Roots must be absolute (after ~); a relative one is ignored, since it would depend on where you launched engram. Symlinked directories aren't followed.

The path-scoped rule directories (.cursor/rules/, .github/instructions/) list every matching file inside them, folders included, and the preview shows each rule's scope from its frontmatter — applies to src/**/*.ts, or always applied — with the markdown body rendered below. Only the documented extensions count (.mdc, .instructions.md); Cursor itself ignores a plain .md in its rules folder, and so does engram. Nested .cursor/rules folders deeper in a repo, the legacy .cursorrules file, and Cursor/Copilot user-level rules (which live in app settings, not files) are not read.

Reading the list

  • Grouping. Rows sit under a colored ▌ Group (N) header with a count. For memories, g toggles between grouping by project and by type; plans group by recency (Today / This week / Older). The selected row is marked with a › cursor.

  • Type badge. Each memory shows a colored badge for its type, taken from Claude's metadata.type:

    Badge Color Meaning
    [user] blue a fact about you (role, preferences)
    [feedback] orange guidance on how to work
    [project] green something specific to that codebase
    [reference] purple a pointer to an external resource
    [other] gray no type recorded (the t filter calls this unknown)

    t cycles the type filter through exactly this order: all → user → feedback → project → reference → unknown.

  • Sync pill. Once you share, a team-scoped memory shows an outlined [state] pill (the word in its state color) against the team store. A sync anchor (a content digest recorded when you last promoted or pulled) lets engram name a direction:

    Pill State What to do
    [synced] in sync with the team store nothing
    [behind] the store advanced, your copy is untouched >pull (or >resolve)
    [ahead] you have unshared edits >promote
    [conflict] both sides moved >resolve
    [missing] promoted but not in the store >promote
    [unknown] shared before the anchor existed, so no direction >resolve

    Personal memories show no pill, and the column vanishes until you set up a team store.

  • Sync strip. The preview of a shared memory carries a band under its title: the state as a plain sentence, the offered action as a chip ([p pull]), and a direction gauge — you ▬▬▬ ← ▬▬▬ team, the side that moved filled in the state's color — with an honest timestamp (store advanced 2h ago comes from the store's git history and is omitted when git can't answer, never guessed).

  • Scope chip. A color-coded global (teal) / project (azure) chip sits beside the sync pill, showing whether a shared memory is team-wide or tied to one project — the choice you make when you promote.

Team sharing

Team sharing lives under the > command palette (ctrl+p, then type >), with direct keys for the frequent verbs: P promote, p pull, r resolve. The status bar advertises only the key that fits the selected row's sync state (a [behind] project row offers p pull; a personal row offers nothing), so a team key never appears where it has nothing to do. Normal use stays a no-arg TUI. The team store is a git repo your team reads and writes.

Setup
engram init-team <git-url>   # or >init <git-url> in the palette

This clones the team repo to ~/.config/engram/team/ and, if the repo is empty, scaffolds global/, projects/, and MEMORY.md, then commits and pushes the starter layout (a failed push is non-fatal — the local commit is kept, with a retry hint).

The commands

>promote, >resolve, and >withdraw act on the selected memory; >pull applies store-wide. Each surfaces a clear error if the team store isn't set up yet:

  • >promote — copies the memory into the store. A scope dialog picks this project (keyed by its git remote) or global. engram stamps the shared copy with an engram: frontmatter block (a durable id, scope, project, owner — leaving Claude's own keys untouched) and commits + pushes. Before pushing, engram scans the memory for secrets and by default blocks the promote on a hit, showing the redacted match with an option to override (tunable — see Configuration).
  • >pull — brings the team's memories down — after showing you the full accounting first: a confirm dialog lists what will fast-forward, what has local edits (left alone), and what diverged (flagged as a conflict, not overwritten), and nothing moves until you say y. A pull with nothing to write skips the dialog and says so. Project-scoped memories are placed into their matching local projects; a global memory you already hold is reconciled the same way, but one you hold nowhere is never placed — it lives in the store until you promote it into a project yourself.
  • >resolve — shows an inline diff of the two versions in a confirm (− yours, + the store's, unchanged runs collapsed to a count), then opens the full merge in your $EDITOR and writes your merge back, re-anchored so "take theirs" reads as synced. If only the sync anchor differs it says so instead. Cancelling touches nothing.
  • >withdraw — takes a shared memory back (after a confirm), if you're its owner: it removes the copy from the store, resets your memory to personal, and, via a tombstone, removes it from teammates on their next pull. >promote again puts it back.
  • >alias <name> — keys a project that has no git remote. Identity normally comes from the remote, so such a project could only promote globally; an alias (>alias acme-app, on any memory in that project) gives it a bucket of its own, projects/alias/acme-app/, that >promote offers and >pull fills. Lowercased, one path component, one project per alias; stored as projectAliases in the config; >alias - clears it. The remote always wins — the alias is consulted only when git reports there is no remote, or when the project's directory has gone (the alias was granted while it was there and had none); never when git merely fails, so a hiccup can't let a stale alias stand in for a real remote. On a project that has a remote the command tells you its real key instead, and your home folder's memories never take an alias at all — they always promote globally. A project that later gains a remote promotes under its remote key from then on; what you already shared under the alias stays in that bucket (pull reports it skipped) until you promote it again. Teammates must choose the same alias to meet.

Configuration

engram's config lives at ~/.config/engram/config.json (open it with /settings in the palette):

Key Values Default
theme theme key: "midnight" · "paperback" · "crt" — saved automatically when you press 1–3 (names from older versions still resolve) midnight
editor editor command override, e.g. "code --wait" — when unset, $VISUAL / $EDITOR apply —
secretScanAction block · block-strict (no override) · warn · off block
secretScanScope secrets · secrets+pii secrets
scanRoots extra directories to look for projects in — see /files —
projectAliases memory dir → alias, for projects with no git remote — set with >alias <name>, see Team sharing —

The secret scan matches known key formats, secret-ish variable names, and values that simply look generated — a guard, not a guarantee, so treat the override as a real decision.

A config.json that isn't valid JSON stops startup, naming the file and the fault (an empty file counts as absent), rather than being silently replaced by defaults: once the file carries projectAliases, defaults are a placement decision made off a file engram couldn't read. Every write refuses the same file for the same reason, and engram's own writes are atomic, so it can't produce one.

CLI

engram is a no-arg TUI; the few subcommands are:

engram                       # launch the TUI
engram init-team <git-url>   # set up the team store (same as >init)
engram version               # print the version (also --version / -v)
engram help                  # print usage (also --help / -h)

How it works

engram reads memory files from ~/.claude/projects/*/memory/*.md. It supports two on-disk shapes, because Claude Code uses both:

  1. YAML frontmatter — name, description, metadata.type
  2. Plain markdown — a # Heading title, with the one-line description pulled from the project's MEMORY.md index (- [Title](file.md) — hook)

Files are never modified except when you explicitly edit one. See SPEC.md for the full data model and the sharing design.

Roadmap (short version)

  • Phase 1 — browse / search / view / edit local memories (done — v0.1.0)
  • Phase 1.5 — assisted maintenance: @ handoff to Claude Code / Gemini / Codex / Copilot, read-only /files (core in v0.1.0)
  • Phase 2 — team sharing over git: init-team, promote / pull / withdraw / resolve, sync badges + secret-scan (shipped — v0.2.0)
  • Phase 3 — release / go public: binaries + Homebrew tap, engram.im (shipped — live)
  • Phase 4 — other assistants: local instruction files first (AGENTS.md, GEMINI.md, Copilot's instructions and Cursor rules are all browsable — per project and, where a vendor has one, globally), then server-side memories (Claude.ai, ChatGPT, …) as access allows

Contributing

Contributions welcome! The codebase is small and deliberately layered: everything outside internal/tui does the real work with no UI (memory, plan, config, team, secrets, source), and internal/tui is Bubble Tea UI with no file logic. See CONTRIBUTING.md for build and test instructions — including the "Landing page" section for working on the engram.im site under www/ — and SPEC.md for the design. By participating you agree to the Code of Conduct.

License

MIT — free to use, modify, and share. Provided "as is," with no warranty; the author isn't liable for any loss or damage from using it. engram edits files under ~/.claude/ and syncs them over git, so keep backups of anything you can't afford to lose.

Documentation

Overview

Command engram is a terminal UI for browsing your Claude Code memories.

Directories

Path Synopsis
internal
config
Package config persists engram's user settings (theme, editor) as JSON under the XDG config directory.
Package config persists engram's user settings (theme, editor) as JSON under the XDG config directory.
memory
Package memory discovers and parses Claude Code memory files.
Package memory discovers and parses Claude Code memory files.
plan
Package plan discovers Claude Code plan files — the markdown documents written in plan mode under ~/.claude/plans/.
Package plan discovers Claude Code plan files — the markdown documents written in plan mode under ~/.claude/plans/.
secrets
Package secrets scans memory content for credentials before it is shared to a team git store.
Package secrets scans memory content for credentials before it is shared to a team git store.
source
Package source holds the per-source capability model: what the user may be offered to do to the files a browsable source shows.
Package source holds the per-source capability model: what the user may be offered to do to the files a browsable source shows.
team
Package team manages engram's shared team store: a git repository, cloned into the user's config directory, that holds memories shared across a team.
Package team manages engram's shared team store: a git repository, cloned into the user's config directory, that holds memories shared across a team.
tui
Package tui implements engram's Bubble Tea terminal UI.
Package tui implements engram's Bubble Tea terminal UI.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL