Skip to content

Content-Hash File Cache

Teaches an agent to cache costly file processing results keyed by SHA-256 content hash.

Repository
affaan-m/ECC
Stars
295,127
Licence
MIT
Files
1 file

What it does

This skill gives the agent a ready-made design pattern for speeding up programs that repeatedly process the same files, such as PDF parsing, text extraction or image analysis. Instead of identifying a file by its name or location, the cached result is keyed by a fingerprint of the file's contents, so a renamed or moved file still hits the cache and an edited file is automatically reprocessed. When asked to add caching, the agent writes Python code that follows the pattern: hashing, storing each result as a JSON file, and keeping the processing logic separate from the caching layer.

Great for

  • Python developers building document or file processing pipelines that run over the same inputs many times
  • Developers who want to add a --cache/--no-cache option to an existing command-line tool without rewriting its processing functions

Skip it if

  • Data that must always be fresh, such as real-time feeds, because cached results can be stale by design
  • Results that depend on settings beyond the file itself (different extraction configurations would collide under the same cache key), so the skill's own guidance says not to use it there

Try asking

  • “Add a content-hash cache to my PDF text extraction script with a --cache/--no-cache flag”
  • “Wrap my existing image analysis function with a caching layer without changing the function itself”
  • “Show me how to hash large files in chunks and store results as JSON keyed by hash”
Step-by-step guide: how to use Content-Hash File CacheInstall, first run, examples, tips and FAQs

Install in 3 steps

  1. 1

    Download the skill

    The ZIP contains the 1 original files, the MIT licence and an attribution note.

    content-hash-cache-pattern.zip
  2. 2

    Add it to your agent

    Claude Code (all projects)

    mkdir -p ~/.claude/skills && unzip content-hash-cache-pattern.zip -d ~/.claude/skills/

    Claude Code / Agent SDK (this project only)

    mkdir -p .claude/skills && unzip content-hash-cache-pattern.zip -d .claude/skills/

    Claude apps (web/desktop): Settings → Capabilities → Skills → Upload skill, and choose the ZIP.

  3. 3

    Ask for the task

    No special command needed — the agent reads the skill's description and loads it when your request matches. Try one of the prompts above.

Get better results

  • State your extraction settings in the cache design, or include them in the hash, so different configurations do not return each other's results
  • Review the generated cache directory location and add it to .gitignore if results should not be committed
  • Ask the agent to adapt the example serialization to your actual result types, since the skill's code references types like ExtractedDocument that you must define

What's inside

  • SKILL.md

Redistributed unmodified from affaan-m/ECC under the MIT licence. The assessment was drafted with AI from the skill's files on 2026-10-29. Skills can instruct your agent to run code — read SKILL.md and any scripts before installing.