/major-ai-skills:cached-system-instructionsfrom major-ai-skills
Structures system instructions into a 4-layer hierarchy to maximize prompt-cache hit rates, reducing TTFT latency by 80% and costs by 90% in multi-turn LLM sessions.
Ships in major-ai-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
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.
┌─────────────────────────────────────────────────────────────┐
│ 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) │
└─────────────────────────────────────────────────────────────┘
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 │
└───────────────────────────────────────────────────────────────────────────┘
To activate prompt caching in Anthropic Claude 3.5 Sonnet / Haiku, place cache_control breakpoints at the end of large static blocks (minimum threshold: 1,024 tokens on Sonnet, 2,048 tokens on Haiku):
import anthropic
client = anthropic.Anthropic()
SYSTEM_PROMPT = """
You are Antigravity, an elite autonomous software engineering agent.
... [3,500 tokens of static rules, AST guidelines, and tool schemas] ...
"""
def query_agent_with_caching(user_query: str, history: list) -> str:
response = client.messages.create(
model="claude-3-5-sonnet-20241022",
max_tokens=2048,
system=[
{
"type": "text",
"text": SYSTEM_PROMPT,
# Set cache breakpoint on the static system prompt
"cache_control": {"type": "ephemeral"}
}
],
messages=[
*history,
{"role": "user", "content": user_query}
]
)
# Inspect cache performance
usage = response.usage
print(f"Cache Created: {getattr(usage, 'cache_creation_input_tokens', 0)}")
print(f"Cache Read (90% discount): {getattr(usage, 'cache_read_input_tokens', 0)}")
return response.content[0].text
"Current Time: 2026-08-22T17:52:00" change every second and bust the entire prefix cache. Pass current time in the User turn.json.dumps(obj, sort_keys=True)) to maintain bit-for-bit string equality.Evaluation across a 30-turn autonomous feature build (4,000-token system prompt):
| Metric | Uncached Baseline | Cached Prefix Architecture | Improvement |
|---|---|---|---|
| Time-to-First-Token (TTFT) | 3.10 seconds | 0.38 seconds | 8.1x Faster Velocity |
| System Prompt Ingestion Cost | $0.36 | $0.036 | 90% Cost Reduction |
| Total Session Turnaround | 185 seconds | 48 seconds | 3.8x Total Speedup |
MANDATORY: All system prompts exceeding 1,000 tokens must be structured as immutable, deterministic headers with prompt-cache control breakpoints enabled. Never inject dynamic runtime variables into the top-level system prefix.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub alivirgo/major-ai-skills --plugin major-ai-skills2 plugins in one repository ship this exact skill · first indexed Sep 11, 2026
412 skills in this plugin
/3d-slicerAutomate 3D Slicer research workflows with MRML, VTK/ITK, DICOM data, and Segment Editor. Use for software workflows, not clinical interpretation./abbreviated-git-statusInspect Git branch, staging, and working-tree changes with short or porcelain status output when a compact repository check is needed./ableton-liveAutomate Ableton Live sessions with Python MIDI Remote Scripts, Max for Live, AbletonOSC, and Link synchronization.Other plugins' skills for the same job
/act-as-a-personal-tutorExplain a subject step by step, assess prior knowledge, and use short exercises to check understanding before advancing.