loom-caching

loom-caching is a skill for Claude Code, Codex from cosmix/loom. It costs 31 tokens per session (3,286 once invoked), scanned A, original, MIT.

A guide to caching, which stores frequently used or expensive-to-create data closer to the code that needs it. It covers Redis, Memcached, content delivery networks, database queries, and machine-learning models.

In plain words
What is it for?
Use it to choose cache read and write patterns, set expiration and removal rules, handle cache invalidation, and prevent overloaded systems during mass cache misses.
Why use it?
It helps reduce repeated work and waiting time while addressing the difficult parts of caching: outdated data, deciding when entries expire, and many requests missing the same entry at once.

Skill for Claude CodeCodex

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

Good fit Use it to choose cache read and write patterns, set expiration and removal rules, handle cache invalidation, and prevent overloaded systems during mass cache misses.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/cosmix/loom/loom-caching
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-caching
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-caching

README.md
[![agentmods](https://agentmods.dev/badge/skills/cosmix/loom/loom-caching/github.svg)](https://agentmods.dev/skills/cosmix/loom/loom-caching)
Your own site
<a href="https://agentmods.dev/skills/cosmix/loom/loom-caching"><img src="https://agentmods.dev/badge/skills/cosmix/loom/loom-caching/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 loom-caching

Your own site · 80×15
<a href="https://agentmods.dev/skills/cosmix/loom/loom-caching"><img src="https://agentmods.dev/badge/skills/cosmix/loom/loom-caching.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 31 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,286 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.00031 $0.03286
Opus 5.5 $0.00012 $0.01314
Sonnet 5.5 $0.00006 $0.00657
Haiku 4.5 $0.00003 $0.00329

Measured 1mo ago against content hash ef1f4f177e06, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

loom-caching 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 1mo 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-caching/SKILL.md · 196 lines

How it starts

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

Caching

Overview

Store expensive-to-compute or frequently-read data closer to the consumer. The easy part is the read path; the hard parts are invalidation (keeping it correct) and stampede (surviving a mass miss). This skill is organized around those failure modes, not around toy get/set wrappers.

Strategy Selection

Strategy Read path Write path Consistency Failure mode to watch
Cache-aside (lazy) App checks cache → loads on miss → populates App writes DB, then invalidates (don't update) cache Eventual; brief staleness window Stampede on hot-key miss; race between load and invalidate
Read-through Cache library loads on miss (paired with write-through) Eventual Same as aside; hides loader in the cache layer
Write-through Read from cache Write DB and cache synchronously Strong-ish; cache always fresh after write Write latency = DB + cache; cache churn for rarely-read keys
Write-behind (write-back) Read from cache Write cache now, flush DB async in batches Weak; data loss if node dies before flush Lost writes on crash; ordering; DB divergence

Default to cache-aside. It's simple, resilient (cache down ≠ writes fail), and puts invalidation in your control. Reach for write-through only when you can't tolerate a post-write stale read; write-behind only for write-heavy, loss-tolerant data (metrics, counters, activity feeds).

⚠ On write, invalidate — do not update — the cache (cache-aside). Two concurrent writers updating the cache can commit their DB writes in one order and their cache writes in the opposite order, leaving the cache permanently wrong. Deleting the entry forces the next reader to reload the DB's truth. (This is the [Facebook "leases"] class of bug.)

⚠ Write-behind loses data. A crash between "wrote cache" and "flushed DB" silently drops the write. Never use it as the system of record for anything you can't recompute or afford to lose.

Read the full file on GitHub · 196 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. 1mo ago Changed · -23 tokens per session ef1f4f177e06
  2. 1mo ago First seen · 196 lines · 54 tokens per session scan A 2e0635220491

Subscribe to this mod's changes

loom-caching is a skill published in the GitHub repository cosmix/loom (62 stars, last pushed yesterday), licensed MIT. It adds 31 tokens to every session and 3,286 once invoked, about $0.0001 per session on Opus 5.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

aws-cloudformation-elasticache

Provides AWS CloudFormation patterns for ElastiCache Redis or Memcached infrastructure, including subnet groups, parameter groups, security controls, and cross-stack outputs. Use when designing cache tiers, high-availability replication groups, encryption settings, or reusable CloudFormation templates for application…

giuseppe-trisciuoglio/developer-kit · 61 tokens

spring-boot-cache

Provides patterns for implementing Spring Boot caching: configures Redis/Caffeine/EhCache providers with TTL and eviction policies, applies @Cacheable/@CacheEvict/@CachePut annotations, validates cache hit/miss behavior, and exposes metrics via Actuator. Use when adding caching to Spring Boot services, configuring…

giuseppe-trisciuoglio/developer-kit · 79 tokens

build-feature-store

Build a feature store using Feast for centralized feature management, configure offline and online stores for batch and real-time serving, define feature views with transformations, and implement point-in-time correct joins for ML pipelines. Use when managing features for multiple ML models, ensuring training-serving…

pjt222/agent-almanac · 86 tokens

domainmodel-dsl

Read, write, and modify Domain Model DSL files (.dmodel) — datatypes, entities with inheritance and multi-valued features, and nested packages with qualified cross-references. Use when the user wants to create, edit, explain, or debug a domain model in this DSL, including resolving references across packages.

TypeFox/agent-skills · 68 tokens

domainmodel-dsl

Work with the Domain Model DSL (.dmodel) for describing data models — datatypes, entities, and their features. Use when the user wants to create or edit a domain model in this DSL.

TypeFox/agent-skills · 45 tokens

google-cloud-storage-fuse

Mounts Cloud Storage buckets on Google Cloud as a POSIX file system using Cloud Storage FUSE (and the gcsfuse CLI tool). Use when interacting with the gcsfuse CLI or Cloud Storage FUSE mounts: decide whether FUSE, native gs:// reads, or Filestore/Managed Lustre fits a workload, deploy tuned mounts on GKE, Compute…

google/skills · 239 tokens