Trim
/Trim
Shrinks an always-on LifeOS context file through a human-gated pass: deterministic GC of stale entries, then semantic merges and relocations, never dropping a directive. USE WHEN /trim, trim the context, trim OPERATIONAL_PREFERENCES, this file is too big, reduce a doctrine file, prune an always-loaded file, fold the proposal inbox, shrink CLAUDE.md or DA_IDENTITY. NOT FOR code refactoring, trimming audio or video media (AudioEditor for audio), removing AI patterns from prose.
- Author
- danielmiessler ↗
- Repository
- personal_ai_infrastructure ↗
- Licence
- MIT
- Last repository change
- 05.11.2026
Assessment and security
- Files in this package
- 4
- Scripts
- 1
- HTML comments
- 0
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 05.11.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
- 1 scripts in this package. Review them before installing, as Claude may execute them.
Scripts: Tools/Coverage.ts
What it does and when to use it
Shrinks an always-on LifeOS context file through a human-gated pass: deterministic GC of stale entries, then semantic merges and relocations, never dropping a directive. USE WHEN /trim, trim the context, trim OPERATIONAL_PREFERENCES, this file is too big, reduce a doctrine file, prune an always-loaded file, fold the proposal inbox, shrink CLAUDE.md or DA_IDENTITY. NOT FOR code refactoring, trimming audio or video media (AudioEditor for audio), removing AI patterns from prose.
Original author description
Shrinks an always-on LifeOS context file through a human-gated pass: deterministic GC of stale entries, then semantic merges and relocations, never dropping a directive. USE WHEN /trim, trim the context, trim OPERATIONAL_PREFERENCES, this file is too big, reduce a doctrine file, prune an always-loaded file, fold the proposal inbox, shrink CLAUDE.md or DA_IDENTITY. NOT FOR code refactoring, trimming audio or video media (AudioEditor for audio), removing AI patterns from prose.
How it works
- Ideal State
- Intent Routing
- Data & Config
- Gotchas
- Examples
SKILL.md preview
---
name: Trim
evals:
manual:
reason: "a context reduction must be reviewed for preserving every distinct directive while improving the supplied file"
falsifier: "the reviewer finds a distinct directive, safety requirement, or required reference lost in the trimmed result"
metadata:
short-description: "Reduce oversized always-on context through approved merges and relocations while preserving directives. Excludes code refactoring and media trimming."
version: 1.1.3
description: Shrinks an always-on LifeOS context file through a human-gated pass: deterministic GC of stale entries, then semantic merges and relocations, never dropping a directive. USE WHEN /trim, trim the context, trim OPERATIONAL_PREFERENCES, this file is too big, reduce a doctrine file, prune an always-loaded file, fold the proposal inbox, shrink CLAUDE.md or DA_IDENTITY. NOT FOR code refactoring, trimming audio or video media (AudioEditor for audio), removing AI patterns from prose.
---
# 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.
## Examples
```
User: "/trim OPERATIONAL_PREFERENCES"
→ Trim intent
→ OPERATIONAL_PREFERENCES 40,456 → 28,043 B (−31%). ProposalGC found 0 removable; the human picked
folding the 40-entry proposal tail and relocating skill-scoped directives to a reference;
committed alone to USER_DATA.
User: "/trim"
→ Trim intent
→ No arg, so the largest file in the always-on set by `wc -c` is trimmed the same way.
```
Files in this package (4)
- SKILL.md 4 KB
- Intents/Trim.md 6 KB
- Tools/Coverage.help.md 2 KB
- Tools/Coverage.ts 3 KB
Versions
| Repository | Score | Licence |
|---|---|---|
| This page · danielmiessler/personal_ai_infrastructure | 95 | MIT |
| danielmiessler/LifeOS | 95 | MIT |
Database snapshot: 13.11.2026 · package version e998bb62f0bb (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 90slim-claude-md
Shrinks a bloated CLAUDE.md that is loaded into every session by moving its history and status notes, word for word, into topic files under docs/notes/ and leaving a short CLAUDE.md with the always-needed rules plus an index. Verifies line by line that nothing was lost and keeps… - 100agents-md-lint
Audit and trim AI agent instruction files (AGENTS.md, CLAUDE.md, CONVENTIONS.md, .cursorrules, etc.) by testing which facts an AI agent can discover from code alone. Use when asked to lint, audit, optimize, prune, or trim any agent instruction file in a repository. Removes… - 100harness-diet
Measure and shrink the always-loaded context of a Claude Code harness (CLAUDE.md + rules without paths frontmatter) back under budget — migrate narrative to reference files, convert rules to path-scoped or skill-triggered loading, and verify zero governance loss with… - 90writing-project-instructions
Use when authoring, editing, updating, trimming, or adding rules to a CLAUDE.md, AGENTS.md, CLAUDE.local.md, or other project-level instruction file for an AI coding agent — including small one-line changes. Triggers on "write a CLAUDE.md", "audit my CLAUDE.md", "trim my… - 84write-for-agents
Write or trim agent-consumed markdown: CLAUDE.md or AGENTS.md content, .claude/rules files, agent-loaded reference docs, navigation pointers, and doc-plus-pointer extractions. Use when: 'add this to CLAUDE.md', 'trim this AGENTS.md', 'cut it down to what earns its place', 'prune… - 90honey-compress
Rewrite a memory or context file (CLAUDE.md, AGENTS.md, a todo or notes file) into Honey-terse form so it costs fewer input tokens every session, without losing meaning. Backs up the original first. Use when asked to shrink or compress context files, trim CLAUDE.md, or cut…