memory-mine

memory-mine is a skill for Claude Code, Codex from dimetron/pi-go. It costs 35 tokens per session (614 once invoked), scanned A, original, MIT.

A procedure for indexing project files or conversation history into MemPalace, a searchable memory store. It divides content into pieces, assigns them to categories, creates embeddings, and removes duplicates.

In plain words
What is it for?
Use it to initialize or refresh project memory, mine source directories, or import JSONL and text conversations with the memory command.
Why use it?
It lets later searches find relevant project knowledge or past discussions without reading every file or conversation again.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/dimetron/pi-go/memory-mine
Any agent
npx skills add dimetron/pi-go --skill memory-mine
Clone the repo
git clone --depth 1 https://github.com/dimetron/pi-go

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for memory-mine

README.md
[![agentmods](https://agentmods.dev/badge/skills/dimetron/pi-go/memory-mine.svg)](https://agentmods.dev/skills/dimetron/pi-go/memory-mine)
Your own site
<a href="https://agentmods.dev/skills/dimetron/pi-go/memory-mine"><img src="https://agentmods.dev/badge/skills/dimetron/pi-go/memory-mine.svg" alt="Measured on agentmods" height="20"></a>
Per session 35 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 614 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00035 $0.00614
Opus 5 $0.00017 $0.00307
Sonnet 5 $0.00007 $0.00123
Haiku 4.5 $0.00003 $0.00061

Measured 5d ago against content hash d31e6d89e525, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

memory-mine scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.pi-go/skills/memory-mine/SKILL.md · 75 lines

What it actually says

When to use

Use this skill when the user wants to:

  • Index/mine project source files into the palace memory
  • Mine conversation history (JSONL, text) into the palace
  • Rebuild or refresh the palace knowledge base from disk
  • Bootstrap memory for a new project

What it does

Runs pi memory mine to walk a directory and ingest files as palace drawers:

  1. Source mining (default): Walks the directory tree, chunks source files (1500 chars, 200 overlap), assigns rooms via mempalace.yaml patterns or directory structure, generates embeddings, deduplicates (cosine >= 0.9), and stores as drawers.

  2. Conversation mining (--convos): Parses JSONL (pi-go or Claude Code format) and plaintext conversations, pairs user+assistant turns, and stores as drawers with importance=4.

Steps

  1. Check if palace.db exists (run pi memory init . if not)
  2. Check if the embedding model is downloaded (run pi memory model download if not)
  3. Run the mine command:
# Mine source files from current directory
pi memory mine .

# Mine source files with explicit wing name
pi memory mine . --wing my-project

# Mine conversation files
pi memory mine ./conversations --convos
  1. Show the results (processed, added, skipped duplicates, errors)
  2. Optionally run pi memory status to confirm the updated state

Arguments

The user can pass arguments after /memory-mine:

  • A directory path (default: . current directory)
  • --wing <name> to override the wing name
  • --convos to mine conversations instead of source files

Examples:

  • /memory-mine — mine current directory
  • /memory-mine ./src — mine the src directory
  • /memory-mine ./chats --convos — mine conversation files

Prerequisites

  • pi binary must be built and available (go build -o pi ./cmd/pi)
  • Palace DB must be initialized (pi memory init .)
  • For semantic search, embedding model must be downloaded (pi memory model download)

Notes

  • Respects .gitignore patterns
  • Skips hidden dirs, node_modules, vendor, .git, build, target
  • Skips files > 512 KB
  • Uses mempalace.yaml for room assignment if present
  • Duplicates (cosine similarity >= 0.9) are automatically skipped
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 75 lines · 35 tokens per session scan A d31e6d89e525

Subscribe to this mod's changes

memory-mine is a skill published in the GitHub repository dimetron/pi-go (151 stars, last pushed today), licensed MIT. It adds 35 tokens to every session and 614 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.