snapshot-testing

snapshot-testing is a skill for Claude Code, Codex from ComeOnOliver/skillshub. It costs 36 tokens per session (2,153 once invoked), scanned A, a copy of snapshot-testing, MIT.

A guide to snapshot testing with Verify, which saves a program’s output as an approved file and compares future output against it.

In plain words
What is it for?
Use it to check public APIs, HTTP responses, rendered emails or reports, generated code, serialized data, and other structured output.
Why use it?
It helps reveal unintended changes in complex output that can be difficult to check with ordinary value-by-value tests, while allowing deliberate changes through review.

Skill for Claude CodeCodex

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

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/comeonoliver/skillshub/snapshot-testing
Any agent
npx skills add ComeOnOliver/skillshub --skill snapshot-testing
Clone the repo
git clone --depth 1 https://github.com/ComeOnOliver/skillshub

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 snapshot-testing

README.md
[![agentmods](https://agentmods.dev/badge/skills/comeonoliver/skillshub/snapshot-testing.svg)](https://agentmods.dev/skills/comeonoliver/skillshub/snapshot-testing)
Your own site
<a href="https://agentmods.dev/skills/comeonoliver/skillshub/snapshot-testing"><img src="https://agentmods.dev/badge/skills/comeonoliver/skillshub/snapshot-testing.svg" alt="Measured on agentmods" height="20"></a>
Per session 36 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,153 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin 100% copy Near-identical to another mod 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.00036 $0.02153
Opus 5 $0.00018 $0.01077
Sonnet 5 $0.00007 $0.00431
Haiku 4.5 $0.00004 $0.00215

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

Security

Grade A, and why

snapshot-testing 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 6d 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.

Origin

This is a copy

100% identical to snapshot-testing — 1 line differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

skills/Aaronontheweb/dotnet-skills/snapshot-testing/SKILL.md · 412 lines

How it starts

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

Snapshot Testing with Verify

When to Use This Skill

Use snapshot testing when:

  • Verifying rendered output (HTML emails, reports, generated code)
  • Approving public API surfaces for breaking change detection
  • Testing HTTP response bodies and headers
  • Validating serialization output
  • Catching unintended changes in complex objects

What is Snapshot Testing?

Snapshot testing captures output and compares it against a human-approved baseline:

  1. First run: Test generates a .received. file with actual output
  2. Human review: Developer approves it, creating a .verified. file
  3. Subsequent runs: Test compares output against .verified. file
  4. Changes detected: Test fails, diff tool shows differences for review

This catches unintended changes while allowing intentional changes through explicit approval.


Installation

Add Verify Package

dotnet add package Verify.Xunit
# or for other test frameworks:
dotnet add package Verify.NUnit
dotnet add package Verify.MSTest

Configure ModuleInitializer

Create a ModuleInitializer.cs in your test project:

using System.Runtime.CompilerServices;

public static class ModuleInitializer
{
    [ModuleInitializer]
    public static void Init()
    {
        // Use source-file-relative paths for verified files
        VerifyBase.UseProjectRelativeDirectory("Snapshots");

        // Configure diff tool (optional - auto-detected)
        // DiffTools.UseOrder(DiffTool.Rider, DiffTool.VisualStudioCode);
    }
}

Basic Usage

Simple Object Verification

[Fact]
public Task VerifyUserDto()
{
    var user = new UserDto(
        Id: "user-123",
        Name: "John Doe",
        Email: "[email protected]",
        CreatedAt: new DateTime(2025, 1, 15));

    return Verify(user);
}

Creates VerifyUserDto.verified.txt:

{
  Id: user-123,
  Name: John Doe,
  Email: [email protected],
  CreatedAt: 2025-01-15T00:00:00
}

String/HTML Verification

Read the full file on GitHub · 412 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. 6d ago First seen · 412 lines · 36 tokens per session scan A ac3c3ed521e1

Subscribe to this mod's changes

snapshot-testing is a skill published in the GitHub repository ComeOnOliver/skillshub (63 stars, last pushed 2mo ago), licensed MIT. It adds 36 tokens to every session and 2,153 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to snapshot-testing, differing in 1 line, and is treated as a copy.