otp-thinking

otp-thinking is a skill for Claude Code 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 Code

Written for Claude Code: shipped in a Claude Code plugin.

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

Good fit Use it when adding background processing, caching, concurrent requests, shared state, queues, or when diagnosing slow GenServers.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/georgeguimaraes/claude-code-elixir/otp-thinking
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 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.

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/github.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/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 otp-thinking

Your own site · 80×15
<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="Reviewed on agentmods" width="80" 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. 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.00094 $0.01206
Opus 5.5 $0.00038 $0.00482
Sonnet 5.5 $0.00019 $0.00241
Haiku 4.5 $0.00009 $0.00121

Measured 2mo ago against content hash 185e8cbcdf5b, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 2mo 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. 2mo 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 6mo ago), licensed Apache-2.0. It adds 94 tokens to every session and 1,206 once invoked, about $0.0004 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

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

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

koko

Develop and extend Koko — the Elixir/OTP agent living alongside joelclaw. Covers OTP patterns, Redis bridge protocol, shadow execution, and workload implementation.

joelhooks/joelclaw · 37 tokens

flow-next-impl-review

Carmack-level implementation review of changes via the configured backend. Use when asked to review code or a diff in a flow-next repo.

gmickel/flow-next · 34 tokens

flow-next-resolve-pr

Resolve PR review feedback. Fetches unresolved threads, triages, fixes, replies and resolves via GraphQL. Use when asked to address review comments.

gmickel/flow-next · 36 tokens

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