m3m0s-pi

Long-term memory from m3m0s for the pi coding agent (recall and capture).

Packages

Package details

extension

Install m3m0s-pi from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:m3m0s-pi
Package
m3m0s-pi
Version
0.2.0
Published
Oct 23, 2026
Downloads
490/mo · 235/wk
Author
rafaelvieiras
License
MIT
Types
extension
Size
5.4 KB
Dependencies
0 dependencies · 0 peers
Pi manifest JSON
{
  "extensions": [
    "./m3m0s-memory.ts"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

pi integration

A pi extension that gives pi the same memory loop as the Claude Code hooks, by reusing the m3m0s binary:

  • Recall (before_agent_start): runs m3m0s hook claude-code --inject with the prompt and injects the relevant memories as a hidden custom message (D44).
  • Capture (agent_end as Stop, session_shutdown as SessionEnd): runs m3m0s hook claude-code against pi's session file. The transcript parser accepts pi's message lines; memories are stored with source: "pi" (D46).

Install

From npm (needs the m3m0s binary on PATH or at ~/go/bin/m3m0s, plus ~/.m3m0s/hook.env):

pi install npm:m3m0s-pi

Manual install:

  1. go install (or copy) m3m0s to ~/go/bin/m3m0s, and create ~/.m3m0s/hook.env with M3M0S_URL and M3M0S_API_KEY.
  2. Copy m3m0s-memory.ts to ~/.pi/agent/extensions/. Adjust BIN at the top if the binary lives elsewhere.
  3. Optional: register the MCP server read-only in ~/.pi/agent/mcp.json: {"m3m0s": {"command": "sh", "args": ["-c", "set -a; . \"$HOME/.m3m0s/hook.env\"; exec \"$HOME/go/bin/m3m0s\" mcp --read-only"]}}

Failures are silent and never block pi; the log is ~/.m3m0s/hooks/claude-code.log.