Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/mpsuesser/pi-effect-harness/effect-cachenpx skills add mpsuesser/pi-effect-harness --skill effect-cachegit clone --depth 1 https://github.com/mpsuesser/pi-effect-harnessWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/mpsuesser/pi-effect-harness/effect-cache)<a href="https://agentmods.dev/skills/mpsuesser/pi-effect-harness/effect-cache"><img src="https://agentmods.dev/badge/skills/mpsuesser/pi-effect-harness/effect-cache.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00089 | $0.06821 |
| Opus 5 | $0.00044 | $0.03410 |
| Sonnet 5 | $0.00018 | $0.01364 |
| Haiku 4.5 | $0.00009 | $0.00682 |
Grade A, and why
effect-cache scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 562 lines — stays where its author put it; the contents beside it link to each section on GitHub.
You are an Effect TypeScript expert specializing in in-memory caching with Cache and ScopedCache.
Effect Source Reference
The Effect v4 source is available at ~/.cache/effect-v4/.
Browse and read files there directly to look up APIs, types, and implementations.
Reference this for:
Cachemodel,make/makeWith, and all combinators (packages/effect/src/Cache.ts)ScopedCache— the variant whose entries own aScope(packages/effect/src/ScopedCache.ts)- Precise behavioral semantics: LRU order, TTL, failure caching (
packages/effect/test/Cache.test.ts) - Finalizer timing on eviction/expiry/invalidation/close (
packages/effect/test/ScopedCache.test.ts) - Single-value memoization
Effect.cached*(packages/effect/src/Effect.ts, category "caching")
Core Model
A Cache<Key, A, E, R> is a mutable keyed store populated by an effectful lookup function. Cache.get returns the cached value on a hit and runs the lookup on a miss or expired entry. Both are exposed as module functions (Cache.get(cache, key)), not methods. Every function taking extra arguments is dual (Cache.get(cache, key) or cache.pipe(Cache.get(key))); the unary ones (size, keys, values, entries, invalidateAll) are piped bare: cache.pipe(Cache.size).
import { Cache, Duration, Effect, Exit, Option, ScopedCache } from 'effect';
import { TestClock } from 'effect/testing';
interface Cache<Key, A, E = never, R = never> {
readonly capacity: number;
readonly lookup: (key: Key) => Effect.Effect<A, E, R>;
readonly timeToLive: (exit: Exit.Exit<A, E>, key: Key) => Duration.Duration;
}
How to think about it:
- Entries store the lookup
Exit— successes and failures are cached. A failed lookup keeps failing from cache until the entry expires, is invalidated, or is refreshed. - Concurrent
gets of the same missing key share one lookup. The first caller runs the lookup on its own fiber; the rest await the sameDeferred. - Insertion-ordered map = LRU. Reads move the entry to the back; when capacity is exceeded the oldest entries are evicted.
- TTL is computed per entry from the lookup
Exitand the key, against the fiber'sClock—TestClockworks. Expiry is lazy: entries are removed when next touched. ScopedCacheis the same model where each entry additionally owns aScope: resources acquired during the lookup live exactly as long as the entry is cached.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 4d ago First seen · 562 lines · 89 tokens per session scan A 49dabd453c75
effect-cache is a skill published in the GitHub repository mpsuesser/pi-effect-harness (23 stars, last pushed 2mo ago), licensed MIT. It adds 89 tokens to every session and 6,821 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
effect-patterns-building-apis
Effect-TS patterns for Building Apis. Use when working with building apis in Effect-TS applications.
effect-patterns-concurrency
Effect-TS patterns for Concurrency. Use when working with concurrency in Effect-TS applications.
effect-patterns-building-data-pipelines
Effect-TS patterns for Building Data Pipelines. Use when working with building data pipelines in Effect-TS applications.
effect-patterns-error-management
Effect-TS patterns for Error Management. Use when working with error management in Effect-TS applications.
effect-patterns-making-http-requests
Effect-TS patterns for Making Http Requests. Use when working with making http requests in Effect-TS applications.
effect-patterns-observability
Effect-TS patterns for Observability. Use when working with observability in Effect-TS applications.