pi-packages/pi-context-repo/skills/initializing-memory/SKILL.md
Comprehensive guide for initializing or reorganizing agent memory into a deeply hierarchical file structure. Use when running /init, when user asks to set up memory, or when memory needs a major reorganization. Trigger phrases: "initialize memory", "set up memory", "populate memory", "build my memory", "memory init".
npx skillsauth add edmundmiller/dotfiles initializing-memoryInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Initialize persistent memory into a deeply hierarchical structure of 15-25
small, focused files in .pi/memory/.
Run /init again after major project changes or when you want to re-analyze.
| Metric | Target |
| ------------------- | ---------------------------------------- |
| Total files | 15-25 (aim for ~20) |
| Max lines per file | ~40 (split if larger) |
| Hierarchy depth | 2-3 levels using / naming |
| Nesting requirement | Every file MUST be nested under a parent |
Anti-patterns:
system/
├── human/
│ ├── identity.md
│ ├── context.md
│ └── prefs/
│ ├── communication.md
│ ├── coding_style.md
│ └── workflow.md
├── project/
│ ├── overview.md
│ ├── architecture.md
│ ├── conventions.md
│ ├── gotchas.md
│ └── tooling/
│ ├── testing.md
│ └── linting.md
└── persona/
├── role.md
└── behavior.md
reference/
├── README.md
└── history/
└── decisions.md
Use memory_backup tool first if memory already has content.
Don't ask things you can find by reading files. Be autonomous during execution.
Standard research:
git log --oneline -20 — recent historygit log --format="%s" -50 | head -20 — commit conventionsDeep research (if chosen):
git shortlog -sn --all | head -10 — contributorsgit branch -a — branching strategygit log --format="%an <%ae>" | sort -u — deduplicate contributors by emailThink like a new team member: What would you want to know on your first day?
If the user approved session history analysis:
Claude Code sessions (~/.claude/projects/):
Pi sessions (~/.pi/agent/sessions/):
Codex sessions (~/.codex/):
history.jsonl contains session historyFocus on extracting:
system/human/system/persona/system/project/system/human/prefs/Use memory_write for each file. Every file needs:
/ naming (e.g. system/project/tooling/testing.md)Write findings as you go — don't wait until the end.
Memory scope guide:
find .pi/memory/system -name '*.md' | wc -l
If count < 15, split more aggressively.
Before finishing, verify:
/ naming (2-3 levels deep)Ask the user: "I've completed initialization with N files. Want me to refine anything?"
memory_commit({ message: "init: populate memory with N files from project research" })
If a remote is configured, push: git -C .pi/memory push
Descriptions are critical — write as if explaining to a future self with zero context:
Content should be:
development
Read-only Linear issue access via the Linear GraphQL API.
data-ai
## <!-- Purpose: Teach agents fast day-to-day memory browse/search/read/sync workflows in pi-context-repo. --> name: searching-memory description: > Search, browse, and inspect memory quickly in pi-context-repo. Use when asked to find prior notes, inspect memory files, locate preferences, or sync recent memory updates. Trigger phrases: "search memory", "list memory files", "find in memory", "read memory file", "memory status", "sync memory". --- # Searching Memory Use this workflow for fast
data-ai
Decomposes and reorganizes agent memory files into focused, single-purpose components. Use when memory has large multi-topic blocks, redundancy, or poor organization. Trigger phrases: "defrag memory", "reorganize memory", "clean up memory files", "split memory blocks".
development
Jujutsu version control through jut, a human and agentic framework around jj. Use for: check status, view changes, commit work, create branches, push, pull, create PRs, squash commits, reword messages, absorb changes, undo operations, view history. Complements jj — use jut for opinionated workflows, drop into raw jj for everything else.