script-reuse

script-reuse is a skill for Claude Code, Codex from wefio/NodeMemoryGraph. It costs 62 tokens per session (1,294 once invoked), scanned A, original, MIT.

A guide for writing reliable one-off scripts and reusing existing helpers in a code repository. It covers command-line inputs, rejecting missing or empty data, checking results, and recording where outputs came from.

In plain words
What is it for?
Use it for quick scripts, ad-hoc data analysis, and small probes of a codebase. It helps add input flags, fail safely, validate calculations, and include output provenance.
Why use it?
It prevents throwaway scripts from silently producing incorrect numbers or duplicating code that already exists. It also makes each run repeatable without editing the source first.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is import { writeJsonAtomic } from "../tools/parts/fs.ts";.

Good fit Use it for quick scripts, ad-hoc data analysis, and small probes of a codebase. It helps add input flags, fail safely, validate calculations, and include output provenance.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/wefio/NodeMemoryGraph
agentmods
npx agentmods add skills/wefio/nodememorygraph/script-reuse

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 script-reuse

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/wefio/nodememorygraph/script-reuse"><img src="https://agentmods.dev/badge/skills/wefio/nodememorygraph/script-reuse.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 62 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,294 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.00062 $0.01294
Opus 5.5 $0.00025 $0.00518
Sonnet 5.5 $0.00012 $0.00259
Haiku 4.5 $0.00006 $0.00129

Measured 1mo ago against content hash 8d076d59a082, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

script-reuse 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 1mo 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/script-reuse/SKILL.md · 111 lines

How it starts

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

Write the one-off script, and write it right

A one-off script is the normal answer to a one-off question. Write it. Nothing here is meant to talk you out of that. Two things are governed instead:

  • do not write the second copy of a part that already exists;
  • do not ship a script that quietly produces a wrong number — the number gets quoted long after the script is deleted.

The parts shelf is the other half of the offer: if a ready-made piece fits — percentiles, mapConcurrent, atomic JSON writes, the control-plane API — import it instead of re-deriving it. That is a shortcut, not a requirement. A script with its own three-line helper is fine as long as it is the first copy.

What makes it right

In the order these bite:

  1. One command line, no editing. Inputs come from flags, not from constants you edit before each run. node:util already has parseArgs; do not write one.
  2. Refuse to run on missing input. Missing flag, missing file, empty dataset → throw. A run over zero rows must not print a number.
  3. Assert something about the result. Counts add up, values are finite, parts sum to the whole. One if (...) throw is enough; it is the only thing that separates "measured" from "ran".
  4. Say what you measured in the output. The script is throwaway, its output is not. Write the input path, row count, and timestamp next to the number, so the number can still be interpreted after the script is deleted.
  5. Fail loudly and non-zero. Never catch {}, never process.exit(0) after a failure, never ?? 0 to paper over a missing value on a measurement path.
import { readFileSync } from "node:fs";
import { parseArgs } from "node:util";

import { writeJsonAtomic } from "../tools/parts/fs.ts";
import { mean } from "../tools/parts/stats.ts";

const { values } = parseArgs({
  options: { input: { type: "string" }, out: { type: "string" } },
});
if (!values.input || !values.out) throw new Error("usage: --input <file> --out <file>");

const rows = JSON.parse(readFileSync(values.input, "utf8")) as number[];
if (rows.length === 0) throw new Error(`${values.input} has no rows`);
if (!rows.every(Number.isFinite)) throw new Error(`${values.input} has a non-finite value`);

writeJsonAtomic(values.out, {
  input: values.input,
  rows: rows.length,
  measuredAt: new Date().toISOString(),
  mean: mean(rows),
});

Read the full file on GitHub · 111 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. 1mo ago First seen · 111 lines · 62 tokens per session scan A 8d076d59a082

Subscribe to this mod's changes

script-reuse is a skill published in the GitHub repository wefio/NodeMemoryGraph (0 stars, last pushed 2d ago), licensed MIT. It adds 62 tokens to every session and 1,294 once invoked, about $0.0002 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-09-10.