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.01642 |
| Opus 5.5 | $0.00039 | $0.00657 |
| Sonnet 5.5 | $0.00019 | $0.00328 |
| Haiku 4.5 | $0.00010 | $0.00164 |
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 yesterday.
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 — 81 lines — stays where its author put it; the contents beside it link to each section on GitHub.
/nix/storeを無制限に走査しない
/nix/store全体を、上限を付けずに走査しないでください。
/nix/storeは直下だけで数十万エントリに達することが珍しくありません。
Claude Codeのツール経由で走査すると、巨大な結果をClaude Code本体のプロセスが蓄積するので、
シェルの子プロセスではなくClaude Code自身がOOM Killerに殺されます。
完走しても、巨大な出力がコンテキストを圧迫します。
Nixのメタデータで正確なストアパスを1つ特定してから、そのパスに限定して操作するのが基本です。
ストア全体を対象にする場合は、深さと件数の両方に上限を付けます。
これが許されるのは、fdのように--max-depthで走査の範囲そのものを限定でき、
ファイルの内容を開かないので1エントリあたりのコストが小さいツールだけです。
ファイルの内容の検索は、常に単一のストアパスに限定します。
無制限な走査に当たる操作
- シェルの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などで出力を絞っても走査は打ち切れません。
glob展開が危険な理由は以下の通りです。
- シェルが全てのエントリ名をメモリ上に構築してソートするので、 展開した時点で数十MBのメモリを消費します。
- 展開結果を外部コマンドに渡すと、
ARG_MAX(通常2MiB)を超えてE2BIGで失敗します。 失敗するのに、展開のコストだけは支払うことになります。 echoのような組み込みコマンドやforのような組み込み構文はエラーにならず、 シェルがメモリと時間を消費し切った上で巨大な出力を生みます。 組み込みやxargsを経由しても安全にはなりません。**による再帰globは、zshやglobstarを有効にしたbashでは、 ストア全体の数百万から数千万のファイルを走査します。globstarが無効な既定のbashでも**は*と同義なので、/nix/store/*/*.so相当の数十万エントリ規模の展開が起きます。
代替手段
| やりたいこと | 使うコマンド |
|---|---|
| パッケージのストアパスを知る | 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.
- yesterday Changed · -15 lines df7ab39378d0
- 3mo 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 yesterday), licensed Apache-2.0. It adds 97 tokens to every session and 1,642 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-31.
nix-store-scan compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| nix-store-scanncaq/konoka | Skill | 3 | yesterday | Apache-2.0 | A | 97 | Claude Code |
| github-project-automationsecondsky/claude-skills | Skill | 257 | today | MIT | A | 45 | Claude Code |
| hono-routingsecondsky/claude-skills | Skill | 257 | today | MIT | A | 41 | Claude Code |
| api-testingsecondsky/claude-skills | Skill | 257 | today | MIT | A | 39 | Claude Code |
| bun-http-serversecondsky/claude-skills | Skill | 257 | today | MIT | A | 31 | Claude Code |
| bun-jest-migrationsecondsky/claude-skills | Skill | 257 | today | MIT | A | 25 | Claude Code |
| cloudflare-workers-migrationsecondsky/claude-skills | Skill | 257 | today | MIT | A | 49 | Claude Code |