Claude Code config

Pi Mem

Plain-Markdown persistent memory for AI coding agents. Long-term facts, daily logs, scratchpad, and semantic search — works with pi, Claude Code, and any LLM agent.

79 stars 12 forksConfig & memory Source

Install

From source
git clone https://github.com/jo-inc/pi-mem.git

From the README

pi-mem
surprisingly useful daily memory for the pi coding agent
Read the blog post

Inspired by OpenClaw's approach to agent memory.

Layout

Memory files live under ~/.pi/agent/memory/ (override with PI_MEMORY_DIR):

Identity and behavioral files (e.g. SOUL.md, AGENTS.md, HEARTBEAT.md) can also live in the memory directory and be injected into context via PI_CONTEXT_FILES.

Tools

Context Injection

The default system mode keeps MEMORY.md in a cached system-prompt section, condensed to about 3K tokens (a longer file is hard-cut at a line boundary with an ellipsis and a pointer to memory_read(target='long_term')), followed by the recall directive. Per turn it adds one trailing message, only when there is something to say: a retrieval block from other memory files, similar past conversations, and stored facts (capped near 3K tokens; whole items dropped, never fragments, with a memory_search pointer when anything was cut), plus today's and yesterday's daily logs with the latest entries kept (2,000-char cap, memory_read(target='daily') pointer). The long prompt prefix stays cacheable; only the small trailing message varies.

Other modes:

- bootstrap — a per-turn recall block including MEMORY.md itself, injected as a user message every turn (no cached section)
- full — inject context files, MEMORY.md, today's and yesterday's logs, and catchup indexes every turn
- off — inject nothing

SCRATCHPAD.md, files in notes/, and older daily logs are always available on demand through the memory tools.

Session Ancestry (opt-in)

Pi records session lineage but offers no easy way to read it: a forked or cloned session stores a parentSession path in its JSONL header, and entries within one session link via parentId. An agent only gets PI_SESSION_FILE at runtime, so it has no simple…
Read the full README on GitHub

Details

Repository
jo-inc/pi-mem
Language
TypeScript
License
MIT
Last updated
2 November 2026
Topics
agent-memoryai-agentcoding-agentcontext-managementllmmarkdownmemorypi-coding-agenttypescript

FAQ

What is Pi Mem?

Plain-Markdown persistent memory for AI coding agents. Long-term facts, daily logs, scratchpad, and semantic search — works with pi, Claude Code, and any LLM agent. It is a config for Claude Code, from jo-inc/pi-mem on GitHub.

How do I install Pi Mem?

Clone jo-inc/pi-mem from GitHub and follow the setup steps in its README.

Is Pi Mem popular?

jo-inc/pi-mem has 79 GitHub stars and 12 forks. It was last updated on 2 November 2026.

More config & memory

Browse the most popular Claude Code mods, all config & memory, or the skills and MCP server directories.