Optimizes expensive file processing by using SHA-256 content hashes for persistent, path-independent caching.
The Content Hash Cache Pattern is a specialized skill for Claude Code that implements a robust caching strategy for resource-intensive file operations like PDF parsing, OCR, and image analysis. By using SHA-256 content hashes as keys instead of file paths, it ensures that moved or renamed files still hit the cache while automatically invalidating entries when file content changes. This skill provides a clean service-layer architecture that separates caching logic from core processing functions, enabling better maintainability and performance in batch processing and CLI tools.
Key Features
011 GitHub stars
02Automatic cache invalidation upon file content modification
03SHA-256 content hashing for path-independent cache hits
04O(1) lookup using hash-based file storage (hash.json)
05Chunked file reading to handle large assets without memory spikes
06Service-layer abstraction for clean, single-responsibility code
Use Cases
01Optimizing batch processing tasks where files are frequently moved or renamed
02Building high-performance PDF or image processing pipelines
03Adding --cache/--no-cache functionality to data extraction CLI tools