otp-thinking

otp-thinking is a skill for Claude Code, Codex from georgeguimaraes/claude-code-elixir. It costs 94 tokens per session (1,206 once invoked), scanned A, original, Apache-2.0.

A set of guidance for designing OTP systems, Elixir's framework for processes, supervision, and concurrency. It focuses on GenServers, supervisors, tasks, registries, and ETS tables, which provide shared in-memory data.

In plain words
What is it for?
Use it when adding background processing, caching, concurrent requests, shared state, queues, or when diagnosing slow GenServers.
Why use it?
It helps avoid using a GenServer for stateless work or creating a single-process bottleneck. It also explains safer ways to supervise asynchronous tasks and handle serialized access.

Skill for Claude CodeCodex

Part of the elixir plugin — 6 skills, 1 hook shipped together

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/georgeguimaraes/claude-code-elixir/otp-thinking
Any agent
npx skills add georgeguimaraes/claude-code-elixir --skill otp-thinking
Clone the repo
git clone --depth 1 https://github.com/georgeguimaraes/claude-code-elixir

Made for: Claude Code, Codex.

Or install elixir, the plugin that ships this one along with the rest of its 6 skills, 1 hook.

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 otp-thinking

README.md
[![agentmods](https://agentmods.dev/badge/skills/georgeguimaraes/claude-code-elixir/otp-thinking.svg)](https://agentmods.dev/skills/georgeguimaraes/claude-code-elixir/otp-thinking)
Your own site
<a href="https://agentmods.dev/skills/georgeguimaraes/claude-code-elixir/otp-thinking"><img src="https://agentmods.dev/badge/skills/georgeguimaraes/claude-code-elixir/otp-thinking.svg" alt="Measured on agentmods" height="20"></a>
Per session 94 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,206 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.1 $0.00094 $0.01206
Opus 5 $0.00047 $0.00603
Sonnet 5 $0.00019 $0.00241
Haiku 4.5 $0.00009 $0.00121

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

Security

Grade A, and why

otp-thinking 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 6d 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.

plugins/elixir/skills/otp-thinking/SKILL.md · 150 lines

How it starts

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

OTP Thinking

Paradigm shifts for OTP design. These insights challenge typical concurrency and state management patterns.

The Iron Law

GENSERVER IS A BOTTLENECK BY DESIGN

A GenServer processes ONE message at a time. Before creating one, ask:

  1. Do I actually need serialized access?
  2. Will this become a throughput bottleneck?
  3. Can reads bypass the GenServer via ETS?

The ETS pattern: GenServer owns ETS table, writes serialize through GenServer, reads bypass it entirely with :read_concurrency.

No exceptions: Don't wrap stateless functions in GenServer. Don't create GenServer "for organization".

GenServer Patterns

Function Use For
call/3 Synchronous requests expecting replies
cast/2 Fire-and-forget messages

When in doubt, use call to ensure back-pressure. Set appropriate timeouts for call/3.

Use handle_continue/2 for post-init work—keeps init/1 fast and non-blocking.

Task.Supervisor, Not Task.async

Task.async spawns a linked process—if task crashes, caller crashes too.

Pattern On task crash
Task.async/1 Caller crashes (linked, unsupervised)
Task.Supervisor.async/2 Caller crashes (linked, supervised)
Task.Supervisor.async_nolink/2 Caller survives, can handle error

Use Task.Supervisor for: Production code, graceful shutdown, observability, async_nolink. Use Task.async for: Quick experiments, scripts, when crash-together is acceptable.

DynamicSupervisor + Registry = Named Dynamic Processes

DynamicSupervisor only supports :one_for_one (dynamic children have no ordering). Use Registry for names—never create atoms dynamically:

defp via_tuple(id), do: {:via, Registry, {MyApp.Registry, id}}

PartitionSupervisor scales DynamicSupervisor for millions of children.

:pg for Distributed, Registry for Local

Tool Scope Use Case
Registry Single node Named dynamic processes
:pg Cluster-wide Process groups, pub/sub

Read the full file on GitHub · 150 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. 6d ago First seen · 150 lines · 94 tokens per session scan A 185e8cbcdf5b

Subscribe to this mod's changes

otp-thinking is a skill published in the GitHub repository georgeguimaraes/claude-code-elixir (168 stars, last pushed 4mo ago), licensed Apache-2.0. It adds 94 tokens to every session and 1,206 once invoked, about $0.0005 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.

Related

Other skills, from other repositories

elixir

Use when writing or refactoring Elixir/OTP on the BEAM — GenServers, supervision trees and restart strategies, pattern matching, mix projects and releases — or when processes misbehave (restart loops, mailbox growth, call timeouts). NOT a Phoenix web app, LiveView, Ecto or channels (that is phoenix).

ericrisco/rsc-harness · 72 tokens

elixir-expert

Expert-level Elixir, Phoenix, OTP, and concurrent systems. Use when the user mentions Phoenix, OTP, Erlang, concurrent, or functional, or when the task involves Elixir Fundamentals or Phoenix Framework.

personamanagmentlayer/pcl · 47 tokens

pixir-delegate

Use Pixir as a headless subagent runtime from Claude Code or any harness with skill ! preprocessing (Codex roots and other no-hydration hosts use pixir-delegate-codex instead) — one-shot workers (pixir --json), parallel fan-out to N children (pixir delegate --spec), resumable steering (pixir resume), evidence…

Ranvier-Technologies/pixir · 126 tokens

pixir-delegate-codex

Use when a Codex CLI/Desktop root should fan out subagents, delegate to Pixir workers, run parallel workers, or manage a resident delegation daemon via Pixir Delegate; covers Codex preflight, AGENTS.md, approvals/sandbox, dry-run, daemon start/status/attach/cancel, closure evidence, and audited single-run execution…

Ranvier-Technologies/pixir · 89 tokens

pixir-diagnostics

Diagnose Pixir and T3 Code Pixir incidents from local canonical evidence. Use when a Pixir run, ACP/T3 thread, subagent/workflow, provider replay, or daily-driver dogfood session appears stuck, inconsistent, missing tool output, or hard to classify.

Ranvier-Technologies/pixir · 61 tokens

phoenix

Use when building an Elixir web app with Phoenix — contexts, Ecto schemas, changesets and migrations, LiveView, channels and PubSub, the generators, and the boundary between domain logic and the web layer. Covers the classic LiveView over-rendering and Ecto N+1 traps. NOT pure OTP work with no web or Ecto layer …

ericrisco/rsc-harness · 89 tokens