Agent skill

Pi Memory

by espennilsen in espennilsen/pi

Manage persistent memory across sessions. An agent skill from espennilsen/pi.

MITAuto-check passedAgent Workflows

Install Pi Memory

skills CLI
$ npx skills add espennilsen/pi --skill pi-memory -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install espennilsen/pi pi-memory --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/espennilsen/pi.git skills-src && mkdir -p .claude/skills && cp -r skills-src/extensions/pi-memory/skills/pi-memory .claude/skills/pi-memory && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
pi-memory
GitHub stars
122
Token cost
~985 tokens
SKILL.md length
347 words
Files
1
Skills in repo
36
Repo updated
First seen
Licence
MIT

At a glance

Manage persistent memory across sessions. An agent skill from espennilsen/pi.

  • Works in 4 steps: Deduplicate — Check for repeated… → Archive stale info — Remove outdated… → Consolidate daily logs — Important… → …
  • Asked to remember
  • SKILL.md covers Architecture, Tools, When to Write Memory and Memory Hygiene, plus 1 more section
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Pi Memory is an agent skill from espennilsen/pi. Manage persistent memory across sessions. Use when asked to remember, recall, forget, or review what was stored. Covers long-term facts (MEMORY.md), daily session logs, search, and memory housekeeping.

Its SKILL.md is about 990 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Agent Workflows, covering Agent memory. The licence is MIT.

When your agent uses it

  • Asked to remember
  • Review what was stored

Example prompts

  • “/pi-memory”

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. Deduplicate — Check for repeated sections in MEMORY.md (use memory_read target=long_term)
  2. Archive stale info — Remove outdated decisions or completed project references
  3. Consolidate daily logs — Important patterns from daily logs should be promoted to MEMORY.md
  4. Keep sections focused — Each ## Section should have a clear purpose

What it can do on your machine

Read from SKILL.md and the folder at commit 79d019b. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are json and markdown).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Pi Memory loads about 985 tokens when it runs. Until then it costs about 53 tokens; SKILL.md has 347 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~53
When it runs · the whole SKILL.md, loaded when a task matches
~985

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from espennilsen/pi at commit 79d019b, republished under its MIT licence (© espennilsen). 347 words, ~985 tokens.

