Trim

Trim is a skill for Claude Code, Codex from danielmiessler/LifeOS. It costs 124 tokens per session (946 once invoked), scanned A, original, MIT.

A human-reviewed process for reducing the size of a persistent context or rules file without removing distinct instructions.

In plain words
What is it for?
Use it to clean up operational rules, merge overlapping guidance, shorten verbose entries, and move rarely used details into references.
Why use it?
It helps keep always-loaded guidance manageable while preserving important rules and making stale or duplicated entries easier to remove.

Skill for Claude CodeCodex

About the project

LifeOS is an AI-assisted personal operating system that records a person’s goals, values, context, and current situation to help move them toward a desired future state. It supports work such as building applications, starting businesses, and creative projects. Its catalogue entries extend the system through skills, hooks, agents, and commands.

danielmiessler/LifeOS · 18,885 stars · on GitHub

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/danielmiessler/lifeos/trim
Any agent
npx skills add danielmiessler/LifeOS --skill trim
Clone the repo
git clone --depth 1 https://github.com/danielmiessler/LifeOS

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 Trim

README.md
[![agentmods](https://agentmods.dev/badge/skills/danielmiessler/lifeos/trim.svg)](https://agentmods.dev/skills/danielmiessler/lifeos/trim)
Your own site
<a href="https://agentmods.dev/skills/danielmiessler/lifeos/trim"><img src="https://agentmods.dev/badge/skills/danielmiessler/lifeos/trim.svg" alt="Measured on agentmods" height="20"></a>
Per session 124 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 946 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.00124 $0.00946
Opus 5 $0.00062 $0.00473
Sonnet 5 $0.00025 $0.00189
Haiku 4.5 $0.00012 $0.00095

Measured yesterday against content hash e59b29f60fe0, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 yesterday.

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.

LifeOS/install/skills/Trim/SKILL.md · 52 lines

How it starts

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

Trim

Shrink an always-on context file that has gotten too big. /trim <file> walks the reduction, safest cuts first, never dropping a rule.

Workflow Routing

Trigger Workflow
/trim <file>, "trim OPERATIONAL_RULES", "this file is too big", "reduce a doctrine file", "fold the proposal inbox" Workflows/Trim.md

Quick Reference

  • Target resolution: a bare name (OPERATIONAL_RULES) resolves against the always-on set — the system prompt, CLAUDE.md, its @-imports, and the hook-injected memory files. No arg → wc -c that set and take the largest.
  • Order is safest-first: (1) show state, (2) deterministic GC (zero-risk), (3) semantic trims (human-gated), (4) safety gate, (5) re-measure. Full steps: Workflows/Trim.md.
  • One tool it orchestrates — never reimplement: LIFEOS/TOOLS/ProposalGC.ts (removes superseded/duplicate/absorbed entries). Sizes come from wc -c.
  • Three semantic moves: MERGE overlapping rules, TIGHTEN verbose ones, RELOCATE rarely-used detail to an on-demand reference (leave a stub + pointer).
  • The invariant: a trim never drops a distinct directive. If a merge would, keep the original.

Gotchas

  • USER files commit to the USER_DATA repo, not ~/.claude. LIFEOS/USER/** (OPERATIONAL_RULES, PROJECTS, the identity files) is a symlink into a separate private repo. Commit with git -C ~/.config/LIFEOS/USER …. A ~/.claude commit captures nothing under LIFEOS/USER/ — a false safety net.
  • The file can change mid-edit. The autonomic memory loop appends proposals to these files while you work. If a Write/Edit reports "modified since read", RE-READ before writing — a concurrent correction may have landed (this is how a real deploy-command fix was nearly reverted). Never write from a stale read.
  • Semantic merges must never drop a directive. Before applying any merge/tighten, confirm every proper noun, path, tool name, and imperative from the originals survives in the result. If one is missing, the merge is wrong — keep the original. Deterministic GC (superseded/dup/absorbed) is always safe; semantic edits are the risky class.
  • bun/bunx only, never npm/npx.
  • Deterministic first, always. Run ProposalGC before proposing any semantic edit — the free, zero-risk removals often clear enough that no judgment-call edit is needed.

Read the full file on GitHub · 52 lines

Files

What ships with it

1 file 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. yesterday First seen · 52 lines · 124 tokens per session scan A e59b29f60fe0

Subscribe to this mod's changes

Trim is a skill published in the GitHub repository danielmiessler/LifeOS (18,885 stars, last pushed yesterday), licensed MIT. It adds 124 tokens to every session and 946 once invoked, about $0.0006 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

auto-perf-optimize

Run agent-driven VS Code performance or memory investigations. Use when asked to launch Code OSS, automate a VS Code scenario, run the Chat memory smoke runner, capture renderer heap snapshots, take workflow screenshots, compare run summaries, or drive a repeatable scenario before heap-snapshot analysis.

microsoft/vscode · 62 tokens

personal-assistant

A personalized assistant that remembers your preferences.

NVIDIA/SkillSpector · 11 tokens

daily-briefing

Proactive daily briefing that fires on a recurring schedule, pulls recent memory and workspace context, composes a structured summary (action items, progress, radar, next steps), and delivers it to all active channels. Enable with a time like "set up my daily briefing at 9am". Disable, reschedule, or check status at…

vellum-ai/vellum-assistant · 75 tokens

company-brain

Your team's shared, AI-ready knowledge base — people, companies, meetings, SOPs, and decisions structured so Claude can answer questions on your team's behalf. Team-scope sibling to second-brain (which is personal-scope). Seven modes — capture (drop something into the right structured dir), compile (process into wiki…

coreyhaines31/makerskills · 322 tokens

relevance-coarse-filter

Cheap, high-recall first-pass filter that removes obvious junk from a detector candidate pool before expensive story-origin research and PR judgment. Decides keep, monitoronly, or reject — never ranks, writes angles, verifies dates, or decides whether to pitch.

elvisun/newsjack · 57 tokens

note

Use when the user says 'jot this down', 'note to self', 'just thinking out loud', or 'park this thought' — saves a private personal note, never shared or pushed until explicitly promoted.

egregore-labs/egregore · 45 tokens