claude-snapshot: Instructions file for Claude Code

CLAUDE.md

claude-snapshot CLAUDE.md is an instructions file for Claude Code from zyeri/claude-snapshot. It costs 3,894 tokens per session, scanned A, original, MIT.

A set of instructions for working on claude-snapshot, a Claude Code skill that backs up, restores, and compares Claude Code configuration across operating systems.

In plain words
What is it for?
Use it when modifying or verifying the claude-snapshot scripts, their documentation, or their development setup.
Why use it?
It explains the repository's architecture, commands, verification process, and rules for keeping backups portable and free of secrets.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: reads .claude/ paths; mentions CLAUDE.md; mentions Claude Code.

This is zyeri/claude-snapshot's own configuration. It tells Claude Code how to work on claude-snapshot itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything claude-snapshot configures →

Reuse

Borrowing it

Nothing to install: this file belongs to zyeri/claude-snapshot. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/zyeri/claude-snapshot/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/zyeri/claude-snapshot

Made for: Claude Code.

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 claude-snapshot CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/zyeri/claude-snapshot/claude-md.svg)](https://agentmods.dev/instructions/zyeri/claude-snapshot/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/zyeri/claude-snapshot/claude-md"><img src="https://agentmods.dev/badge/instructions/zyeri/claude-snapshot/claude-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 3,894 This file is loaded in full into every session.
When invoked 3,894 The same file — it is already loaded in full.
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.03894 $0.03894
Opus 5 $0.01947 $0.01947
Sonnet 5 $0.00779 $0.00779
Haiku 4.5 $0.00389 $0.00389

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

Security

Grade A, and why

claude-snapshot CLAUDE.md 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.

CLAUDE.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.

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

What this repository is

The repo root is a Claude Code skill (claude-snapshot): portable, secret-free backup / restore / compare of a full Claude Code configuration across OSes. The two scripts are runtime-dependency-free Node ESM with no build step - users install via the plugin and run them directly; nothing is compiled or npm installed on their side. The package.json and node_modules are dev-only tooling (Biome, markdownlint, TypeScript for @ts-check); they never ship to users and the scripts never import them. There is no unit-test framework - verification is done by running the scripts against sandboxes (below).

On the author's machine ~/.claude/skills/claude-snapshot is a junction/symlink to this repo: edits here are live immediately in every Claude Code session. Treat script changes as production changes and verify before considering them done.

Hard invariants (violating these is a bug, not a style issue)

  1. Shareability - no username, home path, hostname, or secret may appear anywhere in skill source. Everything machine-specific is discovered at runtime (os.homedir(), CLAUDE_CONFIG_DIR, process.execPath, process.platform/arch) and tokenized in bundles. Before committing: grep -ri "<username>\|C:\\\\Users\|/Users/" --include="*.md" --include="*.mjs" . must return nothing.
  2. No secrets in bundles - three layers in collect.mjs: SECRET_KEY_RE (JSON key names), SECRET_VALUE_RE (JSON whole-value vendor formats; generic prefixes anchored, high-entropy vendor prefixes unanchored - a Bearer github_pat_... header once slipped past an anchored regex), and SECRET_TEXT_PATTERNS + redactText() (full-text pass over every collected text file - hooks/memory/markdown, not just JSON; length-qualified so documentation quoting a bare prefix never self-matches). No entropy heuristic by design (git SHAs false-positive). Every redaction is recorded (names/labels only) in EXCLUDED.md.
  3. Restore never writes blind - dry-run by default, snapshot-before-write on --apply, conflicts always reported and never auto-resolved (existing values win). Idempotency is a contract: applying the same bundle twice must report all-skip, zero writes.
  4. The bundle is untrusted input on restore/extract/compare (it may come from another party or a bare-machine bootstrap). Every manifest field (bundlePath, target, merge) and file body is attacker-controllable. Defenses that MUST hold when touching apply.mjs:
    • Path containment. safeJoin (extract) rejects ../absolute/drive escapes and re-checks isWithin(dest). targetPath resolves + confines every restore target to ALLOWED_TARGET_ROOTS (the CLAUDE_HOME subtree plus exact files ~/.claude.json, ~/CLAUDE.md); out-of-bounds -> rejected, never written. Anything comparing/keying paths uses the tokenized target, not the cosmetic bundlePath.
    • Symlink-safe writes. safeWriteFile refuses a symlink at the final component (wx on create closes the TOCTOU on the create path). Known residual: the existing-file overwrite branch still follows a symlink swapped in by a concurrent local process - out of the bundle threat model, documented, not chased.
    • Prototype-pollution filter. PROTO_KEYS drops __proto__/constructor/prototype at every level of deepMerge and detokenizeJson.
    • Corrupt bundles are rejected up front, not mid-write. Before any planning or write, a container whose manifest.files is missing/not-an-array, or that lists a file with no matching (or non-string-content) record in files, exits with a clean error. An attacker-crafted manifest must not crash readBundle with a raw TypeError after partial work.
    • Executable config is surfaced, not silently applied. Restoring hooks/skills/MCP is the tool's job (can't be blocked), so instead every exec-bearing change is flagged in report.securityWarnings: flagExecKeys for JSON hooks/statusLine/command key additions, an MCP-add warning, and one consolidated summary of new files dropped into exec dirs (hooks/skills/commands/agents/ output-styles). Consolidation is deliberate - per-file warnings on a normal restore (dozens of legit files) are noise that masks a genuinely unexpected drop.
  5. Mode names are backup / restore / compare - never mix naming pairs (no "export").

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. 6d ago First seen · 221 lines · 3,894 tokens per session scan A 142981429c98

Subscribe to this mod's changes

claude-snapshot CLAUDE.md is an instructions file published in the GitHub repository zyeri/claude-snapshot (1 stars, last pushed 1mo ago), licensed MIT. It adds 3,894 tokens to every session, about $0.0195 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-31.

Related

Other instructions, from other repositories

next.js AGENTS.md

AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,296 tokens

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,182 tokens

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 6,785 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,469 tokens

spec-kit AGENTS.md

AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.

github/spec-kit · 7,104 tokens