Download SKILL.mdSave it as .claude/skills/pi-memory/SKILL.md (or your agent's skills folder).
name
pi-memory
description
Manage persistent memory across sessions. Use when asked to remember, recall, forget, or review what was stored. Covers long-term facts (MEMORY.md), daily session logs, search, and memory housekeeping.

pi-memory — Persistent Memory

A file-based memory system that persists knowledge across sessions using plain Markdown.

Architecture

<base-path>/
├── MEMORY.md              # Long-term curated memory (facts, preferences, decisions)
└── memory/
    ├── 2026-02-11.md      # Daily log — append-only session notes
    ├── 2026-02-10.md
    └── ...
  • MEMORY.md — The "brain". Organized into ## Sections. Survives compaction. Editable in place.
  • memory/YYYY-MM-DD.md — Daily append-only logs. Timestamped entries. One file per day.

The base path defaults to cwd. Override with settings.json:

json
{ "pi-memory": { "path": "/path/to/memory/dir" } }

Tools

memory_read

Read memory contents.

targetdescription
long_termRead full MEMORY.md
dailyRead a specific date's log (default: today). Pass date: "YYYY-MM-DD" for other dates.
listList all available daily log files
memory_write

Write to memory.

targetdescription
dailyAppend a timestamped entry to today's log. Used for session notes, progress, decisions.
long_termUpdate MEMORY.md. Pass section to replace a specific ## Section, or omit to append.

Long-term memory sections — use section parameter to target:

memory_write target=long_term section="Preferences" content="- Prefers dark theme\n- Terminal-first tools"

This replaces the content under ## Preferences. If the section doesn't exist, it's created.

Daily log entries — auto-timestamped:

memory_write target=daily content="Completed the auth refactor. Using JWT with RS256."

Creates ### HH:MM entry in today's file.

Full-text search across MEMORY.md and all daily logs.

memory_search query="JWT" limit=10

Returns matching lines with ±1 line of context, grouped by file.

When to Write Memory

Always write to long-term memory when:
  • User explicitly says "remember this", "save this", "note that..."
  • You learn a new preference, convention, or decision
  • A significant architectural or design choice is made
  • You discover something about the user's workflow or environment
Always write to daily log when:
  • Starting or completing significant work
  • Making key decisions during a task
  • Encountering and resolving blockers
  • At the end of a work session (summarize what was done + next steps)
Section organization for MEMORY.md

Keep MEMORY.md well-organized with clear sections:

markdown
# Long-Term Memory

## About [User]
- Key facts, role, location, interests

## Preferences
- Communication style, tool preferences, conventions

## Active Focus
- Current projects and priorities (update as they shift)

## Decisions & Conventions
- Coding conventions, workflow rules, architectural decisions

## People & Relationships
- Key contacts and collaborators

## Recurring Patterns
- Things frequently asked about or worked on

Memory Hygiene

Periodically review and clean up memory:

  1. Deduplicate — Check for repeated sections in MEMORY.md (use memory_read target=long_term)
  2. Archive stale info — Remove outdated decisions or completed project references
  3. Consolidate daily logs — Important patterns from daily logs should be promoted to MEMORY.md
  4. Keep sections focused — Each ## Section should have a clear purpose

System Prompt Injection

At each agent turn, the extension automatically injects into the system prompt:

  • Full MEMORY.md content
  • Yesterday's daily log (if exists)
  • Today's daily log (if exists)

This means the agent always has recent context without needing to call memory_read.

© espennilsen, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in extensions/pi-memory/skills/pi-memory of espennilsen/pi.

Open the folder on GitHubat commit 79d019b

Compare with similar skills

Pi Memory next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Pi Memory compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Pi Memory this skillespennilsen/pi122—~985Automated safety check: PassMIT
Coding Agent Session Findercode-yeongyu/oh-my-openagent70k1 repos~2.8kAutomated safety check: PassCustom licence
Claude-Mem Cloud Syncthedotmack/claude-mem98k1 repos~1kAutomated safety check: NotesApache-2.0
Cognee CLI Memory Commandstopoteretes/cognee32k1 repos~2.2kAutomated safety check: NotesApache-2.0
Neat-Freak Knowledge CloseoutKKKKhazix/khazix-skills21k—~1.9kAutomated safety check: PassMIT
Claude-Mem Searchthedotmack/claude-mem98k1 repos~511Automated safety check: PassApache-2.0

Similar skills

  • Coding Agent Session Finder

    code-yeongyu/oh-my-openagent

    Finds, reads and reconstructs past coding-agent sessions across Codex, Claude, OpenCode, Senpi and many other local agent logs.

    70k GitHub starsUsed in 1 repo~2.8k tokens
    Agent WorkflowsAuto-check passed
  • Claude-Mem Cloud Sync

    thedotmack/claude-mem

    Checks claude-mem cloud sync status and guides you through connecting a cmem.ai Pro account without the sync token ever passing through the chat.

    98k GitHub starsUsed in 1 repo~1k tokens
    Agent WorkflowsAuto-check: notes
  • Cognee CLI Memory Commands

    topoteretes/cognee

    Drives cognee from the terminal with remember, recall, forget and improve memory commands, dataset and config management and database migrations.

    32k GitHub starsUsed in 1 repo~2.2k tokens
    Agent WorkflowsAuto-check: notes
  • Neat-Freak Knowledge Closeout

    KKKKhazix/khazix-skills

    Brings project docs, agent rule files, authorized memory and leftover workspace files back in line with what the code and runtime actually do at the end of a work session.

    21k GitHub stars~1.9k tokensUpdated 6 days ago
    Agent WorkflowsAuto-check passed
  • Claude-Mem Search

    thedotmack/claude-mem

    Searches the user's persistent cross-session memory for timestamped observations synthesized from past agent sessions on cmem.ai.

    98k GitHub starsUsed in 1 repo~511 tokens
    Agent WorkflowsAuto-check passed
  • Beads Task Memory

    gastownhall/beads

    Tracks multi-session work with dependencies in the bd issue tracker so the agent can find ready tasks and recover its context after conversation compaction.

    28k GitHub stars~1.2k tokensUpdated today
    Agent WorkflowsAuto-check passed

More from espennilsen/pi

All 36 skills in this repo
  • GitHub

    espennilsen/pi

    Interact with GitHub repos, PRs, issues, CI, and notifications via the pi-github extension commands and gh CLI.

    122 GitHub stars~1k tokensUpdated 16 days ago
    Auto-check passed
  • Skill Creator

    espennilsen/pi

    Create, review, and improve skills for Pi agents. An agent skill from espennilsen/pi.

    122 GitHub stars~2.1k tokensUpdated 16 days ago
    Auto-check passed
  • Dry Code Review

    espennilsen/pi

    Perform a comprehensive DRY (Don't Repeat Yourself) code review on a codebase.

    122 GitHub stars~1.7k tokensUpdated 16 days ago
    Auto-check passed
  • Extract Design System

    espennilsen/pi

    Reverse-engineer a design system from a live website (public URL or localhost).

    122 GitHub stars~2k tokensUpdated 16 days ago
    Auto-check passed
  • Herdr Operations

    espennilsen/pi

    A skill your agent uses when inspecting or operating Herdr sessions, workspaces, tabs, panes, agents, terminal output, agent messaging, or waits.

    122 GitHub starsUsed in 1 repo~525 tokens
    Auto-check passed
  • PDF Reader

    espennilsen/pi

    Read and extract content from PDF files — text, tables, metadata, and images.

    122 GitHub stars~1.6k tokensUpdated 16 days ago
    Auto-check passed

Categories

Questions about Pi Memory

What does Pi Memory do?

Manage persistent memory across sessions. An agent skill from espennilsen/pi. Pi Memory is an agent skill from espennilsen/pi. Manage persistent memory across sessions.

When should I use Pi Memory?

Pi Memory fits situations like: asked to remember; review what was stored.

How do I install Pi Memory in Claude Code?

Run `npx skills add espennilsen/pi --skill pi-memory -a claude-code`. Or copy the skill folder (extensions/pi-memory/skills/pi-memory in espennilsen/pi) into .claude/skills/pi-memory in your project. Claude Code loads it when a task matches its description.

How do I install Pi Memory in Codex?

Run `npx skills add espennilsen/pi --skill pi-memory -a codex`. Or copy the skill folder (extensions/pi-memory/skills/pi-memory in espennilsen/pi) into .agents/skills/pi-memory in your project. Codex loads it when a task matches its description.

Can I use Pi Memory in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add espennilsen/pi --skill pi-memory -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/pi-memory, .gemini/skills/pi-memory, .github/skills/pi-memory and .opencode/skills/pi-memory in your project.

What does Pi Memory need to run?

SKILL.md names no scripts, command-line tools or credentials: Pi Memory is instructions for the agent only.

Does Pi Memory access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Pi Memory safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Pi Memory use?

Pi Memory is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Pi Memory use?

About 985 tokens (SKILL.md is roughly 3.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Pi Memory?

Skills that share tags, products or a category with Pi Memory: Coding Agent Session Finder (code-yeongyu/oh-my-openagent, 70k stars), Claude-Mem Cloud Sync (thedotmack/claude-mem, 98k stars), Cognee CLI Memory Commands (topoteretes/cognee, 32k stars) and Neat-Freak Knowledge Closeout (KKKKhazix/khazix-skills, 21k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Pi Memory?

espennilsen (a GitHub user) maintains it in espennilsen/pi, which has 122 GitHub stars. The repository holds 36 skills in this directory. The repository was last updated on September 21, 2026.

Source: espennilsen/pi on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.