memory-index

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

A procedure for indexing a folder’s source code into MemPalace, a searchable memory store that can find code by meaning or by matching words.

In plain words
What is it for?
Use it to make a code directory searchable, configure file groups, and prepare project material for later memory searches.
Why use it?
It makes a project’s contents easier to retrieve later without manually searching every file. Meaning-based search needs the listed embedding model; keyword search can work without it.

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-index
Any agent
npx skills add dimetron/pi-go --skill memory-index
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-index

README.md
[![agentmods](https://agentmods.dev/badge/skills/dimetron/pi-go/memory-index.svg)](https://agentmods.dev/skills/dimetron/pi-go/memory-index)
Your own site
<a href="https://agentmods.dev/skills/dimetron/pi-go/memory-index"><img src="https://agentmods.dev/badge/skills/dimetron/pi-go/memory-index.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,490 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.00000 $0.01490
Opus 5 $0.00000 $0.00745
Sonnet 5 $0.00000 $0.00298
Haiku 4.5 $0.00000 $0.00149

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

Security

Grade A, and why

memory-index 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.

internal/extension/bundled_skills/memory-index/SKILL.md · 181 lines

How it starts

The opening of the file, as written. The whole thing — 181 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Index a Folder into MemPalace

This skill walks through indexing a folder's source code into pi-go's MemPalace — the 4-layer semantic memory system with SQLite storage and embedding-based search.

Once indexed, the agent can search the folder's contents by meaning, not just keywords, using the palace-search tool or pi memory search CLI.

Prerequisites

The embedding model (all-MiniLM-L6-v2) must be downloaded. Check with:

pi memory model status

If not downloaded:

pi memory model download

This fetches ~90 MB of ONNX model files to ~/.pi-go/models/. It auto-selects the optimal ONNX variant for the platform (quantized ARM64 on Apple Silicon, base on x86_64).

The model is optional. Without it, search falls back to FTS5 keyword matching. Semantic search requires the model; keyword search works without it.

Workflow

1. Verify the model is ready

pi memory model status

Output should show Model: all-MiniLM-L6-v2 with a path and size. If it says Model: not downloaded, run pi memory model download first.

2. Configure rooms (optional but recommended)

Create a mempalace.yaml at the repo root to map file patterns to semantic "rooms". This narrows the search space before embeddings fire, improving retrieval significantly (benchmark: 60.9% recall unfiltered → 94.8% with wing+room filtering).

wing: my-project          # top-level name (defaults to directory basename)

rooms:
  - name: api
    patterns:
      - "internal/api/**"
      - "internal/handler/**"
    keywords:
      - http
      - handler
      - route
  - name: models
    patterns:
      - "internal/models/**"
    keywords:
      - schema
      - struct
      - database
  - name: tests
    patterns:
      - "**/*_test.go"
    keywords:
      - test
      - mock
      - fixture

Rules for good rooms:

  • 3–8 rooms is the sweet spot. Too few = no filtering power. Too many = sparse drawers.
  • Use patterns (glob) for path-based assignment. Use keywords for content-based hints.
  • Files not matching any room go to a default room named general.
  • The wing defaults to the directory basename if omitted.

Read the full file on GitHub · 181 lines

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 · 181 lines · 0 tokens per session scan A 63fff3d541af

Subscribe to this mod's changes

memory-index is a skill published in the GitHub repository dimetron/pi-go (151 stars, last pushed yesterday), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,490 tokens. 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.

Related

Other skills, from other repositories

learn-from-history

审计近期对话历史,提炼重复失败、成功模式、稳定规则和 skill 改进。用户要求总结历史对话、 回顾近期 agent 表现、从历史中学习或寻找可自动化改进时使用。.

KonghaYao/peri · 55 tokens

code-review-context

Codex maintains a context (history of messages) that is sent to the model in inference requests.

openinterpreter/openinterpreter · 7 tokens

qa-testing

Verify your work by actually operating the app or website you changed, instead of assuming it works. Strongly recommended whenever you build, modify, or debug a web app, website, or desktop GUI app. Drive real browsers with the agent-browser CLI and native desktop apps with the cua-driver CLI. These are installed on…

openinterpreter/openinterpreter · 77 tokens

handoff

Write a compact, decision-ready handoff so the next session (or the user) can continue without reconstructing the current one. Use when the session is ending, context is running low, the user asks for a handoff / "pass the baton" / "hand off", or a long-running operation needs a durable state checkpoint.

Hmbown/CodeWhale · 70 tokens

use-modern-go

Use the Modern Go Guidelines CLI whenever writing, modifying, fixing, or refactoring Go code. Apply its version-specific guidance to generated changes.

JetBrains/go-modern-guidelines · 32 tokens

create-notes

Write a note to {shareddir}/notes/ that future agents can actually act on. Use after every coral eval, when a heartbeat (reflect / consolidate / pivot) asks for a note, or when you discover a grader / build / runtime issue that future agents will hit. Covers 4 note variants (experiment / infra / focus / synthesis)…

Human-Agent-Society/CORAL · 217 tokens