treefmt

treefmt is a skill for Claude Code, Codex from ncaq/konoka. It costs 45 tokens per session (2,091 once invoked), scanned A, original, Apache-2.0.

A Nix configuration guide for treefmt, a tool that runs formatters, linters, and other checks across multiple programming languages.

In plain words
What is it for?
Use it to configure formatters such as nixfmt, prettier, rustfmt, and shfmt, alongside checks such as shellcheck, deadnix, spelling checks, and GitHub Actions checks.
Why use it?
It clarifies what `nix fmt` runs and how to avoid missing new or untracked files in a project.

Skill for Claude CodeCodex

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

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.

agentmods
npx agentmods add skills/ncaq/konoka/treefmt
Any agent
npx skills add ncaq/konoka --skill treefmt
Clone the repo
git clone --depth 1 https://github.com/ncaq/konoka

Made for: Claude Code, Codex.

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 treefmt

README.md
[![agentmods](https://agentmods.dev/badge/skills/ncaq/konoka/treefmt.svg)](https://agentmods.dev/skills/ncaq/konoka/treefmt)
Your own site
<a href="https://agentmods.dev/skills/ncaq/konoka/treefmt"><img src="https://agentmods.dev/badge/skills/ncaq/konoka/treefmt.svg" alt="Measured on agentmods" height="20"></a>
Per session 45 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,091 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00045 $0.02091
Opus 5 $0.00023 $0.01045
Sonnet 5 $0.00009 $0.00418
Haiku 4.5 $0.00005 $0.00209

Measured 4d ago against content hash b903d156f807, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

treefmt 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 4d 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/treefmt/SKILL.md · 195 lines

How it starts

The opening of the file, as written. The whole thing — 195 lines — stays where its author put it; the contents beside it link to each section on GitHub.

treefmt-nix

概要

treefmtはプロジェクト内の複数言語ファイルを一コマンドで並列フォーマットするツールです。 treefmt-nixはNixモジュールシステムでtreefmtを設定・管理するラッパーです。

nix fmtコマンドはflakeのformatter出力を呼び出します。 treefmt-nixを組み込むとnix fmtの実体がtreefmtになり、 設定されたすべてのプログラムが実行されます。

FlakeはGitで追跡されているファイルのみを対象とするため、 新規ファイルがある場合は事前にgit ls-files --others --exclude-standard -z | git add --intent-to-add --pathspec-from-file=- --pathspec-file-nulを実行してください。 未追跡ファイルがなく空の入力でもエラーにはなりません。

フォーマッタだけではなくリンターも含む

nix fmttreefmtという名前から「フォーマッタだけ」と誤解されがちですが、 treefmt-nixのprogramsにはリンターやチェッカーが多数含まれています。

フォーマッタの例:

  • nixfmt
  • prettier
  • rustfmt
  • shfmt

リンターの例:

  • actionlint
  • deadnix
  • hlint
  • shellcheck
  • statix

その他:

  • typos(スペルチェック)
  • zizmor(GitHub Actionsセキュリティ)

treefmtのフォーマッタ仕様は「ファイルパスのリストを受け取り、変更があればファイルに書き戻す」というものです。 リンターはファイルを変更しませんが、エラー時に非ゼロ終了するためtreefmtがエラーとして検出します。

典型的な設定例

flake-partsを使う場合の例です。

{
  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
    flake-parts.url = "github:hercules-ci/flake-parts";
    treefmt-nix = {
      url = "github:numtide/treefmt-nix";
      inputs.nixpkgs.follows = "nixpkgs";
    };
  };

  outputs =
    inputs@{
      flake-parts,
      treefmt-nix,
      ...
    }:
    flake-parts.lib.mkFlake { inherit inputs; } {
      imports = [
        treefmt-nix.flakeModule
      ];

      systems = [
        "aarch64-linux"
        "x86_64-linux"
      ];

      perSystem = { pkgs, ... }: {
        treefmt.config = {
          projectRootFile = "flake.nix";
          programs = {
            nixfmt.enable = true;
            prettier.enable = true;
            shellcheck.enable = true;
            shfmt.enable = true;
          };
        };
      };
    };
}

nix fmtで全プログラムが実行されます。

フォーマッタのカスタム設定をする際の注意

treefmtの設定モジュールを使ってカスタム引数を渡すこともできます。

しかしなるべくflake.nixに書くのではなく、 そのツール自体が標準的に使う設定ファイルなどに設定を書き込んでください。

そうするとそのツールをnix fmt経由以外で使うときも同じ設定が適用されるため一貫性が保たれます。

Read the full file on GitHub · 195 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. 4d ago First seen · 195 lines · 45 tokens per session scan A b903d156f807

Subscribe to this mod's changes

treefmt is a skill published in the GitHub repository ncaq/konoka (3 stars, last pushed 6d ago), licensed Apache-2.0. It adds 45 tokens to every session and 2,091 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

api-testing

HTTP API testing for TypeScript (Supertest) and Python (httpx, pytest). Test REST APIs, GraphQL, request/response validation, authentication, and error handling.

secondsky/claude-skills · 39 tokens

api-gateway-configuration

Configures API gateways for routing, authentication, rate limiting, and request transformation in microservice architectures. Use when setting up Kong, Nginx, AWS API Gateway, or Traefik for centralized API management.

secondsky/claude-skills · 49 tokens

api-response-optimization

Optimizes API performance through payload reduction, caching strategies, and compression techniques. Use when improving API response times, reducing bandwidth usage, or implementing efficient caching.

secondsky/claude-skills · 36 tokens

espalier-migrate

Migrate an existing harness/espalier install to the current Espalier version — auto-detects which of v0.1→v0.2, v0.3→v0.4, v0.4→v0.5, the v0.5.3 coder-agent patch, v0.5→v0.6 (Stage 1 grill), v0.6→v0.7 (read-only /espalier-ask lane), v0.7→v0.8 (requirements approval gate), the v0.8.1 impact-analysis agent patch, the…

Junhanliu-dev/espalier-engineering · 0 tokens

recursive-decomposition

Handle tasks that exceed the context window by decomposing them: size and filter the input, chunk it, run recursive sub-agents on independent parts, verify on small windows, and synthesise programmatically, following the Recursive Language Models (RLM) research by Zhang, Kraska and Khattab (2025). Use when a task…

massimodeluisa/recursive-decomposition-skill · 151 tokens

math-unicode

Use when a response needs mathematical notation (equations, filters, set-builder notation, statistics, calculus, linear algebra, logic, ratios, drops, counts) and the output goes to a terminal or TUI that cannot render LaTeX: Claude Code, Codex CLI, SSH and tmux sessions, CI logs. Load it before composing, including…

vladimirrott/claude-math · 154 tokens