effect-managed-runtime

effect-managed-runtime is a skill for Claude Code, Codex from mpsuesser/pi-effect-harness. It costs 63 tokens per session (2,827 once invoked), scanned A, original, MIT.

A guide for running Effect services inside web frameworks, serverless functions, and other programs that control their own process. Effect is a TypeScript library for organising programs and their dependencies.

In plain words
What is it for?
Use it when connecting Effect services to Hono, Express, Fastify, Koa, AWS Lambda, Cloudflare Workers, or tests through ManagedRuntime.
Why use it?
It solves the problem of using Effect code when Effect does not control the application’s main startup and shutdown cycle.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/mpsuesser/pi-effect-harness/effect-managed-runtime
Any agent
npx skills add mpsuesser/pi-effect-harness --skill effect-managed-runtime
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-managed-runtime

README.md
[![agentmods](https://agentmods.dev/badge/skills/mpsuesser/pi-effect-harness/effect-managed-runtime.svg)](https://agentmods.dev/skills/mpsuesser/pi-effect-harness/effect-managed-runtime)
Your own site
<a href="https://agentmods.dev/skills/mpsuesser/pi-effect-harness/effect-managed-runtime"><img src="https://agentmods.dev/badge/skills/mpsuesser/pi-effect-harness/effect-managed-runtime.svg" alt="Measured on agentmods" height="20"></a>
Per session 63 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,827 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
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 $0.00063 $0.02827
Opus 5 $0.00032 $0.01413
Sonnet 5 $0.00013 $0.00565
Haiku 4.5 $0.00006 $0.00283

Measured 5d ago against content hash df51296b8f30, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

effect-managed-runtime scanned grade A with 1 finding 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 5d 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

async fetch(request: Request): Promise<Response> {
harnesses/effect/skills/effect-managed-runtime/SKILL.md · 389 lines

How it starts

The opening of the file, as written. The whole thing — 389 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 integrating Effect services into external frameworks using ManagedRuntime.

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:

  • packages/effect/src/ManagedRuntime.ts — full API surface
  • ai-docs/src/03_integration/10_managed-runtime.ts — Hono integration example

When to Use ManagedRuntime

Use ManagedRuntime when Effect does not own the process lifecycle. This is the bridge pattern — your domain logic lives in Effect services and layers, but the outer framework (Hono, Express, Fastify, Koa, AWS Lambda, Cloudflare Workers, etc.) controls the HTTP server, routing, and process lifecycle.

Typical scenarios:

  • Web frameworks: Hono, Express, Fastify, Koa handlers that call Effect services
  • Serverless functions: AWS Lambda, Cloudflare Workers, Vercel Edge Functions
  • Embedded contexts: Running Effect inside a larger non-Effect application
  • Tests: Creating a runtime with test layers for integration testing

Do NOT use ManagedRuntime when:

  • Effect owns the entire process → use NodeRuntime.runMain / BunRuntime.runMain
  • You have a long-running Effect service that IS the application → use Layer.launch

Core API

Creating a ManagedRuntime

import { ManagedRuntime, Layer } from 'effect';

// ManagedRuntime.make takes a Layer and returns a ManagedRuntime
// The layer's requirements must be fully satisfied (no remaining R)
const runtime = ManagedRuntime.make(MyService.layer);

Signature:

ManagedRuntime.make<R, ER>(
  layer: Layer.Layer<R, ER, never>,
  options?: { readonly memoMap?: Layer.MemoMap | undefined }
): ManagedRuntime<R, ER>

The ManagedRuntime<R, ER> type parameters:

  • R — the services provided by the runtime (available to effects you run)
  • ER — errors that can occur during layer construction

Shared MemoMap

Read the full file on GitHub · 389 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. 5d ago First seen · 389 lines · 63 tokens per session scan A df51296b8f30

Subscribe to this mod's changes

effect-managed-runtime is a skill published in the GitHub repository mpsuesser/pi-effect-harness (24 stars, last pushed 2mo ago), licensed MIT. It adds 63 tokens to every session and 2,827 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.