agentleFS
cyberspeziecyberspezie/Token-Saver/skills/token-saver/SKILL.md

token-saver

Skill0 starsChanged 7 days agoMITView on GitHub

Local Mac tools that do the heavy reading before Claude does - text in images (OCR), face detection, green screen / background removal and chroma key, Spotlight file search, one-frame-per-scene video contact sheets, and ffmpeg edits of photos, videos, gifs and audio (resize, convert, crop, web export, trim, gif, poster frame, speed, rotate, colour grade). Use whenever a task involves looking at images, screenshots or video, finding files on this Mac, cutting out a subject or replacing a background, or editing media assets.

22 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

5 rules. 0 are common, 1 is distinctive, and 4 are very specific to this project.

  • 0

    Common

    Most of the 18 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    When you edit a video or make any asset for the person (a cutout, a key, a gif, an edit, a render), keep the intermediates inside a job.

    line 27
  2. Very specific:

    Put every intermediate in $(tokprep job dir): tokprep's own outputs land there by themselves, and pass -o "$(tokprep job dir)" to your own …

    line 30
  3. Very specific:

    When they approve it as final: tokprep job deliver <file> [--to <folder>] [--name <final name>], then tokprep job done.

    line 32
  4. Very specific:

    If they want changes, keep iterating in the same job.

    line 33
  5. Very specific:

    Cutouts: check the coverage numbers.

    line 39

“Common” is measured: kept by at least 6 in 10 of the 18 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

token-saver: tokprep

The exact command for this machine is in your system prompt ("Local media/file prep on this machine: …"). On macOS that is the tokprep script, also linked at ~/.local/bin/tokprep; on Windows it is python "<plugin>\bin\tokprep".

Each command uses the Apple tool on macOS (Vision, Spotlight, sips, PDFKit). Elsewhere it uses the Windows alternative when the machine has one: Windows OCR and face detection (built in), Windows Search or Everything (es.exe), rembg for cutouts, pdftotext, and ffmpeg for sheets. If a command answers NOT AVAILABLE on this machine, do the task directly, as you would without tokprep: read the image or PDF yourself, use your own search. The hooks let a second Read of the same file through. Each command does the work on the Mac and prints a short result, or writes summary.md plus at most two labelled sheets. Read the summary first. Open a sheet only when the summary can't answer the question, and open a raw file only when the sheet can't either.

NeedCommand
Words in a screenshot, photo or scan`tokprep ocr <imgfolder> [--fast]`
Faces: how many, where, how sharp`tokprep faces <imgfolder>`: boxes in pixels, quality 0–1, one sheet of crops
Overview of photos or videos`tokprep media <filesfolder>`: size, text, faces, people, scenes, transcript (macOS 26+, Apple SpeechAnalyzer)
What happens in a videotokprep scenes <video> [--threshold 0.3] [--max 24] [--min 1.0]: cut list, shot lengths, one frame per scene
Cut a subject out / green screen`tokprep cutout <imgvideofolder> --bg transparentgreenblue#hexbg.jpg [--mode autosubjectperson] -o <dir>`
Remove an existing green/blue screen`tokprep key <imgvideo> [--color auto] [--similarity 0.12] [--bg transparentbg.jpg] -o <dir>`
Find files on this Mac`tokprep find <words> [--kind imagevideopdfdocslidessheetcodeaudiofolder3d] [--days N] [--name] [--in dir]`
Edit photos, videos, gifs, audio`tokprep asset <op> <filesfolder> [options] -o <dir> [--preview]; run tokprep asset` alone to list ops
Check a web page's layout`tokprep web <urlfile.html#anchor> [--widths 1440,390] [--select CSS]`
A long filetokprep file <path>, then tokprep peek <file> <a> <b> / tokprep grep <re> <file>

Making an asset: always inside a job

When you edit a video or make any asset for the person (a cutout, a key, a gif, an edit, a render), keep the intermediates inside a job. That way they disappear once the final is approved.

  1. tokprep job start "<what you are making>" --dest "<folder the person wants the final in>"
  2. Put every intermediate in $(tokprep job dir): tokprep's own outputs land there by themselves, and pass -o "$(tokprep job dir)" to your own ffmpeg/sips/python commands. Anything temporary you had to write elsewhere, register with tokprep job track <path>.
  3. Show the person the candidate and ask whether it is the final version.
  4. When they approve it as final: tokprep job deliver <file> [--to <folder>] [--name <final name>], then tokprep job done. Tell them where the final is and how much space was freed. The mod compacts the conversation after that turn, so the job's iterations stop taking up context.
  5. If they want changes, keep iterating in the same job. If they drop the asset entirely, use tokprep job abandon.

tokprep job done refuses to run before a final is delivered, never deletes a delivered final, and only deletes things the job made: its work folder, plus tracked files newer than the job and outside top-level or destination folders. Use --dry-run to see the list first. tokprep clean --days 7 removes old prep summaries and sheets made outside jobs.

Rules:

  • Outputs: final assets go wherever the person says (job deliver --to); never put intermediates in their folders. tokprep never overwrites a file; it adds -1, -2 to the name.
  • Cutouts: check the coverage numbers. 0% means no subject was found; above 80% means the background was kept. Look at the before/after sheet only if those look wrong. --mode person is for people only; subject also catches objects and dark silhouettes.
  • Chroma key: a green halo means raise --similarity (0.15–0.2); holes in the subject mean lower it (0.08).
  • Formats: transparent video comes out as ProRes 4444 .mov. WebP is not available in this ffmpeg build: use AVIF or JPG.

Code: graphify first

For questions about a codebase, use graphify, not tokprep. When graphify-out/graph.json exists, run graphify query "<question>" before grepping or reading source, graphify path "<A>" "<B>" for relationships, graphify explain "<concept>" for one concept, and graphify update . after code edits. No graph yet: suggest /graphify . once. If graphify is not found, run tokprep graphify setup (the plugin does this once, after it is installed).

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.