What's missing
The pi adapter ships with just AGENTS.md and a .pi/skills/ symlink. There's no hook that automatically logs tool calls to AGENT_LEARNINGS.jsonl. The only way the episodic log gets populated is if the agent explicitly calls memory_reflect.py after significant actions — which in practice it skips constantly. So the log stays empty, the dream cycle gets no signal, and the compounding loop described in the README never actually starts.
The README harness table lists pi as "no (extension system)" for hook support. That's the misleading part — pi absolutely has an extension system. The tool_result event fires after every tool execution and is the direct equivalent of Claude Code's PostToolUse. The gap isn't architectural, it's just a missing file.
Why this matters
Claude Code gets claude_code_post_tool.py wired via settings.json PostToolUse. Pi gets nothing. Same brain, completely different behaviour depending on which harness you're in. Pi users who follow the README and expect the memory system to compound over time get quietly nothing.
The fix
Add .pi/extensions/memory-hook.ts to the pi adapter. Pi auto-discovers extensions from .pi/extensions/ at startup — no config needed. The extension subscribes to tool_result and writes to AGENT_LEARNINGS.jsonl using the same importance scoring and reflection format as claude_code_post_tool.py.
Relevant pi API:
pi.on("tool_result", async (event, ctx) => {
const { toolName, input, isError } = event;
// toolName: "bash" | "edit" | "write" | "read" etc.
// isError: boolean
// write to AGENT_LEARNINGS.jsonl here
});
Extensions in .pi/extensions/*.ts are auto-discovered at startup, no settings.json or CLI flags needed. Pi extension docs: https://github.com/badlogic/pi-mono
Also worth updating the README harness table from no (extension system) to yes (tool_result event) so future users aren't misled.
Happy to submit a PR if helpful — already have a working implementation.
What's missing
The pi adapter ships with just
AGENTS.mdand a.pi/skills/symlink. There's no hook that automatically logs tool calls toAGENT_LEARNINGS.jsonl. The only way the episodic log gets populated is if the agent explicitly callsmemory_reflect.pyafter significant actions — which in practice it skips constantly. So the log stays empty, the dream cycle gets no signal, and the compounding loop described in the README never actually starts.The README harness table lists pi as "no (extension system)" for hook support. That's the misleading part — pi absolutely has an extension system. The
tool_resultevent fires after every tool execution and is the direct equivalent of Claude Code'sPostToolUse. The gap isn't architectural, it's just a missing file.Why this matters
Claude Code gets
claude_code_post_tool.pywired viasettings.jsonPostToolUse. Pi gets nothing. Same brain, completely different behaviour depending on which harness you're in. Pi users who follow the README and expect the memory system to compound over time get quietly nothing.The fix
Add
.pi/extensions/memory-hook.tsto the pi adapter. Pi auto-discovers extensions from.pi/extensions/at startup — no config needed. The extension subscribes totool_resultand writes toAGENT_LEARNINGS.jsonlusing the same importance scoring and reflection format asclaude_code_post_tool.py.Relevant pi API:
Extensions in
.pi/extensions/*.tsare auto-discovered at startup, no settings.json or CLI flags needed. Pi extension docs: https://github.com/badlogic/pi-monoAlso worth updating the README harness table from
no (extension system)toyes (tool_result event)so future users aren't misled.Happy to submit a PR if helpful — already have a working implementation.