effect-batching

effect-batching is a skill for Claude Code, Codex from mpsuesser/pi-effect-harness. It costs 52 tokens per session (3,841 once invoked), scanned A, original, MIT.

A TypeScript workflow for grouping identical or concurrent data requests into fewer calls using Effect’s request and SQL resolver APIs.

In plain words
What is it for?
Use it to build batched data-fetching layers, combine database lookups, and deduplicate repeated requests.
Why use it?
It removes the N+1 query problem, where loading many items causes one database request per item. Your application can keep using single-item lookups while requests made together are resolved as a batch.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to build batched data-fetching layers, combine database lookups, and deduplicate repeated requests.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/mpsuesser/pi-effect-harness/effect-batching
Install

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.

Any agent
npx skills add mpsuesser/pi-effect-harness --skill effect-batching
Clone the repo
git clone --depth 1 https://github.com/mpsuesser/pi-effect-harness

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for effect-batching

README.md
[![agentmods](https://agentmods.dev/badge/skills/mpsuesser/pi-effect-harness/effect-batching/github.svg)](https://agentmods.dev/skills/mpsuesser/pi-effect-harness/effect-batching)
Your own site
<a href="https://agentmods.dev/skills/mpsuesser/pi-effect-harness/effect-batching"><img src="https://agentmods.dev/badge/skills/mpsuesser/pi-effect-harness/effect-batching/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for effect-batching

Your own site · 80×15
<a href="https://agentmods.dev/skills/mpsuesser/pi-effect-harness/effect-batching"><img src="https://agentmods.dev/badge/skills/mpsuesser/pi-effect-harness/effect-batching.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 52 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,841 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00052 $0.03841
Opus 5.5 $0.00021 $0.01536
Sonnet 5.5 $0.00010 $0.00768
Haiku 4.5 $0.00005 $0.00384

Measured 1mo ago against content hash 825a4b9f23dc, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

effect-batching 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 1mo 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.

harnesses/effect/skills/effect-batching/SKILL.md · 597 lines

How it starts

The opening of the file, as written. The whole thing — 597 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 request batching, deduplication, and efficient data-fetching patterns.

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:

  • Request and Request.Class definitions (packages/effect/src/Request.ts)
  • RequestResolver constructors and combinators (packages/effect/src/RequestResolver.ts)
  • SqlResolver for SQL-specific batching (packages/effect/src/unstable/sql/SqlResolver.ts)
  • Batching tutorial (ai-docs/src/05_batching/10_request-resolver.ts)

The N+1 Problem

Naive data fetching executes one query per item. Fetching 100 users by ID produces 100 separate queries. Effect's batching system solves this automatically: individual Effect.request calls made concurrently within a batch window are collected and resolved together in a single batch.

The key insight: calling code writes single-item lookups, but the runtime collects them and hands the resolver an array. No manual batching logic leaks into business code.

Request Definition

A Request<Success, Error, Services> describes a single lookup. Define requests using Request.Class:

import { Effect, Exit, Request, RequestResolver, Schema } from 'effect';

// Domain types
class User extends Schema.Class<User>('User')({
	id: Schema.Number,
	name: Schema.String,
	email: Schema.String
}) {}

class UserNotFound extends Schema.TaggedErrorClass<UserNotFound>()(
	'UserNotFound',
	{
		id: Schema.Number
	}
) {}

// Request definition using Request.Class
// Type params: { payload fields }, Success, Error, Services
class GetUserById extends Request.Class<
	{ readonly id: number },
	User,
	UserNotFound,
	never
> {}

Alternative: Interface + tagged constructor

For simpler cases or when you don't need a class:

interface GetUserById extends Request.Request<User, UserNotFound> {
	readonly _tag: 'GetUserById';
	readonly id: number;
}
const GetUserById = Request.tagged<GetUserById>('GetUserById');

// Usage:
const req = GetUserById({ id: 42 });

Read the full file on GitHub · 597 lines

Changes

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.

  1. 1mo ago First seen · 597 lines · 52 tokens per session scan A 825a4b9f23dc

Subscribe to this mod's changes

effect-batching is a skill published in the GitHub repository mpsuesser/pi-effect-harness (25 stars, last pushed 4mo ago), licensed MIT. It adds 52 tokens to every session and 3,841 once invoked, about $0.0002 per session on Opus 5.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.

Related

Other skills, from other repositories

event-driven

Event-driven architecture authority — Redis pub/sub, event bus patterns, async event pipelines, channel management, startup recovery, dead-letter handling, and reactive system design.

LuuOW/meridian-mcp · 34 tokens

using-redis-token-buckets

Use when adding a bucket-like rate limit backed by Redis: a per-caller budget with burst capacity and continuous refill, a refund path for requests that did no work, or a limit whose Retry-After must be a real wait rather than a window edge. posthog/tokenbucket.py provides an atomic Lua token bucket (consume, refund…

PostHog/posthog-foss · 148 tokens

spring-data-redis

Use when implementing caching, session storage, rate limiting, or any Redis integration. Covers cache-aside pattern, key naming, TTL strategy, and serialization config.

rrezartprebreza/spring-boot-skills · 37 tokens

using-redis-token-buckets

Use when adding a bucket-like rate limit backed by Redis: a per-caller budget with burst capacity and continuous refill, a refund path for requests that did no work, or a limit whose Retry-After must be a real wait rather than a window edge. posthog/tokenbucket.py provides an atomic Lua token bucket (consume, refund…

PostHog/posthog · 148 tokens

bull-mq

Runs background jobs in Node.js with BullMQ, a job queue library backed by Redis (or PostgreSQL since v6): delayed and prioritized jobs, retries with backoff, rate limiting, cron-style job schedulers, parent-child flows and concurrency control. Use when a user asks to add a background worker, queue emails or webhooks…

TerminalSkills/skills · 100 tokens

cache-strategy

Design and implement caching layers for APIs and web applications using Redis or Memcached. Use when you need to reduce database load, improve response times, or handle traffic spikes. Covers cache-aside, write-through, and write-behind patterns, TTL strategies, cache invalidation, and stampede prevention. Trigger…

TerminalSkills/skills · 88 tokens