smart-reading

smart-reading is a skill for Claude Code, Codex from axiomantic/spellbook. It costs 45 tokens per session (1,999 once invoked), scanned A, original, MIT.

A protocol for reading files or command output whose size is not known in advance.

In plain words
What is it for?
It helps measure content first, choose an appropriate reading method, delegate large files when needed, and clean up temporary captures.
Why use it?
It prevents important information from being silently missed when output is truncated without checking its full size.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions subagents.

Good fit It helps measure content first, choose an appropriate reading method, delegate large files when needed, and clean up temporary captures.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/axiomantic/spellbook/smart-reading
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 axiomantic/spellbook --skill smart-reading
Clone the repo
git clone --depth 1 https://github.com/axiomantic/spellbook

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 smart-reading

README.md
[![agentmods](https://agentmods.dev/badge/skills/axiomantic/spellbook/smart-reading/github.svg)](https://agentmods.dev/skills/axiomantic/spellbook/smart-reading)
Your own site
<a href="https://agentmods.dev/skills/axiomantic/spellbook/smart-reading"><img src="https://agentmods.dev/badge/skills/axiomantic/spellbook/smart-reading/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 smart-reading

Your own site · 80×15
<a href="https://agentmods.dev/skills/axiomantic/spellbook/smart-reading"><img src="https://agentmods.dev/badge/skills/axiomantic/spellbook/smart-reading.svg" alt="Reviewed on agentmods" width="80" 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 1,999 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. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 5 findings, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Tool Misuse · line 65
    Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
    Fix: Validate all tool parameters against an allowlist. Reject dangerous parameter values (shell=True, --force, -rf /) and use safe defaults.
  • high Tool Misuse · line 81
    Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
    Fix: Validate all tool parameters against an allowlist. Reject dangerous parameter values (shell=True, --force, -rf /) and use safe defaults.
  • high Tool Misuse · line 82
    Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
    Fix: Validate all tool parameters against an allowlist. Reject dangerous parameter values (shell=True, --force, -rf /) and use safe defaults.
  • high Tool Misuse · line 94
    Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
    Fix: Validate all tool parameters against an allowlist. Reject dangerous parameter values (shell=True, --force, -rf /) and use safe defaults.
  • high Tool Misuse · line 101
    Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
    Fix: Validate all tool parameters against an allowlist. Reject dangerous parameter values (shell=True, --force, -rf /) and use safe defaults.
How audits are shown
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.00045 $0.01999
Opus 5 $0.00023 $0.01000
Sonnet 5 $0.00009 $0.00400
Haiku 4.5 $0.00005 $0.00200

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

Security

Grade A, and why

smart-reading 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 7d 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.

skills/smart-reading/SKILL.md · 231 lines

How it starts

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

Invariant Principles

  1. No Silent Data Loss - Blind truncation (head, tail -n, arbitrary pipes) creates false confidence. Critical errors often appear at end of output.
  2. Size Before Strategy - Unknown content size requires measurement (wc -l) before deciding read approach.
  3. Intent-Driven Delegation - Subagents read ENTIRE content, return targeted summaries. Specify WHY you need content.
  4. Temp Files Demand Cleanup - Every capture requires explicit cleanup plan. Use $$ for collision-free naming.

The Problem

Claude often pipes output through head -100 to "save tokens." This causes:

  • Silent data loss
  • Missed errors (which often appear at the END)
  • Wrong conclusions based on incomplete information
  • Wasted debugging cycles

Decision Matrix

Check size first, then act:

Line Count Need Exact Text? Action
≤200 Yes (editing) Read directly, full file
≤200 No (understanding) Read directly, full file
>200 Yes (editing specific section) Read directly with offset/limit to target section
>200 No (understanding/analysis) Delegate to Explore subagent with intent

Before Reading Any File

wc -l < "$FILE"  # Get line count first

Command Output Capture

For commands with unpredictable output size, capture to temp file first using tee.

The Pattern

# Capture full output while still seeing it stream
# /tmp/cmd-$$-output.txt — use $$ (process ID) to avoid collisions
command 2>&1 | tee /tmp/cmd-$$-output.txt

# Check size
wc -l < /tmp/cmd-$$-output.txt

# Apply decision matrix (read directly or delegate)
# ...

# ALWAYS cleanup
rm /tmp/cmd-$$-output.txt

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

Subscribe to this mod's changes

smart-reading is a skill published in the GitHub repository axiomantic/spellbook (10 stars, last pushed today), licensed MIT. It adds 45 tokens to every session and 1,999 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-09-03.

Related

Other skills, from other repositories

stacks

Load stack-specific knowledge (conventions, exact lint/test/build commands, common failure patterns) onto the current role agent for the project's detected tech stack(s) — Next.js, React Native, Spring Boot, FastAPI, Django, Rust, etc. Use at the start of any task in an unfamiliar or newly-onboarded repo, or whenever…

randomittin/heimdall · 85 tokens

opencode-export

Export opencode sessions to self-contained HTML + JSON archives for sharing, review, or backup. Use when the user wants to save, archive, or share their AI coding session history.

ZelinZhou-THU/opencode-export · 41 tokens

profile

Read the user's ENTIRE Claude Code message history with a multi-agent workflow, mine the working preferences that recur across almost all their tasks, verify each against the whole corpus, and distill them into a CLAUDE.md block so they never have to repeat them. Language-agnostic. Triggers: 'analyze how I use…

us/wend · 101 tokens

caveman

Ultra-compressed communication mode. Cuts token usage 75% by speaking like caveman while keeping full technical accuracy. Supports intensity levels: lite, full (default), ultra, wenyan-lite, wenyan-full, wenyan-ultra. Use when user says "caveman mode", "talk like caveman", "use caveman", "less tokens", "be brief", or…

randomittin/heimdall · 98 tokens

memstack-automation-n8n-workflow-builder

Use this skill when the user says 'n8n workflow', 'build a workflow', 'automation workflow', 'connect services', or needs visual workflow design with node mapping, data transformations, and error handling for n8n. Do NOT use for standalone webhook endpoints or cron jobs.

cwinvestments/memstack · 68 tokens

feishu-openapi-skill

Operate Feishu or Lark IM APIs through UXC with a curated OpenAPI schema, tenant-token bearer auth, and chat/message guardrails.

holon-run/uxc · 36 tokens