deduplicated-file-caching

deduplicated-file-caching is a skill for Claude Code from alivirgo/Major-AI-Skills. It costs 25 tokens per session (1,276 once invoked), scanned A, original, MIT.

A file-read cache for an agent that remembers files already loaded during a conversation and checks whether they changed using timestamps and SHA-256 hashes. Unchanged duplicate reads can return a reference instead of loading the file again.

In plain words
What is it for?
Use it during debugging or refactoring sessions where files are inspected repeatedly and may remain unchanged between reads.
Why use it?
Agents may repeatedly read the same unchanged file, sending identical content back into the conversation each time. Caching avoids that repeated context input.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: positional $N argument; mentions Codex.

Part of the major-ai-skills plugin — 147 skills, 8 plugins shipped together

Good fit Use it during debugging or refactoring sessions where files are inspected repeatedly and may remain unchanged between reads.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/alivirgo/major-ai-skills/deduplicated-file-caching
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 alivirgo/Major-AI-Skills --skill deduplicated-file-caching
Clone the repo
git clone --depth 1 https://github.com/alivirgo/Major-AI-Skills

Made for: Claude Code.

Or install major-ai-skills, the plugin that ships this one along with the rest of its 147 skills, 8 plugins.

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 deduplicated-file-caching

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/alivirgo/major-ai-skills/deduplicated-file-caching"><img src="https://agentmods.dev/badge/skills/alivirgo/major-ai-skills/deduplicated-file-caching.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 25 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,276 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.
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.00025 $0.01276
Opus 5 $0.00013 $0.00638
Sonnet 5 $0.00005 $0.00255
Haiku 4.5 $0.00003 $0.00128

Measured yesterday against content hash e450ac20e19c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

deduplicated-file-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 yesterday.

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/deduplicated-file-caching/SKILL.md · 116 lines

How it starts

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

In-Memory File Ingestion Deduplication (mtime Cache Guard)

Overview

During multi-step debugging and refactoring sessions, AI agents frequently call view_file on the exact same file path 3 to 5 times (e.g., re-reading src/routes.ts at Turn 2, Turn 7, and Turn 14 without any intervening edits on disk).

Each redundant file read re-injects hundreds or thousands of identical tokens into the transcript. In a 20-turn session, redundant file reads account for up to 40% of total input token waste.

The File Ingestion Deduplication Protocol tracks file path access, modification timestamps (mtime), and SHA-256 hashes in the agent runtime - intercepting duplicate read requests and returning a lightweight reference token if the file is already resident in active context and has not changed on disk.


Redundant Re-Reading vs. In-Memory Deduplication

┌─────────────────────────────────────────────────────────────┐
│                 File Read Deduplication Flow                │
│                                                             │
│  Uncached Redundant Reads (Anti-Pattern):                   │
│  • Turn 2: `view_file("src/config.ts")` (1,200 tokens)      │
│  • Turn 7: `view_file("src/config.ts")` (1,200 tokens)      │
│  • Turn 12: `view_file("src/config.ts")` (1,200 tokens)     │
│  ↳ 3,600 tokens billed for the exact same file content!     │
│                                                             │
│  Deduplication Cache Guard:                                 │
│  • Turn 2: `view_file("src/config.ts")` $\rightarrow$ Ingests (1,200)│
│  • Turn 7: `view_file("src/config.ts")` $\rightarrow$ Intercepted!  │
│    ↳ Return: `[CACHE HIT: src/config.ts unchanged (Turn 2)]`│
│  ↳ 12 tokens billed, 99% savings on subsequent reads!       │
└─────────────────────────────────────────────────────────────┘

The Deduplication State Machine

┌───────────────────────────────────────────────────────────────────────────┐
│ 1. INSPECT REQUEST: Agent calls `view_file(path)`                         │
│ 2. CHECK RUNTIME CACHE: Is `path` in active context session?              │
│    • NO $\rightarrow$ Read from disk $\rightarrow$ Record `mtime` & `hash` $\rightarrow$ Ingest │
│    • YES $\rightarrow$ Check disk `mtime`:                                 │
│        • Unchanged $\rightarrow$ Intercept & return 1-line Cache Reference │
│        • Changed on disk $\rightarrow$ Ingest updated content $\rightarrow$ Update hash  │
└───────────────────────────────────────────────────────────────────────────┘

Read the full file on GitHub · 116 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. yesterday Changed · -15 tokens per session e450ac20e19c
  2. 7d ago First seen · 116 lines · 40 tokens per session scan A de49a5645b7c

Subscribe to this mod's changes

deduplicated-file-caching is a skill published in the GitHub repository alivirgo/Major-AI-Skills (1 stars, last pushed today), licensed MIT. It adds 25 tokens to every session and 1,276 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-05.

Related

Other skills, from other repositories

agenttrace-session-audit

Audit local AI coding-agent sessions with agenttrace for cost, tool failures, latency, anomalies, health, diffs, and CI gates.

sickn33/agentic-awesome-skills · 34 tokens

error-experience-library

An error knowledge base that stores recurring error patterns, their causes, and the fixes that worked. It can search past entries and track whether each suggested fix succeeded.

hashgraph-online/awesome-codex-plugins · 46 tokens

agent-memory-mcp-v2

Agent Memory Skill workflow skill. Use this skill when the user needs A hybrid memory system that provides persistent, searchable knowledge management for AI agents (Architecture, Patterns, Decisions) and the operator should preserve the upstream workflow, copied support files, and provenance before merging or handing…

diegosouzapw/awesome-omni-skills · 62 tokens

azure-network-watcher

Expert knowledge for Azure Network Watcher development including troubleshooting, decision making, limits & quotas, security, configuration, and integrations & coding patterns. Use when configuring flow logs, Traffic Analytics, packet capture, VPN monitoring, or KQL/Terraform integrations, and other Azure Network…

MicrosoftDocs/Agent-Skills · 101 tokens

esp32-expert

This skill should be used for ESP32-specific hardware and runtime work in ESP-IDF, Arduino-ESP32, or PlatformIO projects: target/build detection, FreeRTOS tasks and ISRs, memory/DMA, peripherals, power, networking/security, OTA, crash diagnosis, and unattended reliability. Trigger on "debug this ESP32 crash", "review…

johnkozaris/jko-claude-plugins · 137 tokens

codebase-insight

When the user wants to deeply understand a codebase, map its architecture, or build a persistent mental model for future sessions. Use when the user says "explain this codebase," "map the architecture," "codebase insight," "understand this repo," "what does this project do," "how does this work," "analyze the…

irfad7/claude-power-skills · 98 tokens