# Self-compacting extension for the pi coding agent

> Builds an extension enabling autonomous coding agents to manage context window limits and compact themselves using custom prompts.

Page: https://videotomd.com/b/3b0U4_02bAE/
Tool: Pi agent · Tags: pi-coding-agent, context, compaction, deepseek, just · 327 words, about 425 tokens
Pills: free · Node · just · API key · checked 2026-10-15 · Claude Code · Codex · Any AI · frontier

## Recipe

- Kind: not set
- Stage: not set
- Loads: not set
- Works in: Claude Code, Codex, Any AI
- Needs: not set
- Bring: Node, just, API key
- Cost: free
- Model: frontier
- Tested in: not yet
- Checked: 2026-10-15
- For: not set

## Put it here



- Claude Code: Save as CLAUDE.md in the project root, or .claude/CLAUDE.md. Other agents share the repo: put the shared rules in AGENTS.md and make CLAUDE.md one line, @AGENTS.md. Commit it. Start a new session: the file is read at launch. Reload: new session (or /memory to open the files). Check it loaded: /context lists the Memory files it read; /skills, /agents, /hooks list the rest; the InstructionsLoaded hook event fires once per loaded instruction file. Source: https://code.claude.com/docs/en/memory (checked 2026-10-12).
- Codex: Save as AGENTS.md in the repo root. Codex concatenates AGENTS.md from the git root down to the working directory, closer wins. Commit it. Start a new session. Reload: new session. Check it loaded: ask: Summarize the current instructions; `codex status`. Source: https://learn.chatgpt.com/docs/agent-configuration/agents-md (checked 2026-10-12).
- Any AI: Coding agent: save as AGENTS.md in the project root (read natively by Codex, Cursor, Copilot, Gemini CLI, Kiro, Devin, Cline, Roo, OpenHands, OpenCode, Goose, Amp, Zed, Warp, Junie, Factory and Jules; Claude Code when no CLAUDE.md exists; Aider with --read). Chat: paste it first. Reload: new session. Check it loaded: ask it to repeat one rule from the file. Source: https://agents.md/ (checked 2026-10-12).

## Access

Membership: plans at https://videotomd.com/pricing/, or email then a plan at https://videotomd.com/b/3b0U4_02bAE/. A member's browser downloads the file there; an AI without that session needs the member to attach it.
