content-hash-cache-pattern

Cache file processing results using SHA-256 content hashes.

Updated Apr 13, 2026
One-click install
npx skills add https://github.com/sakamoto-family-smile/agent_monorepo --skill content-hash-cache-pattern-sakamoto-family-smile
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: content-hash-cache-pattern
Source: https://github.com/sakamoto-family-smile/agent_monorepo/tree/main/.claude/skills/ecc/content-hash-cache-pattern
Command: npx skills add https://github.com/sakamoto-family-smile/agent_monorepo --skill content-hash-cache-pattern-sakamoto-family-smile

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Cache file processing results based on content hash. This path-independent approach avoids issues from file renames or moves and auto-invalidates when content changes.

Core Features & Use Cases

  • Content-hash based cache key
  • Service-layer wrapper that separates caching from pure processing
  • Suitable for PDF parsing, text extraction, image analysis, and batch pipelines where file content identity matters

Quick Start

Run the content-hash cache workflow by feeding a file path into the cache-enabled extractor to obtain cached results when available.

Frequently Asked Questions about content-hash-cache-pattern

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How does content-hash caching for file processing work?

Content-hash caching uses a SHA-256 key generated from file content to store processing results as JSON entries. It retrieves cached outputs by matching content identity rather than file paths, automatically invalidating when file content changes.

Why should I cache PDF parsing results using a content hash instead of the file path?

Caching PDF parsing results by content hash avoids issues from file renames or moves and auto-invalidates when content changes. This path-independent approach ensures reliable file reuse across batch pipelines where the file path might shift.

What's the best way to cache text extraction and image analysis results in a batch pipeline?

The best way to cache text extraction and image analysis results is using a service-layer wrapper that separates caching logic from pure processing functions. This keeps processing pure while storing results by content hash.

Can I use a content-hash cache for data processing if my files are frequently renamed or moved?

Yes, content-hash caching is designed for data processing where files are renamed or moved. It identifies files by SHA-256 content hash rather than file paths, ensuring cached results remain valid despite path changes.

Does content-hash caching require modifying my existing pure file processing functions?

No, content-hash caching provides a service-layer wrapper that separates caching concerns from processing logic. Your existing pure file processing functions remain unmodified while the wrapper handles cache retrieval and storage.