nushell-usage

nushell-usage is a skill for Claude Code, Codex from YPares/agent-skills. It costs 54 tokens per session (2,799 once invoked), scanned A, original, MIT.

A guide to writing Nushell scripts, including its commands, data types, pipelines, and list handling. Nushell is a shell that passes structured data between commands instead of only text.

In plain words
What is it for?
Use it when writing Nushell functions and scripts, especially those that process lists, define input types, or work with pipelines.
Why use it?
It helps avoid mistakes caused by treating pipeline input like a normal function argument, or by misunderstanding when data is streamed versus loaded into memory.

Skill for Claude CodeCodex

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/ypares/agent-skills/nushell-usage
Any agent
npx skills add YPares/agent-skills --skill nushell-usage
Clone the repo
git clone --depth 1 https://github.com/YPares/agent-skills

Made for: Claude Code, Codex.

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 nushell-usage

README.md
[![agentmods](https://agentmods.dev/badge/skills/ypares/agent-skills/nushell-usage.svg)](https://agentmods.dev/skills/ypares/agent-skills/nushell-usage)
Your own site
<a href="https://agentmods.dev/skills/ypares/agent-skills/nushell-usage"><img src="https://agentmods.dev/badge/skills/ypares/agent-skills/nushell-usage.svg" alt="Measured on agentmods" height="20"></a>
Per session 54 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,799 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.00054 $0.02799
Opus 5 $0.00027 $0.01399
Sonnet 5 $0.00011 $0.00560
Haiku 4.5 $0.00005 $0.00280

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

Security

Grade A, and why

nushell-usage 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.

nushell-usage/SKILL.md · 417 lines

How it starts

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

Nushell Usage Patterns

Critical Distinctions

Pipeline Input vs Parameters

CRITICAL: Pipeline input ($in) is NOT interchangeable with function parameters!

# ❌ WRONG - treats $in as first parameter
def my-func [list: list, value: any] {
    $list | append $value
}

# ✅ CORRECT - declares pipeline signature
def my-func [value: any]: list -> list {
    $in | append $value
}

# Usage
[1 2 3] | my-func 4  # Works correctly
my-func [1 2 3] 4    # ERROR! my-func doesn't take positional params

This applies to closures too.

Why this matters:

  • Pipeline input can be lazily evaluated (streaming)
  • Parameters are eagerly evaluated (loaded into memory)
  • Different calling conventions entirely

Type Signatures

# No pipeline input
def func [x: int] { ... }                    # (x) -> output

# Pipeline input only
def func []: string -> int { ... }           # string | func -> int

# Both pipeline and parameters
def func [x: int]: string -> int { ... }     # string | func x -> int

# Generic pipeline
def func []: any -> any { ... }              # works with any input type

Common Patterns

Working with Lists

# Filter with index
$list | enumerate | where {|e| $e.index > 5 and $e.item.some-bool-field}

# Transform with previous state
$list | reduce --fold 0 {|item, acc| $acc + $item.value}

Working with Records

# Create record
{name: "Alice", age: 30}

# Merge records (right-biased)
$rec1 | merge $rec2

# Merge many records (right-biased)
[$rec1 $rec2 $rec3 $rec4] | into record

# Update field
$rec | update name {|r| $"Dr. ($r.name)"}

# Insert field
$rec | insert active true

# Insert field based on existing fields
{x:1, y: 2} | insert z {|r| $r.x + $r.y}

# Upsert (update or insert)
$rec | upsert count {|r| ($r.count? | default 0) + 1}

# Reject fields
$rec | reject password secret_key

# Select fields
$rec | select name age email

Working with Tables

# Tables are lists of records
let table = [
    {name: "Alice", age: 30}
    {name: "Bob", age: 25}
]

# Filter rows
$table | where age > 25

# Add column
$table | insert retired {|row| $row.age > 65}

# Rename column
$table | rename -c {age: years}

# Group by
$table | group-by status --to-table

# Transpose (rows ↔ columns)
$table | transpose name data

Read the full file on GitHub · 417 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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 · 417 lines · 54 tokens per session scan A efb2c4d92f3b

Subscribe to this mod's changes

nushell-usage is a skill published in the GitHub repository YPares/agent-skills (30 stars, last pushed 5d ago), licensed MIT. It adds 54 tokens to every session and 2,799 once invoked, about $0.0003 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-30.