with one click
cache-codebase
Caches a codebase to reduce token usage
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
Caches a codebase to reduce token usage
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
Universal coding standards, best practices, and patterns for TypeScript, JavaScript, React, and Node.js development.
Instinct-based learning system that observes sessions via hooks, creates atomic instincts with confidence scoring, and evolves them into skills/commands/agents. v2.1 adds project-scoped instincts to prevent cross-project contamination.
Use when generating or regenerating Drizzle migration files, changing database schema tables or columns, resolving migration sequence conflicts after rebase, reviewing migration SQL for idempotent patterns, or renaming migration files.
Drizzle ORM schema and database guide. Use when working with database schemas (src/database/schemas/*), defining tables, creating migrations, or database model code. Triggers on Drizzle schema definition, database migrations, or ORM usage questions.
Frontend development patterns for React, Next.js, state management, performance optimization, and UI best practices.
Modal imperative API guide. Use when creating modal dialogs using createModal from @lobehub/ui. Triggers on modal component implementation or dialog creation tasks.
| name | cache-codebase |
| description | Caches a codebase to reduce token usage |
Reduce token usage by reading off a minimized version of a given codebase.
This is to be used for browsing the codebase. When a file needs to be modified, do not read the cache. Read the file directly instead. When a file is updated, the cache should be updated (if necessary).
The cache should be stored on disk in the codebase itself as an exact replica of the codebase, stored in the folder .cached-codebase in the root directory. Every relevant file (see next) in the codebase should be cached as a markdown file with a short description, which is described further in this document.
DO NOT cache files and files in folders such as:
node_modules/.gitignoreThe .cached-codebase folder may be in .gitignore - this is ok.
Given the following codebase:
.
├── ui.js
└── lib/
├── formatter.js
└── renderer.ts
The codebase should look like this after being cached:
.
├── ui.js
├── lib/
│ ├── formatter.js
│ └── renderer.ts
└── .cached-codebase/
├── ui.md
└── lib/
├── formatter.md
└── renderer.md
This is the template that should be used for caching a file.
---
last-cached: Mon Apr 13 10:50:58 EDT 2026
description: A one sentence summary of the file. Include the purpose of the file and what it does.
quirks: Weird things about this file - functionality that isn't standard, anything that would affect development if it wasn't mentioned. Keep this to a maximum of two sentences
linked-to: Does this file use any special or weird imports? Is it used in any odd files?
---
last-cached: should be retrieved with the date command.description: a general description of the file. If this file is a standard file, denote it as such (ex. actions.ts or page.tsx). Include any notable/exported functionsquirks: weird things about this file that weren't included in the descriptionlinked-to: weird imports that the file uses, and weird exports that the file has. For example, ShadCN, Lucide, and imports from lib do not count as weird imports. Imports such as dnd-kit or other not-widely used imports do count as weird imports.When a file needs to be read, first check the cache. Interpret the markdown file, then modify the file if needed.
The entire goal of this cache is to minimize the amount of tokens that need to spent reading unnecessary files.
If you need to understand a certain part of the code, you may read the real file.
Avoid the cache when:
Use the cache when:
Updating the cache should look like this: