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.
npx skills add alivirgo/Major-AI-Skills --skill deduplicated-file-cachinggit clone --depth 1 https://github.com/alivirgo/Major-AI-SkillsWrote 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.
[](https://agentmods.dev/skills/alivirgo/major-ai-skills/deduplicated-file-caching)<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.
<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>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.
| Model | Per session | Once 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 |
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.
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 │
└───────────────────────────────────────────────────────────────────────────┘
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.
- yesterday Changed · -15 tokens per session e450ac20e19c
- 7d ago First seen · 116 lines · 40 tokens per session scan A de49a5645b7c
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.
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.
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.
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…
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…
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…
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…