trim

trim is a skill for Claude Code from larsboes/Axon. It costs 136 tokens per session (1,532 once invoked), scanned A, original, MIT.

A workflow for reducing the size of always-loaded instruction and memory files, such as CLAUDE.md, AGENTS.md, and their imported files. It measures the files first, removes content that is clearly unused, and asks for approval before judgment calls.

In plain words
What is it for?
Use it to measure context-file size, find dead references and duplicates, propose safe removals or reorganisations, and remeasure the result.
Why use it?
Large instruction files consume context in every session and may contain duplicated or outdated rules. This workflow reduces that overhead while preserving distinct directives and keeping edits reversible.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: reads .claude/ paths; mentions CLAUDE.md; mentions AGENTS.md.

Part of the harness plugin — 3 skills shipped together

Good fit Use it to measure context-file size, find dead references and duplicates, propose safe removals or reorganisations, and remeasure the result.

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

Made for: Claude Code.

Or install harness, the plugin that ships this one along with the rest of its 3 skills.

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

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/larsboes/axon/trim"><img src="https://agentmods.dev/badge/skills/larsboes/axon/trim.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 136 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,532 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.00136 $0.01532
Opus 5 $0.00068 $0.00766
Sonnet 5 $0.00027 $0.00306
Haiku 4.5 $0.00014 $0.00153

Measured 9d ago against content hash 593575ddd936, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-15, from the pricing page.

Security

Grade A, and why

trim 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 9d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/measure-context.ts), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

Packs/harness/skills/trim/SKILL.md · 116 lines

How it starts

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

trim

Every byte in an always-on file is paid on every session, forever. This skill measures that cost, removes what is provably dead, and then makes the judgment calls one at a time in front of the person whose rules they are.

Adapted from the Trim skill in LifeOS by Daniel Miessler (https://github.com/danielmiessler/LifeOS), MIT.

Procedure

Copy this checklist and track progress:

- [ ] 1. Measure
- [ ] 2. Make the edit reversible
- [ ] 3. Remove what is provably dead
- [ ] 4. Propose the semantic moves, one at a time
- [ ] 5. Run the safety gate
- [ ] 6. Re-measure and report

1 — Measure. Never start from an impression of which file is too big.

bun scripts/measure-context.ts --root "$PWD"

It resolves the always-on set — ~/.claude/CLAUDE.md, the project CLAUDE.md and AGENTS.md, every @-import they pull in, and the memory index for this project — and reports bytes, an approximate token count, the largest sections, dead pointers and directives duplicated across two always-on files. Show the totals to the user before proposing anything. Without a target size, "smaller" has no end.

2 — Make it reversible. Before the first edit:

  • The file is in a git repository — check git status --short on that path. Clean means the repository is the undo. Dirty means say so and ask before touching it; a trim mixed into somebody else's uncommitted work cannot be reverted on its own.
  • The file is not in a repository — this is the normal case for ~/.claude/CLAUDE.md. Copy it to <file>.bak-<UTC timestamp> and print the exact cp command that restores it. Do this once, before the first edit, not per move.

3 — Remove what is provably dead. These need no judgment, so they are free. Take them all before proposing anything that costs attention:

  • Dead pointers. A rule that points at a file which no longer exists has no reader. Delete the rule, or repair the pointer when the file merely moved — say which, and how you checked.
  • Duplicated directives. A line loaded by two always-on files is paid twice. Keep the copy in the narrower scope, delete the other, and say which one survived.
  • Rules about things that no longer exist. A tool, a path, a service, a workflow that is gone. Check before claiming it: ls, the repository, the deployment ledger. An unverified "this looks obsolete" is not a deterministic removal, it is a semantic one, and it belongs in step 4.

Read the full file on GitHub · 116 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. 9d ago First seen · 116 lines · 136 tokens per session scan A 593575ddd936

Subscribe to this mod's changes

trim is a skill published in the GitHub repository larsboes/Axon (1 stars, last pushed yesterday), licensed MIT. It adds 136 tokens to every session and 1,532 once invoked, about $0.0007 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-07.

Related

Other skills, from other repositories

reflect

Use Recall Reflect to review AI coding workflow history as a conversation-first timeline and discuss observed patterns before changing behavior. Trigger when the user asks to reflect on a project, review AI coding workflow, inspect workflow friction, discuss repeated corrections, review handoffs, or explore possible…

samzong/Recall · 57 tokens

notion

Read, create, and update Notion pages and databases via the Notion REST API.

taracodlabs/aiden · 20 tokens

any-mcp

Use when an agent needs to read, search, create, edit, organize, upload, or chat with Anytype through the bounded any-mcp server. Covers safe tool selection, exact identifier chaining, optional toolsets, common PKM workflows, and the narrow anyr fallbacks for chat subscriptions and rich chat blocks.

stevelr/anytype · 68 tokens

yaps-dictation

Set up, use, diagnose, or recover system-wide Yaps voice dictation for Claude Code, Codex, and other desktop apps. Trigger for voice typing, speech input, hands-free writing, dictating into an AI client, routing dictation through Yaps, fixing a Yaps microphone/shortcut/paste problem, or recovering a recent Yaps…

richawo/yaps-codex-plugin · 103 tokens

recap

Summarize the last N agent sessions for the current project, grouped by date, with highlight observations per session. Use when the user asks "recap", "what have we been doing", "today", "this week", or wants a rollup of recent work.

M-T-D-N/agentmemory-codex-windows · 58 tokens

alcove-hub

Use when working from the Alcove hub workspace or routing personal knowledge, pins, projects, prompts, tasks, mounts, connectors, or managed KB operations.

OctopusGarage/alcove · 36 tokens