nix-store-scan

nix-store-scan is a skill for Claude Code from ncaq/konoka. It costs 97 tokens per session (1,642 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,642 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.01642
Opus 5.5 $0.00039 $0.00657
Sonnet 5.5 $0.00019 $0.00328
Haiku 4.5 $0.00010 $0.00164

Measured yesterday against content hash df7ab39378d0, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 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.

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

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]が必要)

Read the full file on GitHub · 81 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. yesterday Changed · -15 lines df7ab39378d0
  2. 3mo 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 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.

Related

nix-store-scan compared with skills from other repositories

nix-store-scan next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
nix-store-scanncaq/konokaSkill3yesterdayApache-2.0A97Claude Code
github-project-automationsecondsky/claude-skillsSkill257todayMITA45Claude Code
hono-routingsecondsky/claude-skillsSkill257todayMITA41Claude Code
api-testingsecondsky/claude-skillsSkill257todayMITA39Claude Code
bun-http-serversecondsky/claude-skillsSkill257todayMITA31Claude Code
bun-jest-migrationsecondsky/claude-skillsSkill257todayMITA25Claude Code
cloudflare-workers-migrationsecondsky/claude-skillsSkill257todayMITA49Claude Code