storage-format

storage-format is a skill for Claude Code, Codex from tursodatabase/turso. It costs 26 tokens per session (1,080 once invoked), scanned A, original, MIT.

A technical guide to the on-disk format of a SQLite database file, including its header, pages, B-trees, cells, overflow pages, and free space. SQLite is a database engine that stores data in a file.

In plain words
What is it for?
Use it to study SQLite-compatible storage structures in tursodb. It covers page types, page sizes, header fields, overflow data, and the freelist.
Why use it?
It gives developers the details needed to understand how tables and indexes are laid out in the file. That is useful when inspecting, debugging, or implementing storage behavior in tursodb.

Skill for Claude CodeCodex

About the project

Turso is an in-process SQL database written in Rust that is compatible with SQLite and also accepts PostgreSQL syntax through an experimental frontend. It is for applications and organizations that need an embeddable database engine with support for multiple languages, platforms, and database features. The catalogue entries are skills and instructions for working with Turso.

tursodatabase/turso · 24,170 stars · on GitHub

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/tursodatabase/turso/storage-format
Any agent
npx skills add tursodatabase/turso --skill storage-format
Clone the repo
git clone --depth 1 https://github.com/tursodatabase/turso

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 storage-format

README.md
[![agentmods](https://agentmods.dev/badge/skills/tursodatabase/turso/storage-format.svg)](https://agentmods.dev/skills/tursodatabase/turso/storage-format)
Your own site
<a href="https://agentmods.dev/skills/tursodatabase/turso/storage-format"><img src="https://agentmods.dev/badge/skills/tursodatabase/turso/storage-format.svg" alt="Measured on agentmods" height="20"></a>
Per session 26 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,080 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.00026 $0.01080
Opus 5 $0.00013 $0.00540
Sonnet 5 $0.00005 $0.00216
Haiku 4.5 $0.00003 $0.00108

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

Security

Grade A, and why

storage-format 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.

.claude/skills/storage-format/SKILL.md · 142 lines

How it starts

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

Storage Format Guide

Database File Structure

┌─────────────────────────────┐
│ Page 1: Header + Schema     │  ← First 100 bytes = DB header
├─────────────────────────────┤
│ Page 2..N: B-tree pages     │  ← Tables and indexes
│            Overflow pages   │
│            Freelist pages   │
└─────────────────────────────┘

Page size: power of 2, 512-65536 bytes. Default 4096.

Database Header (First 100 Bytes)

Offset Size Field
0 16 Magic: "SQLite format 3\0"
16 2 Page size (big-endian)
18 1 Write format version (1=rollback, 2=WAL)
19 1 Read format version
24 4 Change counter
28 4 Database size in pages
32 4 First freelist trunk page
36 4 Total freelist pages
40 4 Schema cookie
56 4 Text encoding (1=UTF8, 2=UTF16LE, 3=UTF16BE)

All multi-byte integers: big-endian.

Page Types

Flag Type Purpose
0x02 Interior index Index B-tree internal node
0x05 Interior table Table B-tree internal node
0x0a Leaf index Index B-tree leaf
0x0d Leaf table Table B-tree leaf
- Overflow Payload exceeding cell capacity
- Freelist Unused pages (trunk or leaf)

B-tree Structure

Two B-tree types:

  • Table B-tree: 64-bit rowid keys, stores row data
  • Index B-tree: Arbitrary keys (index columns + rowid)
Interior page:  [ptr0] key1 [ptr1] key2 [ptr2] ...
                   │         │         │
                   ▼         ▼         ▼
               child     child     child
               pages     pages     pages

Leaf page:     key1:data  key2:data  key3:data ...

Page 1 always root of sqlite_schema table.

Cell Format

Table Leaf Cell

[payload_size: varint] [rowid: varint] [payload] [overflow_ptr: u32?]

Table Interior Cell

[left_child_page: u32] [rowid: varint]

Index Cells

Similar but key is arbitrary (columns + rowid), not just rowid.

Read the full file on GitHub · 142 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 · 142 lines · 26 tokens per session scan A 2a01b17ecf4b

Subscribe to this mod's changes

storage-format is a skill published in the GitHub repository tursodatabase/turso (24,170 stars, last pushed today), licensed MIT. It adds 26 tokens to every session and 1,080 once invoked, about $0.0001 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

chdb-datastore

Use when the user has tabular data (pandas DataFrame, parquet, csv, Arrow, json) and wants to filter, group, aggregate, join, or speed up slow pandas. Provides chDB DataStore — same pandas API, ClickHouse engine underneath. Also handles reading from S3, MySQL, PostgreSQL, MongoDB, ClickHouse Cloud, Iceberg, Delta Lake…

chdb-io/chdb · 168 tokens

chdb-sql

Use when the user wants to run SQL — especially analytical SQL — on local files (parquet/csv/json), URLs, S3 paths, or remote databases (Postgres, MySQL, MongoDB, ClickHouse Cloud, Iceberg, Delta Lake) without setting up a server. Provides chDB — embedded ClickHouse SQL in Python with 1000+ functions, Session for…

chdb-io/chdb · 214 tokens

duckdb

Use when analytical SQL must run in-process with no server: Parquet/CSV/JSON/Arrow queried in place, OLAP embedded in an app or notebook, a slow pandas groupby on multi-GB data, or S3/lakehouse data read without downloading. NOT a multi-user analytics server (that is clickhouse-analytics), NOT an app's transactional…

ericrisco/rsc-harness · 85 tokens

review-pr

Review Apache ShardingSphere or user-authorized downstream pull requests and PR discussions from public or authorized repository evidence. Use for code-correctness or mergeability decisions, CI-focused review, root-cause and regression analysis, complete consolidated findings, copy-ready committer feedback, challenged…

apache/shardingsphere · 77 tokens

review-pr

Review a GitHub pull request or local Git range against QuestDB coding standards.

questdb/questdb · 18 tokens

analyze-issue

Used to analyze Apache ShardingSphere community issues. Emphasizes root-cause-first and evidence-first classification before conclusions, and produces copy-ready GitHub issue replies in the voice of an Apache ShardingSphere community maintainer.

apache/shardingsphere · 50 tokens