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.
npx skills add ncaq/konoka --skill nix-store-scangit clone --depth 1 https://github.com/ncaq/konokaWrote 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.
[](https://agentmods.dev/skills/ncaq/konoka/nix-store-scan)<a href="https://agentmods.dev/skills/ncaq/konoka/nix-store-scan"><img src="https://agentmods.dev/badge/skills/ncaq/konoka/nix-store-scan/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.
<a href="https://agentmods.dev/skills/ncaq/konoka/nix-store-scan"><img src="https://agentmods.dev/badge/skills/ncaq/konoka/nix-store-scan.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00097 | $0.01743 |
| Opus 5 | $0.00048 | $0.00872 |
| Sonnet 5 | $0.00019 | $0.00349 |
| Haiku 4.5 | $0.00010 | $0.00174 |
Grade A, and why
nix-store-scan 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 9d 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.
How it starts
The opening of the file, as written. The whole thing — 96 lines — stays where its author put it; the contents beside it link to each section on GitHub.
/nix/storeの無制限な走査の禁止
/nix/store全体を無制限に走査する操作は禁止です。
ワイルドカード展開はその代表例ですが、
再帰検索や上限なしの全件列挙も同様に禁止です。
禁止される操作
- シェルのglob展開:
ls /nix/store/*ghc*,du -sh /nix/store/*,echo /nix/store/**/*.so - Claude CodeのGlobツールやGrepツールを
/nix/store全体に向けること rgやgrep -rを/nix/store全体に再帰させることls /nix/storeやnix path-info --allのような全件列挙。 これらは全件を読み終えてから出力するため、headなどで出力を絞っても走査自体は打ち切れず禁止です
なぜ危険か
/nix/store直下だけで数十万エントリに達することが珍しくありません。 glob展開はシェルが全エントリ名をメモリ上に構築・ソートするため、 この時点で数十MBのメモリ消費が発生します。- 展開結果を外部コマンドへ渡す場合は、
ARG_MAX(通常2MiB)を超えてE2BIGで失敗します。 失敗するのに展開のコストだけは支払うことになります。 echoのような組み込みコマンドやforのような組み込み構文はエラーにならず、 シェルがメモリと時間を消費し切った上で巨大な出力を生みます。 組み込みやxargsを経由すれば安全になるわけではありません。**による再帰globは、 zshやbashのglobstar有効時にはストア全体の数百万から数千万のファイルを走査し、 時間とメモリを大量に消費します。globstarが無効な既定のbashでも**は*と同義なので、/nix/store/*/*.so相当の数十万エントリ規模の展開が起きて危険です。- Claude Codeのツール経由で実行した場合、 巨大な結果をClaude Code本体のプロセスが蓄積するため、 シェルの子プロセスではなくClaude Code自身がOOM Killerに殺されます。
- 仮に完走しても巨大な出力がコンテキストを圧迫します。
原則
ストア全体を無制限に走査しないことが原則です。
Nixのメタデータで正確なストアパスを1つ特定してから、
そのパスに限定して操作するのが基本形です。
ストア全体を対象にする場合は、
深さと件数の上限を必ず付けてください。
これが許されるのはfdのように、
--max-depthで走査範囲そのものを限定でき、
かつファイル内容を開かないため1エントリあたりのコストが小さいツールに限ります。
内容検索は常に単一ストアパスに限定してください。
タスク別の代替手段
| やりたいこと | 使うコマンド |
|---|---|
| パッケージのストアパスを知る | nix eval --raw 'nixpkgs#hello.outPath' |
| 中身を見るためにrealiseする | nix build --no-link --print-out-paths 'nixpkgs#hello' |
| PATH上のコマンドの実体を知る | readlink -f "$(command -v hello)" |
| 依存クロージャを列挙する | nix path-info -r /nix/store/<path> |
| 依存している理由を調べる | nix why-depends /nix/store/<from> /nix/store/<to> |
| ストア直下を名前で探す | fd --max-depth 1 --max-results 20 'pattern' /nix/store |
| 特定ストアパス直下のファイル一覧 | nix store ls /nix/store/<path> |
| 特定ストアパス内をパターンで探す | fd 'pattern' /nix/store/<path> |
| ファイル内容を検索する | rg 'pattern' /nix/store/<path> |
| ファイルを提供するパッケージを探す | nix-locate 'bin/hello'([nix-index]が必要) |
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.
- 9d ago First seen · 96 lines · 97 tokens per session scan A 10974861c1d2
nix-store-scan is a skill published in the GitHub repository ncaq/konoka (3 stars, last pushed 2d ago), licensed Apache-2.0. It adds 97 tokens to every session and 1,743 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-31.
Other skills, from other repositories
cloudflare-email-routing
Cloudflare Email Routing for receiving/sending emails via Workers. Use for email workers, forwarding, allowlists, or encountering Email Trigger errors, worker call failures, SPF issues.
bun-http-server
Use when building HTTP servers with Bun.serve, handling requests/responses, implementing routing, creating REST APIs, or configuring fetch handlers.
bun-sqlite
Use for bun:sqlite, SQLite operations, prepared statements, transactions, and queries.
api-testing
HTTP API testing for TypeScript (Supertest) and Python (httpx, pytest). Test REST APIs, GraphQL, request/response validation, authentication, and error handling.
bun-jest-migration
Use when migrating from Jest to Bun's test runner, import compatibility, mocks, and config.
cloudflare-workers-migration
Migrate to Cloudflare Workers from AWS Lambda, Vercel, Express, and Node.js. Use when porting existing applications to the edge, adapting serverless functions, or resolving Node.js API compatibility issues.