index-keyspace-evolution

index-keyspace-evolution is a skill for Claude Code, Codex from Goldziher/basemind. It costs 9 tokens per session (663 once invoked), scanned A, original, MIT.

A guide for safely changing the key spaces and record formats used by Fjall, a Rust storage library, in an index. It covers key encoding, decoding, prefixes, schema versions, and tests.

In plain words
What is it for?
Use it when adding an index partition, changing a key format, changing an indexed record's value shape, or writing round-trip and prefix-isolation tests.
Why use it?
It helps prevent existing indexed data from becoming unreadable when keys or stored values change, while distinguishing changes that require rebuilding the index.

Skill for Claude CodeCodex

Part of the basemind plugin — 15 skills, 10 commands, 6 agents, 2 hooks, 1 MCP server shipped together

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/goldziher/basemind/index-keyspace-evolution
Any agent
npx skills add Goldziher/basemind --skill index-keyspace-evolution
Clone the repo
git clone --depth 1 https://github.com/Goldziher/basemind

Made for: Claude Code, Codex.

Or install basemind, the plugin that ships this one along with the rest of its 15 skills, 10 commands, 6 agents, 2 hooks, 1 MCP server.

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 index-keyspace-evolution

README.md
[![agentmods](https://agentmods.dev/badge/skills/goldziher/basemind/index-keyspace-evolution.svg)](https://agentmods.dev/skills/goldziher/basemind/index-keyspace-evolution)
Your own site
<a href="https://agentmods.dev/skills/goldziher/basemind/index-keyspace-evolution"><img src="https://agentmods.dev/badge/skills/goldziher/basemind/index-keyspace-evolution.svg" alt="Measured on agentmods" height="20"></a>
Per session 9 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 663 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.1 $0.00009 $0.00663
Opus 5 $0.00005 $0.00331
Sonnet 5 $0.00002 $0.00133
Haiku 4.5 $0.00001 $0.00066

Measured 5d ago against content hash 9340238c0391, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

index-keyspace-evolution 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.

.ai-rulez/skills/index-keyspace-evolution/SKILL.md · 54 lines

How it starts

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

Index Keyspace Evolution

Use this when adding a new Fjall keyspace, extending an existing key encoding, or changing the value shape of an indexed record.

Decide if you need a schema bump

Bumping INDEX_SCHEMA_VER triggers auto-wipe of .basemind/views/<view>/index.fjall/ on the user's next scan. The next scan rebuilds from the msgpack blobs — no data loss, but a one-time scan cost. Bump when:

  • The byte layout of an existing key changes.
  • A SymbolKind ordinal would shift (you reordered the enum — don't).
  • A value's msgpack shape lost a field or renamed one.

Do not bump when:

  • Adding a brand-new partition (no existing entries to migrate).
  • Adding a #[serde(default)]-defaulted field to an indexed value.
  • Adding a new SymbolKind variant at the tail (the u8 mapping is stable).

Steps

  1. Encoder + decoder + tests in src/index/keys.rs

    • Add <partition>_key(...) -> Vec<u8> and <partition>_prefix(...) -> Vec<u8>.
    • Add parse_<partition>_key(&[u8]) -> Result<(...), …>.
    • Add unit tests for round-trip + prefix isolation: insert two keys with a shared prefix that differ only in the suffix, scan the prefix, confirm the wrong sibling is excluded.
  2. Open the partition in src/index/mod.rs

    • Add the field to IndexDb.
    • Open via db.keyspace("<name>", PartitionCreateOptions::default()) next to the others.
    • If used only for reads, mark #[allow(dead_code)] until a writer / reader exists.
  3. Writer in src/index/writer.rs

    • Extend upsert_file to derive secondary keys from the L1/L2 input and stage inserts.
    • Extend the read-before-write deletion to enumerate the partition under the file's primary key and stage deletes for those secondary keys.
    • Add integration tests covering upsert-then-remove leaves the partition empty.
  4. Reader in src/mcp/helpers.rs (and/or query.rs)

    • Add a scan_<partition>_by_<key> helper that range-scans the prefix and decodes values.
    • Apply scan_cap = limit * 8.

Read the full file on GitHub · 54 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 · 54 lines · 9 tokens per session scan A 9340238c0391

Subscribe to this mod's changes

index-keyspace-evolution is a skill published in the GitHub repository Goldziher/basemind (98 stars, last pushed 3d ago), licensed MIT. It adds 9 tokens to every session and 663 once invoked, about $0.0000 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.

Related

Other skills, from other repositories

projectatlas

Use ProjectAtlas as the atlas-first orientation layer before broad source reads, with MCP-first task startup, short-alias worktree registration and routing, safe targeted initialization, ranked navigation, exact or federated graph evidence, purpose curation, health, lint, and repository-wide token reporting.

styler-ai/ProjectAtlas · 60 tokens

codex-coding-plugin

Build, review, or fix ProjectAtlas plugin/runtime installer integration for Codex, Claude Code, and OpenCode, especially version convergence, stale ProjectAtlas cache repair, MCP config generation, skill artifacts, host smoke tests, and fake-host tests for ProjectAtlas releases.

styler-ai/ProjectAtlas · 59 tokens

research

Performs deep research on a topic via deepresearch. Simulates a multi-step research process and returns a comprehensive research result as a string.

study8677/repobrain · 32 tokens

lsp-refactor

End-to-end safe refactor workflow — blast-radius analysis, speculative preview, apply to disk, verify build, run affected tests. Inlines lsp-impact + lsp-safe-edit + lsp-verify + lsp-test-correlation into one coordinated sequence.

blackwell-systems/agent-lsp · 57 tokens

lsp-architecture

Generate a structural architecture overview of a codebase: languages, package map, entry points, dependency graph, and hotspots. One call for the big picture.

blackwell-systems/agent-lsp · 0 tokens

lsp-explore

Tell me about this symbol": hover + implementations + call hierarchy + references in one pass — for navigating unfamiliar code.

blackwell-systems/agent-lsp · 0 tokens