Documentation
Browse documentation

Using memory

Startup memory and folder context files

At the start of a session, MemIndex gives your agent a short panel about earlier work in the project. Folder context files do the same job inside a folder. This page covers what the panel holds and how to shape it.

What the panel holds

From your second session in a project, your agent receives a block of text built from your notes. This is a real one, from a test project on the feat/payment branch with one pinned note:

# [memindex] recent context · feat/payment · shop · 2026-11-15 10:22pm EST
Mode: Code Development (code)

Legend: 🎯session ●bugfix ◆feature ↻refactor ✓change ○discovery ⚖decision ⚠security_alert ⚷security_note ⊘sensitive
Format: ID TIME TYPE TITLE
Fetch details: get_observations([IDs]) | Search: mem-search skill

tagged: 4 on branch · 4 on project · source: startup

📌 Pinned on this branch
#1 ○ Charge in the smallest currency unit
   ↳ why: "Rounding bugs in v1"

Above it, MemIndex lists any open work your agent tracked. Below it comes the timeline of recent notes, grouped by day, and the last session summary. The whole block is capped at 10,000 characters, because Claude Code replaces anything longer with a short preview. MemIndex trims the block until it fits.

In Claude Code, a resumed conversation gets nothing new, because it already holds its earlier context. Projects you excluded get nothing.

Choose how much arrives

More context uses more of your agent's input. These settings in ~/.memindex/settings.json shape the panel:

Setting Default What it does
MEMINDEX_CONTEXT_OBSERVATIONS 50 How many recent notes to offer.
MEMINDEX_CONTEXT_SESSION_COUNT 10 How many recent sessions to consider.
MEMINDEX_CONTEXT_FULL_COUNT 0 How many notes to show in full instead of as one-line rows.
MEMINDEX_CONTEXT_PROJECTS current all adds notes from your other projects after this project's.
MEMINDEX_CONTEXT_SHOW_LAST_SUMMARY true Includes the last session summary.
MEMINDEX_BRANCH_MEMORY_ENABLED true Ranks the current branch first and shows pins.

After a change, restart the service (npx memindex restart) and start a fresh session. The full list is in Settings.

Folder context files

Folder context files are off by default. Turn them on with MEMINDEX_FOLDER_CLAUDEMD_ENABLED set to "true". MemIndex then writes a short table of recent activity into CLAUDE.md in the folders where your agent read or changed files, so the agent sees it when it works there.

  • The table sits between <memindex-context> tags. MemIndex replaces only that block, and anything you wrote outside it stays.
  • MEMINDEX_FOLDER_USE_LOCAL_MD set to "true" writes CLAUDE.local.md instead.
  • MEMINDEX_FOLDER_MD_EXCLUDE is a JSON list of folder paths to skip, along with everything below them.
  • MemIndex never writes into a project's root folder, or into folders such as node_modules, build or .git.

Next steps