knowledge-base-cache

knowledge-base-cache is a skill for Claude Code, Codex from Dqz00116/skill-lib. It costs 23 tokens per session (2,395 once invoked), scanned A, original, MIT.

A layered cache for large knowledge bases, storing frequently used information in faster or more readily available tiers and assembling relevant context for an agent. It is intended for knowledge that may not fit in one context window.

In plain words
What is it for?
Use it to organize large knowledge repositories, cache frequently requested answers, retrieve information semantically, and assemble results within a token budget. It is meant for ongoing or large-scale knowledge access rather than small one-off collections.
Why use it?
Repeatedly retrieving and rebuilding the same information can increase API use and exceed the amount of text an agent can handle at once. Tiered storage and context assembly reduce that repeated work for recurring queries.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is python scripts/init_knowledge_base.py.

Good fit Use it to organize large knowledge repositories, cache frequently requested answers, retrieve information semantically, and assemble results within a token budget. It is meant for ongoing or large-scale knowledge access rather than small one-off collections.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/Dqz00116/skill-lib
agentmods
npx agentmods add skills/dqz00116/skill-lib/knowledge-base-cache

Made for: Claude Code, Codex.

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 knowledge-base-cache

README.md
[![agentmods](https://agentmods.dev/badge/skills/dqz00116/skill-lib/knowledge-base-cache/github.svg)](https://agentmods.dev/skills/dqz00116/skill-lib/knowledge-base-cache)
Your own site
<a href="https://agentmods.dev/skills/dqz00116/skill-lib/knowledge-base-cache"><img src="https://agentmods.dev/badge/skills/dqz00116/skill-lib/knowledge-base-cache/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 knowledge-base-cache

Your own site · 80×15
<a href="https://agentmods.dev/skills/dqz00116/skill-lib/knowledge-base-cache"><img src="https://agentmods.dev/badge/skills/dqz00116/skill-lib/knowledge-base-cache.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 23 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,395 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.00023 $0.02395
Opus 5.5 $0.00009 $0.00958
Sonnet 5.5 $0.00005 $0.00479
Haiku 4.5 $0.00002 $0.00239

Measured 1mo ago against content hash b518923cb488, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

knowledge-base-cache 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 1mo 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.

knowledge-base-cache/SKILL.md · 375 lines

How it starts

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

Knowledge Base Cache Skill

Overview

A layered knowledge base system with hot/cold/warm cache tiers and intelligent Working Memory for context management. Reduces API costs through multi-tier caching while supporting unlimited knowledge scale.

When to Use

Use this skill when:

  • Managing large knowledge bases that exceed context window limits
  • Reducing API costs for frequent knowledge queries
  • Implementing multi-tier caching (hot/cold/warm) for knowledge retrieval
  • Needing intelligent context assembly with token budget management
  • Requiring automatic caching with semantic retrieval capabilities

Do NOT use when:

  • Simple, small knowledge bases that fit in a single context window
  • One-off queries where caching overhead exceeds savings
  • Only basic file storage without caching tiers is needed

Create a structured knowledge repository with layered architecture (hot/cold/warm) and intelligent context management.

Architecture Overview

┌─────────────────────────────────────────────────────────────┐
│                  Application Layer                  │
│                    Agent Core                               │
└──────────────────────────┬──────────────────────────────────┘
                           │
┌──────────────────────────▼──────────────────────────────────┐
│              Working Memory Layer                      │
│  • Context Assembly        • Token Budget Management        │
│  • Multi-Source Coordination • LRU Cache                    │
└─────────────┬───────────────────────────────────────────────┘
              │ Standard Interface KnowledgeSource
    ┌─────────┼─────────┐
    ▼         ▼         ▼ (Reserved)
┌───────┐ ┌───────┐ ┌───────┐
│  Hot  │ │  Cold │ │ Warm  │
│ Cache │ │Storage│ │Vector │
│ Layer │ │ Layer │ │ Layer │
└───┬───┘ └───┬───┘ └───┬───┘
    │         │         │
Context   Repository  Vector DB
 Cache     Files     (Future)

Three-Tier Architecture

Tier Technology Use Case Status
🔥 Hot Context Cache (API) Full document retrieval, 90% cost savings ✅ Available
❄️ Cold Repository Files Keyword search, browsing, discovery ✅ Available
🌡️ Warm Vector DB Semantic search, precise Q&A 🔮 Planned

Read the full file on GitHub · 375 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. 1mo ago First seen · 375 lines · 23 tokens per session scan A b518923cb488

Subscribe to this mod's changes

knowledge-base-cache is a skill published in the GitHub repository Dqz00116/skill-lib (22 stars, last pushed 4mo ago), licensed MIT. It adds 23 tokens to every session and 2,395 once invoked, about $0.0001 per session on Opus 5.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-30.

Related

Other skills, from other repositories

rag-architecture

Build retrieval-augmented generation systems that ground LLMs in your data.

fabioc-aloha/Alex_Skill_Mall · 20 tokens

memory-systems

This skill should be used for persistent semantic memory in agent systems: cross-session knowledge retention, entity tracking, temporal validity, graph or vector retrieval, memory consolidation, and memory benchmark selection. Route file-backed scratchpads to filesystem-context, handoff summaries to…

fabioc-aloha/Alex_Skill_Mall · 68 tokens

graphify

Use for any question about a codebase, its architecture, file relationships, or project content — especially when graphify-out/ exists, where the question should be treated as a graphify query first. Turns any input (code, docs, papers, images, videos) into a persistent knowledge graph with god nodes, community…

Graphify-Labs/graphify · 76 tokens

llm-wiki

Explain and apply the foundational LLM Wiki architecture and knowledge-management strategy. Use for setup, architecture, schema, or organization decisions; operational ingest/query/lint work uses dedicated skills.

Ar9av/obsidian-wiki · 41 tokens

llmwiki

Build and use a persistent, citation-traceable knowledge wiki from documents, research papers, notes, or project documentation. Use for llmwiki projects, retrieving reusable evidence for an agent task, or compiling a corpus for repeated questions. A one-off file read or live web search does not need a wiki.

atomicstrata/llm-wiki-compiler · 66 tokens

wegent-knowledge

Knowledge base management and search tools for Wegent. Provides capabilities to list, create, update, and search knowledge bases and documents using RAG retrieval. Use this skill when the user wants to manage knowledge bases, documents, or search for information programmatically.

wecode-ai/Wegent · 51 tokens