lattice

lattice is a skill for Claude Code, Codex from yogthos/Matryoshka. It costs 43 tokens per session (1,127 once invoked), scanned A, original, Apache-2.0.

A method for exploring files over 500 lines through compact, handle-based queries instead of loading everything at once.

In plain words
What is it for?
Use it to search, filter, count, aggregate, and inspect selected parts of large files through a load, query, expand, and close workflow.
Why use it?
It makes large documents easier to search and analyze while reducing the amount of text that must be handled directly.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to search, filter, count, aggregate, and inspect selected parts of large files through a load, query, expand, and close workflow.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/yogthos/matryoshka/lattice
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.

Any agent
npx skills add yogthos/Matryoshka --skill lattice
Clone the repo
git clone --depth 1 https://github.com/yogthos/Matryoshka

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 lattice

README.md
[![agentmods](https://agentmods.dev/badge/skills/yogthos/matryoshka/lattice/github.svg)](https://agentmods.dev/skills/yogthos/matryoshka/lattice)
Your own site
<a href="https://agentmods.dev/skills/yogthos/matryoshka/lattice"><img src="https://agentmods.dev/badge/skills/yogthos/matryoshka/lattice/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for lattice

Your own site · 80×15
<a href="https://agentmods.dev/skills/yogthos/matryoshka/lattice"><img src="https://agentmods.dev/badge/skills/yogthos/matryoshka/lattice.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 43 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,127 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.00043 $0.01127
Opus 5 $0.00022 $0.00563
Sonnet 5 $0.00009 $0.00225
Haiku 4.5 $0.00004 $0.00113

Measured 9d ago against content hash 03f2abe1e9a7, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

lattice 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 9d 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.

skills/lattice/SKILL.md · 135 lines

How it starts

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

Lattice - Large File Analysis

Use the Lattice MCP tools to analyze files that are too large to read directly. Lattice stores query results server-side and returns compact handle stubs, achieving 97%+ token savings.

When to Use

  • File is larger than 500 lines (for smaller files, use Read directly)
  • You need multiple searches on the same file
  • You're extracting or aggregating structured data (counts, sums, patterns)
  • You're doing exploratory analysis and don't know what you're looking for
  • You want to avoid hallucination on factual queries about file contents

Core Workflow

The standard workflow is: load → query → expand → close

  1. lattice_load — Open the file (starts a session)
  2. lattice_query — Run Nucleus S-expression commands (returns handle stubs like $res1)
  3. lattice_expand — Inspect actual data from a handle when you need to see contents
  4. lattice_close — End the session when done

Efficiency Tips

  • Chain operations in sequence rather than making many independent queries. Use RESULTS to refer to the previous result and build a pipeline in a single query session.
  • Start broad, then narrow: grep first, then filter, then count/sum.
  • Only expand when needed: Handle stubs give you counts and previews — expand only when you need to see actual data for decision-making.
  • Prefer (count RESULTS) or (sum RESULTS) over expanding and counting client-side.

Nucleus Command Reference

Search

(grep "pattern")              ; Regex search — returns handle to matching lines
(fuzzy_search "query" 10)     ; Fuzzy match — top N results by relevance
(lines 10 20)                 ; Get specific line range (start end)

Transform

(filter RESULTS (lambda x (match x "pattern" 0)))   ; Keep matching items
(map RESULTS (lambda x (match x "(\\d+)" 1)))       ; Extract regex group from each item

Aggregate

(count RESULTS)               ; Count items (returns scalar directly)
(sum RESULTS)                 ; Sum numeric values (auto-extracts numbers)

Read the full file on GitHub · 135 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. 9d ago First seen · 135 lines · 43 tokens per session scan A 03f2abe1e9a7

Subscribe to this mod's changes

lattice is a skill published in the GitHub repository yogthos/Matryoshka (148 stars, last pushed 3mo ago), licensed Apache-2.0. It adds 43 tokens to every session and 1,127 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.

Related

Other skills, from other repositories

slacrawl

Archive and search Slack workspace messages, threads, and channels via the slacrawl CLI. Supports API sync, Slack export ZIP import, local desktop cache import, and full-text search.

moltis-org/moltis · 41 tokens

obsidian

Read, search, and create notes in the Obsidian vault.

moltis-org/moltis · 17 tokens

gentech-blockrun

GenTech Labs' integration patterns for BlockRun MCP from Hermes Agent. Covers daily usage patterns, cost-optimized workflows, multi-tool pipelines, and reliable error handling for BlockRun's full toolset.

BlockRunAI/blockrun-mcp · 46 tokens

portainer-mcp-hygiene

How to drive the Portainer MCP server's tools correctly — both reading and mutating. Reading: project responses with select (JMESPath), where the heavy fields live (snapshots, status blocks, managed fields), how to handle non-JSON Docker/K8s proxy endpoints (container and pod logs, stats, exec), and how to interpret…

portainer/portainer-mcp · 315 tokens

memory-processor

Iva's daily-memory processor. Reads the day's two-sided transcript (daily/YYYY-MM-DD.md), distills noteworthy entities / decisions / ideas into typed autograph cards, links them into the graph, and produces a daily-summary card (topics + MOC) that navigates down to the raw transcript and up to the week. Model-agnostic…

smixs/iva-agent · 106 tokens

tmux-lane-orchestrator

Manage one tmux agent lane from its matching ops pane, inspect live pane state and Codex logs on cold start, and produce concise manager summaries for OpenClaw and adjacent project work.

vincentkoc/dotskills · 46 tokens