effect-context-witness

effect-context-witness is a skill for Claude Code, Codex from mpsuesser/pi-effect-harness. It costs 22 tokens per session (1,647 once invoked), scanned A, original, MIT.

A design guide for choosing between two Effect dependency-injection patterns: one that marks a required value and one that provides behavior.

In plain words
What is it for?
Use it when designing Context.Service dependencies and deciding whether information belongs in a data schema or should be supplied separately through application context.
Why use it?
It helps reduce unnecessary coupling between a domain model and extra runtime information. This can make schemas easier to change without forcing every value to include unrelated fields.

Skill for Claude CodeCodex

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

Good fit Use it when designing Context.Service dependencies and deciding whether information belongs in a data schema or should be supplied separately through application context.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/mpsuesser/pi-effect-harness/effect-context-witness
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-context-witness
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-context-witness

README.md
[![agentmods](https://agentmods.dev/badge/skills/mpsuesser/pi-effect-harness/effect-context-witness/github.svg)](https://agentmods.dev/skills/mpsuesser/pi-effect-harness/effect-context-witness)
Your own site
<a href="https://agentmods.dev/skills/mpsuesser/pi-effect-harness/effect-context-witness"><img src="https://agentmods.dev/badge/skills/mpsuesser/pi-effect-harness/effect-context-witness/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-context-witness

Your own site · 80×15
<a href="https://agentmods.dev/skills/mpsuesser/pi-effect-harness/effect-context-witness"><img src="https://agentmods.dev/badge/skills/mpsuesser/pi-effect-harness/effect-context-witness.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 22 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,647 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.00022 $0.01647
Opus 5 $0.00011 $0.00823
Sonnet 5 $0.00004 $0.00329
Haiku 4.5 $0.00002 $0.00165

Measured 11d ago against content hash a81c6c252289, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

effect-context-witness 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 11d 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-context-witness/SKILL.md · 275 lines

How it starts

The opening of the file, as written. The whole thing — 275 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Context Witness Pattern

Choose between witness (existence) and capability (behavior) patterns for Context.Service definitions.

Coupling: Hard vs Soft

Some coupling is necessary and good - but move it from hard to soft coupling.

Hard Coupling (Schema)

Field exists in the schema - tightly coupled to domain model:

import { Schema } from 'effect';

// ❌ HARD COUPLING - Serial is part of the schema
export const PaymentIntent = Schema.Struct({
	id: Schema.String,
	serial: Schema.String, // In schema = hard coupled
	amount: Schema.BigInt
});

// Every PaymentIntent MUST have a serial
// Serialization/validation requires serial
// Cannot create without providing serial
// Schema change needed to remove/change serial

Soft Coupling (Witness)

Field removed from schema, only injected in code:

import { Schema, Context, Effect, Logger } from 'effect';

declare const generateId: () => string;

// ✅ SOFT COUPLING - Serial not in schema
export const PaymentIntent = Schema.Struct({
	id: Schema.String,
	amount: Schema.BigInt
	// No serial field!
});

// Serial is a witness - required but injected via Context
class Serial extends Context.Service<Serial, string>()('Serial') {}

const createPaymentIntent = (amount: bigint) =>
	Effect.gen(function* () {
		const serial = yield* Serial; // Injected from context

		// Use serial in business logic, logging, etc.
		// but it's not part of the persisted data
		yield* Logger.info(`Creating payment intent ${serial}`);

		return PaymentIntent.make({ id: generateId(), amount });
	});

// Type: Effect<PaymentIntent, never, Serial>

Key insight: schema (hard coupling) => witness (soft coupling)

By removing the field from the schema and injecting it only where needed, you:

  • Keep domain models minimal
  • Avoid unnecessary persistence
  • Easy to test (provide test serial)
  • Easy to remove/change (just change injection)
  • Explicit dependencies in type signature

When to use witnesses:

Read the full file on GitHub · 275 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. 11d ago First seen · 275 lines · 22 tokens per session scan A a81c6c252289

Subscribe to this mod's changes

effect-context-witness is a skill published in the GitHub repository mpsuesser/pi-effect-harness (24 stars, last pushed 3mo ago), licensed MIT. It adds 22 tokens to every session and 1,647 once invoked, about $0.0001 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.