unsafe

unsafe is a skill for Claude Code from ncaq/konoka. It costs 41 tokens per session (786 once invoked), scanned A, original, Apache-2.0.

A Haskell coding rule that forbids functions whose names begin with unsafe, such as unsafePerformIO and unsafeCoerce. These functions bypass guarantees that normally make Haskell code predictable and type-safe.

In plain words
What is it for?
Writing or reviewing Haskell code and replacing unsafe operations with safer alternatives, except where a narrowly contained low-level use is genuinely required.
Why use it?
It helps prevent hidden side effects, invalid type conversions, crashes and other bugs caused by skipping safety checks.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter.

Part of the haskell-tasuke plugin — 19 skills shipped together

Good fit Writing or reviewing Haskell code and replacing unsafe operations with safer alternatives, except where a narrowly contained low-level use is genuinely required.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ncaq/konoka/unsafe
View source ↗ ncaq/konoka
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 ncaq/konoka --skill unsafe
Clone the repo
git clone --depth 1 https://github.com/ncaq/konoka

Made for: Claude Code.

Or install haskell-tasuke, the plugin that ships this one along with the rest of its 19 skills.

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 unsafe

README.md
[![agentmods](https://agentmods.dev/badge/skills/ncaq/konoka/unsafe.svg)](https://agentmods.dev/skills/ncaq/konoka/unsafe)
Your own site
<a href="https://agentmods.dev/skills/ncaq/konoka/unsafe"><img src="https://agentmods.dev/badge/skills/ncaq/konoka/unsafe.svg" alt="Measured on agentmods" height="20"></a>
Per session 41 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 786 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.00041 $0.00786
Opus 5 $0.00020 $0.00393
Sonnet 5 $0.00008 $0.00157
Haiku 4.5 $0.00004 $0.00079

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

Security

Grade A, and why

unsafe 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 7d 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/haskell-tasuke/skills/unsafe/SKILL.md · 78 lines

What it actually says

unsafeな関数の禁止

名前にunsafeが付く関数は、 参照透過性や型安全性といったHaskellの根幹の保証を破壊するため、 原則として使用を禁止します。

unsafe接頭辞は「これを使うと言語の保証が効かなくなる」という作者からの警告です。

特に避けるべき関数

unsafePerformIO

IOアクションを純粋なコンテキストで実行します。

参照透過性を破壊します。 GHCの最適化により評価回数や評価順序が変わったり、 共有によって一度しか実行されなかったりするため、 副作用のタイミングを予測できなくなります。

unsafeDupablePerformIO

unsafePerformIOの制約をさらに緩めたものです。 複数のスレッドから同時に、 あるいは重複して実行される可能性があり、 unsafePerformIOよりも危険です。

unsafeInterleaveIO

IOアクションを遅延実行します。 実際に値が必要になるまで実行が遅延されるため、 副作用の発生タイミングが完全に非決定的になります。 遅延IOにまつわる諸問題の原因です。

unsafeFixIO

IOにおける不動点を計算します。 まだ定まっていない値を参照するとデッドロックや実行時エラーになります。

unsafeCoerce

ある型の値を無検査で別の型へ変換します。 型システムを完全に迂回するため、 誤用するとセグメンテーション違反など、 Haskellでは本来起こり得ないクラッシュを引き起こします。

ライブラリが提供するunsafe関数

bytestringunsafeIndexや、 vectorunsafeReadなど、 ライブラリにも境界チェックを省略するunsafe接頭辞の関数があります。

これらもパフォーマンスのために安全性を犠牲にしているので、 原則として安全版であるindexMaybe!?などを使ってください。

coerceとの混同に注意

Data.Coerce.coerceunsafeCoerceと名前も用途も似ていますが別物です。 coerceCoercible制約によってコンパイル時に安全性が保証されるため、 こちらは禁止しません。 newtypeの包み直しなどではunsafeCoerceではなくcoerceを使ってください。

使わざるを得ない場面

FFIのバインディングや、 NOINLINEと組み合わせたグローバルな可変変数の定義など、 unsafePerformIOが事実上の定石になっている領域があります。

そうした場合でも、 ライブラリやモジュールの内部に閉じ込めて、 外部には純粋で安全なAPIだけを公開してください。 そしてなぜ安全と言えるのかをコメントで必ず明示してください。

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. 7d ago First seen · 78 lines · 41 tokens per session scan A 72e4123fda66

Subscribe to this mod's changes

unsafe is a skill published in the GitHub repository ncaq/konoka (3 stars, last pushed today), licensed Apache-2.0. It adds 41 tokens to every session and 786 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-08-31.

Related

Other skills, from other repositories

better-auth

Skill for integrating Better Auth - comprehensive TypeScript authentication framework for Cloudflare D1, Next.js, Nuxt, and 15+ frameworks. Use when adding auth, encountering D1 adapter errors, or implementing OAuth/2FA/RBAC features.

secondsky/claude-skills · 53 tokens

bun-bundler

This skill should be used when the user asks about "bun build", "Bun.build", "bundling with Bun", "code splitting", "tree shaking", "minification", "sourcemaps", "bundle optimization", "esbuild alternative", "building for production", "bundling TypeScript", "bundling for browser", "bundling for Node", or…

secondsky/claude-skills · 90 tokens

bun-ffi

This skill should be used when the user asks about "bun:ffi", "foreign function interface", "calling C from Bun", "native libraries", "dlopen", "shared libraries", "calling native code", or integrating C/C++ libraries with Bun.

secondsky/claude-skills · 56 tokens

bun-hot-reloading

Use when implementing hot reloading with Bun (--hot, --watch), HMR, or automatic code reloading during development. Covers watch mode, hot mode, and HTTP server reload.

secondsky/claude-skills · 42 tokens

cloudflare-workers-multi-lang

Multi-language Workers development with Rust, Python, and WebAssembly. Use when building Workers in languages other than JavaScript/TypeScript, or when integrating WASM modules for performance-critical code.

secondsky/claude-skills · 45 tokens

test-driven-development

Strict red-green-refactor TDD workflow for implementing features, fixing bugs, or changing behavior in Rails applications. Enforces the discipline of writing a failing test before any production code. Use whenever you want to implement with TDD — whether a new feature, a bugfix, a refactor, or any behavior change.

thoughtbot/rails-consultant · 68 tokens