nix-store-scan

nix-store-scan is a skill for Claude Code from ncaq/konoka. It costs 97 tokens per session (1,743 once invoked), scanned A, original, Apache-2.0.

A safety guide for working with Nix’s package store, the directory where Nix keeps installed software and its dependencies.

In plain words
What is it for?
Use it when locating or inspecting Nix packages, with the exact store path and limits on search depth or file count.
Why use it?
It prevents searches across the entire store from using excessive memory, time, or output and possibly crashing the coding agent.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter. Also seen: mentions Claude Code.

Part of the nix-tasuke plugin — 6 skills, 1 MCP server shipped together

Good fit Use it when locating or inspecting Nix packages, with the exact store path and limits on search depth or file count.

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

Made for: Claude Code.

Or install nix-tasuke, the plugin that ships this one along with the rest of its 6 skills, 1 MCP server.

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 nix-store-scan

README.md
[![agentmods](https://agentmods.dev/badge/skills/ncaq/konoka/nix-store-scan/github.svg)](https://agentmods.dev/skills/ncaq/konoka/nix-store-scan)
Your own site
<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.

agentmods 80×15 button for nix-store-scan

Your own site · 80×15
<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>
Per session 97 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,743 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.00097 $0.01743
Opus 5 $0.00048 $0.00872
Sonnet 5 $0.00019 $0.00349
Haiku 4.5 $0.00010 $0.00174

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

Security

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.

plugins/nix-tasuke/skills/nix-store-scan/SKILL.md · 96 lines

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全体に向けること
  • rggrep -r/nix/store全体に再帰させること
  • ls /nix/storenix 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]が必要)

Read the full file on GitHub · 96 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. 9d ago First seen · 96 lines · 97 tokens per session scan A 10974861c1d2

Subscribe to this mod's changes

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.