trim-to-budget

trim-to-budget is a skill for Claude Code from ayeshakhalid192007-dev/graph-engineering-crash-course. It costs 47 tokens per session (1,063 once invoked), scanned A, original, MIT.

A graph-pruning tool that keeps an anchor node and the highest-scoring nearby nodes up to a fixed count. A graph represents items as nodes and their connections as edges.

In plain words
What is it for?
Use it to create a smaller task-specific subgraph from scored candidates and handle ties at the selection boundary explicitly.
Why use it?
It keeps a result within a hard size limit while removing connections to discarded nodes and recording the cutoff score.

Skill for Claude Code

Written for Claude Code: installed under .claude/. Also seen: model in frontmatter; mentions Claude Code.

Good fit Use it to create a smaller task-specific subgraph from scored candidates and handle ties at the selection boundary explicitly.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ayeshakhalid192007-dev/graph-engineering-crash-course/trim-to-budget
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 ayeshakhalid192007-dev/graph-engineering-crash-course --skill trim-to-budget
Clone the repo
git clone --depth 1 https://github.com/ayeshakhalid192007-dev/graph-engineering-crash-course

Made for: Claude Code.

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 trim-to-budget

README.md
[![agentmods](https://agentmods.dev/badge/skills/ayeshakhalid192007-dev/graph-engineering-crash-course/trim-to-budget/github.svg)](https://agentmods.dev/skills/ayeshakhalid192007-dev/graph-engineering-crash-course/trim-to-budget)
Your own site
<a href="https://agentmods.dev/skills/ayeshakhalid192007-dev/graph-engineering-crash-course/trim-to-budget"><img src="https://agentmods.dev/badge/skills/ayeshakhalid192007-dev/graph-engineering-crash-course/trim-to-budget/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 trim-to-budget

Your own site · 80×15
<a href="https://agentmods.dev/skills/ayeshakhalid192007-dev/graph-engineering-crash-course/trim-to-budget"><img src="https://agentmods.dev/badge/skills/ayeshakhalid192007-dev/graph-engineering-crash-course/trim-to-budget.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 47 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,063 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.00047 $0.01063
Opus 5 $0.00023 $0.00531
Sonnet 5 $0.00009 $0.00213
Haiku 4.5 $0.00005 $0.00106

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

Security

Grade A, and why

trim-to-budget 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 12d 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.

starters/budget-capped-subgraph/.claude/skills/trim-to-budget/SKILL.md · 95 lines

How it starts

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

trim-to-budget

Reads a candidate task-scoped subgraph — an anchor node plus relevance- scored surrounding nodes and their edges — and a node-count budget, then produces the largest allowed slice: the anchor, plus as many of the highest-relevance remaining nodes as fit, with every edge re-checked against the final kept set.

Instructions

You are a Claude Code skill implementing the budget-capped-subgraph pattern. Follow these steps in order:

  1. Identify the anchor node. It is always kept, and it always counts as one of the budget's node slots — never treat it as free.
  2. Read every other candidate node and its relevance score. Default to the candidate subgraph and budget in this kit's README.md unless the user gives you a different one. Sort these nodes by relevance, highest first.
  3. Fill the remaining budget slots in relevance order. With a budget of N nodes, the anchor takes one slot and the top (N-1) remaining nodes by relevance take the rest. Everything past that point is dropped. If two nodes tie exactly on relevance at the cutoff boundary, note the tie explicitly rather than picking one arbitrarily and saying nothing about it.
  4. Record the trimming rule as a legible statement, not just a list: name the budget, confirm the anchor was kept unconditionally, and state the exact relevance score at which the cutoff fell (the lowest score still kept, and the highest score dropped, if they differ).
  5. Re-check every edge in the candidate subgraph against the final kept node set. An edge survives only if both of its endpoints are in the kept set. Do this as its own explicit pass after node trimming is decided — don't try to decide node and edge survival in the same pass, since an edge's fate depends on a node-trimming decision that has to be finished first.
  6. Report four things together: the kept nodes, the dropped nodes, the surviving edges, and the trimming rule statement from step 4. Never report just the kept subgraph without also naming what got cut and why — a cutoff nobody can see is indistinguishable from no budget at all.

Read the full file on GitHub · 95 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. 12d ago First seen · 95 lines · 47 tokens per session scan A 125c4ade8b03

Subscribe to this mod's changes

trim-to-budget is a skill published in the GitHub repository ayeshakhalid192007-dev/graph-engineering-crash-course (5 stars, last pushed 17d ago), licensed MIT. It adds 47 tokens to every session and 1,063 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

install

Install the Rekal binary on this machine. Use when rekal is not on PATH — a command reported command not found — or when the user asks to install Rekal. Once per machine, not per repository; to set up a repo that already has the binary, use the init skill instead.

rekal-dev/rekal-cli · 66 tokens

animate

Build a web animation: whether it should animate at all, the purpose, the tool, the properties, the easing curve, the duration, interruption and exit. Writes the CSS or Motion code for dropdowns, modals, toasts, tooltips, accordions, press feedback, stagger and scroll reveals. Use to animate something or make a…

ericrisco/rsc-harness · 75 tokens

author-skill

Use when authoring a NEW rsc skill or editing an existing one — scoping it to one job, writing the description that decides whether it ever loads, splitting the body into references/, writing its evals, auditing it against the rubric. NOT building a product feature (that is specify) and NOT designing an agent loop…

ericrisco/rsc-harness · 79 tokens

building-agents

Use when building or restructuring an LLM agent — provider adapter, tool calling, structured output, RAG, agent loop, eval gate, cost routing, tracing, MCP server — model-agnostic across OpenAI/Anthropic/Gemini/OSS so a model swap is a config change. NOT vector-store SQL alone (that is postgresdb) or service…

ericrisco/rsc-harness · 85 tokens

open-weights

Use when choosing an open-weight LLM and clearing it for use — which family and size fit the task, the hardware and the budget, and above all whether the license permits shipping. Owns the license-class map (OSI-open versus custom-community versus non-commercial), the always-verify-the-model-card rule, size-to-VRAM…

ericrisco/rsc-harness · 146 tokens

postgresdb

Use when PostgreSQL engine behaviour decides the answer — schema and type design, index choice, reading EXPLAIN on a slow query, zero-downtime DDL and backfills, or ops (roles, RLS, pooling, vacuum, partitioning, PITR). PG16, ORM-agnostic. NOT portable query logic (that is sql), NOT a managed provider's platform…

ericrisco/rsc-harness · 91 tokens