cached-system-instructions

cached-system-instructions is a skill for Claude Code from alivirgo/Major-AI-Skills. It costs 20 tokens per session (1,285 once invoked), scanned A, original, MIT.

A way to organize repeated instructions so AI services can reuse the unchanged beginning of a conversation. It is designed for Anthropic and OpenAI prompt-caching systems.

In plain words
What is it for?
Use it when designing system prompts for multi-turn coding-agent sessions. It helps structure instructions so their repeated prefix stays unchanged.
Why use it?
It reduces repeated processing of the same instructions during long agent sessions, which can lower response delay and input costs.

Skill for Claude Code

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

Part of the mas-efficiency-pack plugin — 5 skills shipped together

Good fit Use it when designing system prompts for multi-turn coding-agent sessions. It helps structure instructions so their repeated prefix stays unchanged.

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

Made for: Claude Code.

Or install mas-efficiency-pack, the plugin that ships this one along with the rest of its 5 skills.

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 cached-system-instructions

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/alivirgo/major-ai-skills/cached-system-instructions"><img src="https://agentmods.dev/badge/skills/alivirgo/major-ai-skills/cached-system-instructions.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 20 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,285 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.00020 $0.01285
Opus 5 $0.00010 $0.00642
Sonnet 5 $0.00004 $0.00257
Haiku 4.5 $0.00002 $0.00128

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

Security

Grade A, and why

cached-system-instructions 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 today.

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.

plugins/mas-efficiency-pack/skills/cached-system-instructions/SKILL.md · 123 lines

How it starts

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

Cached System Instructions (KV-Cache Prefix Architecture)

Overview

In Large Language Models, processing input tokens requires running dense matrix multiplications across the entire input sequence on every turn. In a 50-turn agent session with a 4,000-token system prompt, the provider re-processes the exact same 4,000 tokens 50 separate times ($200,000\text{ redundant token computations}$).

Prompt Caching (Anthropic Prompt Caching, OpenAI Automatic Prefix Caching, DeepSeek Context Caching) saves the transformer's Key-Value (KV) Activation States in GPU memory. Re-sending an identical prefix reuses the precomputed KV cache, cutting Time-to-First-Token (TTFT) latency by 80% and applying an automatic 90% cost discount.

The Hierarchical System Caching Protocol organizes instructions to guarantee uninterrupted prefix matching.


Uncached Re-computation vs. KV-Cache Hit

┌─────────────────────────────────────────────────────────────┐
│                 KV-Cache Mechanics Comparison               │
│                                                             │
│  Uncached Execution (Every Turn):                           │
│  • Re-computes Attention Matrices for 4,000 System Tokens   │
│  • TTFT Latency: 2.8 seconds                                │
│  • Full Input Rate: $3.00 / M tokens                        │
│                                                             │
│  KV-Cache Hit (Unbroken Static Prefix):                     │
│  • Directly loads KV-tensors from GPU VRAM                  │
│  • TTFT Latency: 0.35 seconds (8x Faster!)                  │
│  • Cached Input Rate: $0.30 / M tokens (90% Cost Discount)  │
└─────────────────────────────────────────────────────────────┘

The 4-Layer Caching Hierarchy

To prevent accidental cache invalidation, place instructions in order of decreasing stability:

┌───────────────────────────────────────────────────────────────────────────┐
│ LAYER 1: Base Agent Identity & Tool Schemas (100% Immutable) ──► CACHED   │
│ LAYER 2: Repository Architecture Blueprint (Static for Session)──► CACHED │
│ LAYER 3: MCP Tool Definitions & Skill Instructions         ──► CACHED     │
│ ───────────────────────────────────────────────────────────────────────── │
│ LAYER 4: Dynamic User Requests & Shell Outputs (Dynamic Tail)──► UNCACHED │
└───────────────────────────────────────────────────────────────────────────┘

Read the full file on GitHub · 123 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. today Changed · -28 tokens per session 1cb2754b4d81
  2. 12d ago First seen · 123 lines · 48 tokens per session scan A e92a1cfe3288

Subscribe to this mod's changes

cached-system-instructions is a skill published in the GitHub repository alivirgo/Major-AI-Skills (1 stars, last pushed today), licensed MIT. It adds 20 tokens to every session and 1,285 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-08-31.

Related

Other skills, from other repositories

ai-wrapper-product-v2

AI Wrapper Product workflow skill. Use this skill when the user needs Expert in building products that wrap AI APIs (OpenAI, Anthropic, and the operator should preserve the upstream workflow, copied support files, and provenance before merging or handing off.

diegosouzapw/awesome-omni-skills · 55 tokens

ai-engineering-toolkit

AI Engineering Toolkit workflow skill. Use this skill when the user needs 6 production-ready AI engineering workflows: prompt evaluation (8-dimension scoring), context budget planning, RAG pipeline design, agent security audit (65-point checklist), eval harness building, and product sense coaching and the operator…

diegosouzapw/awesome-omni-skills · 81 tokens

zipai-optimizer

Skill "zipai-optimizer" from nickdesi/ZipAI, covering zipai: ultra-dense token optimizer, rules, 1. zero filler, 2. ambiguity and 3. prompt caching.

nickdesi/ZipAI · 4 tokens

azure-ai-projects-py

Build AI applications using the Azure AI Projects Python SDK (azure-ai-projects). Use when working with Foundry project clients, creating versioned agents with PromptAgentDefinition, running evalua...

rootcastleco/rei-skills · 45 tokens

azure-ai-projects-ts

Build AI applications using Azure AI Projects SDK for JavaScript (@azure/ai-projects). Use when working with Foundry project clients, agents, connections, deployments, datasets, indexes, evaluation...

rootcastleco/rei-skills · 45 tokens

ai-product

Every product will be AI-powered. The question is whether you'll build it right or ship a demo that falls apart in production. This skill covers LLM integration patterns, RAG architecture, prompt ...

rootcastleco/rei-skills · 43 tokens