Trim

Trim is a skill for Claude Code, Codex from danielmiessler/LifeOS. It costs 0 tokens per session (919 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

Written for no agent in particular: nothing here depends on one. Also seen: reads .claude/ paths; mentions CLAUDE.md.

Good fit Use it to clean up operational rules, merge overlapping guidance, shorten verbose entries, and move rarely used details into references.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/danielmiessler/lifeos/trim
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 · 19,631 stars · on GitHub · ourlifeos.ai

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 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/github.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/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/danielmiessler/lifeos/trim"><img src="https://agentmods.dev/badge/skills/danielmiessler/lifeos/trim.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 919 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 pass 7 Sept 2026
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.00000 $0.00919
Opus 5.5 $0.00000 $0.00368
Sonnet 5.5 $0.00000 $0.00184
Haiku 4.5 $0.00000 $0.00092

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

The scan reads SKILL.md. This mod also ships 1 executable file (Tools/Coverage.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.

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

How it starts

The opening of the file, as written. The whole thing — 55 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.

Ideal State

  • The trimmed file is measurably smaller by a re-run wc -c, and every distinct directive from the original still compels the same behavior.
  • Every removal LIFEOS/TOOLS/ProposalGC.ts can make deterministically is made by it rather than by judgment, and every semantic MERGE, TIGHTEN or RELOCATE is one the human picked.
  • The trim lands as its own commit in the repo that actually holds the file.

Intent Routing

Intent Trigger File
Trim /trim <file>, "trim OPERATIONAL_PREFERENCES", "this file is too big", "reduce a doctrine file", "fold the proposal inbox" Intents/Trim.md

Data & Config

Trim needs no Config.md. Everything it reads and writes is named here, with paths relative to the install root (CLAUDE_CONFIG_DIR, default ~/.claude).

  • The always-on set it measures and edits: the system prompt LIFEOS/LIFEOS_SYSTEM_PROMPT.md, CLAUDE.md, every @-import listed at the top of CLAUDE.md (the identity and operational-rules files under LIFEOS/USER/), and the hook-injected memory files LIFEOS/USER/PRINCIPAL/PRINCIPAL_MEMORY.md and LIFEOS/USER/DIGITAL_ASSISTANT/DA_MEMORY.md. The set is read from CLAUDE.md each run, never hardcoded.
  • The two commit repos: files under LIFEOS/USER/** commit to the private USER_DATA repo at ~/.config/LIFEOS/USER (the target of the LIFEOS/USER symlink); every other file commits to the install-root repo ~/.claude on main.

Gotchas

  • USER files commit to the USER_DATA repo, not ~/.claude. The commit tool in the intent's Tool contract follows the LIFEOS/USER symlink and commits there; a ~/.claude commit captures nothing under LIFEOS/USER/ and is a false safety net.
  • The file can change mid-edit. The autonomic memory loop appends proposals to these files while you work. When a Write or Edit reports "modified since read", re-read before writing, because a concurrent correction may have landed; this is how a real deploy-command fix was nearly reverted. Never write from a stale read.
  • Orchestrate ProposalGC, never reimplement it. Its free, zero-risk removals often clear enough that no judgment-call edit is needed.

Read the full file on GitHub · 55 lines

Files

What ships with it

3 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. yesterday Changed · +3 lines · -124 tokens per session 1ff546d45ca8
  2. 1mo ago 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 (19,631 stars, last pushed yesterday), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 919 tokens. 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

wiki-dashboard

Create dynamic, queryable Obsidian dashboard views using Bases or Dataview. Use for auto-updating tables, indexes, or structured views of vault content; not for ordinary question answering.

Ar9av/obsidian-wiki · 42 tokens

session-compact

AI DevKit · Compact a historical AI coding session with Jev when context is long, work is handed off or resumed, or durable continuation facts and memory candidates need extraction.

codeaholicguy/ai-devkit · 39 tokens

company-brain

Your team's shared, AI-ready knowledge base — people, companies, meetings, SOPs, and decisions structured so an agent can answer on your team's behalf. Team-scope sibling to second-brain — personal notes go there, not here. Modes — capture, compile (wiki pages + INDEX.md), query (trust-weighted, saved to outputs/)…

coreyhaines31/makerskills · 230 tokens

claude-reflect

Self-learning system that captures corrections during sessions and reminds users to run /reflect to update CLAUDE.md. Use when discussing learnings, corrections, or when the user mentions remembering something for future sessions.

BayramAnnakov/claude-reflect · 46 tokens

context-shunt

Offload large / multi-file reads to a cheap worker model so raw files never enter Claude's context (token savings).

alinaqi/maggy · 28 tokens

cortex-profile

View and manage your cognitive profile — how you think, work patterns, blind spots, and cross-domain connections. Use when the user says 'show my profile', 'how do I work', 'what are my patterns', 'cognitive style', 'blind spots', 'methodology', or at the start of a session to load context. Also use 'rebuild profile'…

cdeust/Cortex · 98 tokens