loom-serialization

loom-serialization is a skill for Claude Code, Codex from cosmix/loom. It costs 13 tokens per session (4,179 once invoked), scanned A, original, MIT.

A guide to converting data between in-memory values and formats such as JSON, Protobuf, Avro, MessagePack, and CBOR. It focuses on format choice, compatibility between versions, and correctness.

In plain words
What is it for?
It is for choosing data formats and designing safe encoding, decoding, schema changes, and handling of values such as large integers or unknown fields.
Why use it?
It helps avoid data loss or communication failures when stored or transmitted data is read by different programs or newer versions of software.

Skill for Claude CodeCodex

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

Good fit It is for choosing data formats and designing safe encoding, decoding, schema changes, and handling of values such as large integers or unknown fields.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/cosmix/loom/loom-serialization
View source ↗ cosmix/loom
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 cosmix/loom --skill loom-serialization
Clone the repo
git clone --depth 1 https://github.com/cosmix/loom

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 loom-serialization

README.md
[![agentmods](https://agentmods.dev/badge/skills/cosmix/loom/loom-serialization.svg)](https://agentmods.dev/skills/cosmix/loom/loom-serialization)
Your own site
<a href="https://agentmods.dev/skills/cosmix/loom/loom-serialization"><img src="https://agentmods.dev/badge/skills/cosmix/loom/loom-serialization.svg" alt="Measured on agentmods" height="20"></a>
Per session 13 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,179 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00013 $0.04179
Opus 5 $0.00006 $0.02090
Sonnet 5 $0.00003 $0.00836
Haiku 4.5 $0.00001 $0.00418

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

Security

Grade A, and why

loom-serialization 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.

skills/loom-serialization/SKILL.md · 221 lines

How it starts

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

Serialization

Overview

Converting in-memory data to bytes for storage/transport and back. The hard problems are not encode/decode calls — they are schema evolution (old and new code exchanging data safely), format choice (self-describing vs schema'd, text vs binary), and correctness traps (int64 precision, NaN, non-deterministic output, unknown-field handling). This skill is mechanism-level; assume you can call the library.

Format Selection

Format Schema Self-describing Cross-lang Notes / when to reach for it
JSON none yes yes Debuggable, ubiquitous. No int64/binary/date types; slow; large. Default for public HTTP APIs.
Protobuf IDL (.proto) no (tag numbers only) excellent Compact, tag-based evolution, gRPC. Needs .proto to read bytes.
Avro required (writer+reader) schema travels or via registry good No per-field tags/names in payload → smallest tagged binary; schema-resolution evolution. Kafka/Hadoop.
MessagePack none yes yes "binary JSON": same data model, ~2x smaller/faster. Dynamic data without a schema.
CBOR (RFC 8949) none yes yes IETF-standard MessagePack cousin; has a canonical form + tags. COSE/WebAuthn/DTLS.
FlatBuffers / Cap'n Proto IDL no good Zero-copy: read fields without parsing; mmap-able. Games, low-latency IPC.
bincode / postcard Rust type layout no no (Rust↔Rust) Fastest+smallest for Rust-only. No evolution — field order/type is the contract.
TOML / YAML none yes yes Config, human-authored. Not for hot-path data (YAML esp. slow + footguns).

Decision heuristics: public API / must be human-readable → JSON; internal RPC, polyglot, evolving → protobuf (gRPC); event stream with a registry → Avro; Rust-to-Rust cache/IPC, no evolution → bincode/postcard; need to read one field of a huge blob → FlatBuffers; cryptographic canonicalization → CBOR canonical or JCS.

Read the full file on GitHub · 221 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 · 221 lines · 13 tokens per session scan A c4b7c55ade23

Subscribe to this mod's changes

loom-serialization is a skill published in the GitHub repository cosmix/loom (54 stars, last pushed yesterday), licensed MIT. It adds 13 tokens to every session and 4,179 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-09-03.