narrow-bare-rescue

narrow-bare-rescue is a skill for Claude Code from oliver-kriska/claude-elixir-phoenix. It costs 40 tokens per session (1,436 once invoked), scanned A, original, MIT.

A guide for replacing catch-all Elixir error handling with rescues that name the specific exceptions they can handle.

In plain words
What is it for?
It helps audit rescue clauses and refactor them so expected failures are handled while unexpected errors reach tests and error reporting.
Why use it?
It keeps programming mistakes such as typos and missing map keys visible instead of silently turning them into generic fallback results.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter.

Part of the phx plugin — 50 skills, 26 agents, 10 hooks shipped together

Good fit It helps audit rescue clauses and refactor them so expected failures are handled while unexpected errors reach tests and error reporting.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/oliver-kriska/claude-elixir-phoenix/narrow-bare-rescue
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 oliver-kriska/claude-elixir-phoenix --skill narrow-bare-rescue
Clone the repo
git clone --depth 1 https://github.com/oliver-kriska/claude-elixir-phoenix

Made for: Claude Code.

Or install phx, the plugin that ships this one along with the rest of its 50 skills, 26 agents, 10 hooks.

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 narrow-bare-rescue

README.md
[![agentmods](https://agentmods.dev/badge/skills/oliver-kriska/claude-elixir-phoenix/narrow-bare-rescue/github.svg)](https://agentmods.dev/skills/oliver-kriska/claude-elixir-phoenix/narrow-bare-rescue)
Your own site
<a href="https://agentmods.dev/skills/oliver-kriska/claude-elixir-phoenix/narrow-bare-rescue"><img src="https://agentmods.dev/badge/skills/oliver-kriska/claude-elixir-phoenix/narrow-bare-rescue/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 narrow-bare-rescue

Your own site · 80×15
<a href="https://agentmods.dev/skills/oliver-kriska/claude-elixir-phoenix/narrow-bare-rescue"><img src="https://agentmods.dev/badge/skills/oliver-kriska/claude-elixir-phoenix/narrow-bare-rescue.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 40 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,436 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00040 $0.01436
Opus 5 $0.00020 $0.00718
Sonnet 5 $0.00008 $0.00287
Haiku 4.5 $0.00004 $0.00144

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

Security

Grade A, and why

narrow-bare-rescue 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 8d 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-phoenix/skills/narrow-bare-rescue/SKILL.md · 143 lines

How it starts

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

Narrow Bare Rescue

Turn rescue _ -> fallback into rescue _ in [ExceptionType1, ExceptionType2] -> fallback so programmer bugs propagate while known failure modes stay handled.

Why this matters

Bare rescues (rescue _ ->, rescue e -> — any form without an in clause) swallow every exception, including UndefinedFunctionError from typos, KeyError from misspelled map keys, and CompileError from bad HEEx templates. The symptom isn't a stack trace — it's a silent {:error, :generic} or a nil fallback. Bugs that should surface in tests or error reporters become quiet degradations.

The Erlang Secure Coding Guide makes the same case at the BEAM level — rule LNG-002 ("Do Not Use catch") warns that the legacy catch-all form conflates normal returns, throws, and errors. Bare rescue in Elixir is the direct analogue.

Iron Laws

  1. Never leave rescue _ -> or rescue e -> without an in clause. Every rescue must list exact exception types. The Credo check enforces this after cleanup lands.
  2. Cover every exception the code path can actually raise. Narrowing that drops a real exception is a behavioral regression — trace each call in the body before committing.
  3. Never include programmer-bug exceptions in the list. UndefinedFunctionError, CompileError, BadFunctionError, and BadArityError must propagate.
  4. Use reraise e, __STACKTRACE__, never reraise e, []. Preserve the original stack trace so Oban retry metadata and error reporters show the real origin.
  5. Run mix compile --warnings-as-errors before committing. Typos in exception module names only surface at compile time — the code looks fine until it loads.

The core transform

# Before — masks programmer bugs
def parse(body) do
  Jason.decode!(body)
rescue
  _ -> %{}
end

# After — catches only what can actually fail here
def parse(body) do
  Jason.decode!(body)
rescue
  _ in [Jason.DecodeError, ArgumentError] -> %{}
end

Read the full file on GitHub · 143 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 8d ago First seen · 143 lines · 40 tokens per session scan A c3f0d92655ea

Subscribe to this mod's changes

narrow-bare-rescue is a skill published in the GitHub repository oliver-kriska/claude-elixir-phoenix (544 stars, last pushed yesterday), licensed MIT. It adds 40 tokens to every session and 1,436 once invoked, about $0.0002 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-09-03.

Related

Other skills, from other repositories

bug-fix

Use when a bug, regression, or unexpected behaviour is reported and the user wants it fixed end to end — "why is X broken", "this stopped working after Y", "fix this crash". Also use when a symptom is known but its cause is not. Not for building new behaviour, and not for a change whose cause is already proven.

kardebadas/claude-plugin · 74 tokens

bug-investigate

Use when someone wants to know WHY something is broken and has not asked for it to be fixed — "why is this happening", "what's causing this error", "find out what's wrong", "diagnose this before we decide". Also use before committing to a fix, when the cause is unknown and the decision depends on it. Not for fixing …

kardebadas/claude-plugin · 83 tokens

cige-product-defect-escalation

Use when cige-failure-classification identifies a Product Defect -- execution reached a healthy system with current steps, but the outcome contradicts Intent. Fetches specRef and buildRef to file a defect or, only with human approval, propose an Intent update.

vivekkrishna/agentic-validation-skills · 62 tokens

cige-stale-execution-repair

Use when cige-failure-classification identifies Outdated Test Logic (repair Execution steps, Mode A) or a confirmed False Positive (add a stricter Guardrail, Mode B). Human approval required before committing either kind of repair.

vivekkrishna/agentic-validation-skills · 56 tokens

gurobi-advanced-features

When the user wants to use Gurobi beyond plain model building — callbacks for lazy constraints, user cuts, heuristic solution injection, and early termination; IIS computation for diagnosing an infeasible model; the solution pool; the multi-objective API; the matrix API (addMVar/addMConstr); MIP starts; and parameter…

hajibabaie/combinatorial-optimization-skills · 154 tokens

diagnose

Disciplined diagnosis loop for hard bugs and performance regressions. Reproduce → minimise → hypothesise → instrument → fix → regression-test. Use when user says "diagnose this" / "debug this", reports a bug, says something is broken/throwing/failing, or describes a performance regression.

saitarrun/Sdlc-ai-workflow · 66 tokens