Guide · Agent skill
How to use the Trim Always-On Context agent skill
Updated · written with AI from the project's own documentation and checked against our catalogue data
Trim is an agent skill for shrinking a context file that an AI agent loads at the start of every session, such as operational preferences, identity rules, or CLAUDE.md, when it has grown too large. It works in a reviewed pass: it removes stale entries with a deterministic script first, then proposes merges, tightenings, and relocations that you approve one at a time. This guide covers what the skill does, how to install it, how to trigger it, and what it needs before you run it.
Quick start
- 1Download the ZIP. Download the Trim skill ZIP from this page.
- 2Unzip into a skills folder. Extract it into ~/.claude/skills/ for a personal install, or into a project's .claude/skills/ folder.
- 3Confirm the requirements. Make sure Bun is installed and that your LifeOS install includes ProposalGC with git-tracked USER_DATA and ~/.claude repositories.
- 4Start a trim. Run /trim with a file name, or describe the problem in plain language.
- 5Review the starting state. Check the byte count and the per-section breakdown the skill shows before any edit.
- 6Approve changes one at a time. Accept or reject each merge, tightening, or relocation, and check that no distinct directive is lost.
- 7Verify the result. Confirm the new wc -c figure and check the commit landed in the correct repository.
What is an agent skill, and what does Trim do?
An agent skill is a folder of instructions and optional scripts that an AI agent can load when a request matches the skill's purpose. Trim is designed for one job: reducing an always-on context file without losing any of its rules.
Its description says it is a human-gated pass. Deterministic garbage collection of stale entries runs first, then semantic merges and relocations are proposed. The skill is instructed never to drop a distinct directive, and the trimmed result is committed to the repository that holds the file.
- Measures the file in bytes with wc -c before and after the trim.
- Runs the ProposalGC tool for removals it can make mechanically, rather than judging them itself.
- Presents each merge, tightening, or relocation for you to approve.
- Checks that merged or tightened text kept the load-bearing tokens of the original.
Install the Trim skill from the ZIP download
Download the Trim skill as a ZIP from this page, then unzip it into a skills folder. For a personal install, use ~/.claude/skills/. To limit it to one project, place it in that project's .claude/skills/ folder.
If you use the Claude apps instead, you can upload the skill under Settings → Capabilities → Skills.
- Personal install: unzip into ~/.claude/skills/ so the Trim folder sits there.
- Project install: unzip into the project's .claude/skills/ folder.
- Claude apps: upload the skill under Settings → Capabilities → Skills.
Check the requirements before you run it
Trim is not a standalone app. It assumes a LifeOS install with the ProposalGC tool and with the user data and ~/.claude folders tracked in git. The coverage script is run with Bun, so Bun must be installed.
If your context files are not in a git-tracked LifeOS-style setup, the commit and path behaviour described by the skill will not match your environment.
- Bun runtime, because the coverage script is run with bun.
- A LifeOS install that includes the ProposalGC tool.
- Git-tracked USER_DATA and ~/.claude repositories.
- Runs scripts: yes. Uses network: no.
bun ~/.claude/skills/Trim/Tools/Coverage.ts <original-file> <replacement-file>How to trigger Trim with a natural request
You can invoke Trim with the /trim command followed by a file name, or describe the problem in plain language. The skill recognises phrases such as 'this file is too big', 'trim the context', 'reduce a doctrine file', and 'shrink CLAUDE.md'.
If you give no file name, the skill picks the largest file in the always-on set by byte count. Matching is done by basename.
- /trim OPERATIONAL_PREFERENCES
- trim the context
- this file is too big
- shrink CLAUDE.md or DA_IDENTITY
- fold the proposal inbox
/trim OPERATIONAL_PREFERENCESWalk through an example trim
In the documented example, a run on OPERATIONAL_PREFERENCES went from 40,456 bytes to 28,043 bytes, a 31 percent reduction. ProposalGC found nothing it could remove on its own, so the human chose to fold a 40-entry proposal tail and relocate skill-scoped directives to a reference file. That change was committed alone to USER_DATA.
The skill reports the starting state, shows where the bytes sit, and lists semantic changes ranked by estimated bytes saved times safety. Relocations and tightenings rank above merges.
- Starting size and the target reduction are shown before any edit.
- Deterministic removals are applied only after you approve them.
- Each semantic change shows the exact target text and estimated savings.
- A fresh wc -c runs after the edits to confirm the result.
Safety notes: scripts, files and commits
Trim runs scripts, so read the SKILL.md and Tools folder before you install it into an environment you care about. It does not use the network. Review every proposed change, because the skill cannot guarantee that a rule is preserved; it relies on your review, and a lost directive is the failure it is built to prevent.
User files under LIFEOS/USER commit to the private USER_DATA repo at ~/.config/LIFEOS/USER, not to ~/.claude. A commit in ~/.claude will not capture changes under LIFEOS/USER, so check where the commit landed.
- Back up the file or make sure it is committed before the run.
- Re-read a file if an edit reports it was modified since it was read, since the memory loop can append to it.
- Do not use Trim for code refactoring, audio or video trimming, or removing AI writing patterns from prose.
What people use it for
- Shrinking an OPERATIONAL_PREFERENCES file that has grown past a comfortable size for every session.
- Folding a long proposal inbox into the main file after a review.
- Reducing a doctrine or identity file such as DA_IDENTITY while keeping every rule.
- Trimming CLAUDE.md when its @-imported files have accumulated duplicate guidance.
Frequently asked questions
Is the Trim agent skill free?
The skill is published under the MIT licence, as stated on this page. Check the licence file in the repository for the full terms.
What do I need to run the Trim skill?
You need the Bun runtime, a LifeOS install that includes the ProposalGC tool, and git-tracked USER_DATA and ~/.claude repositories. The skill also needs to run scripts.
Where do I install the Trim skill?
Unzip it into ~/.claude/skills/ for personal use or into a project's .claude/skills/ folder for one project. In the Claude apps you can upload it under Settings → Capabilities → Skills.
Will Trim delete important rules from my file?
The skill is instructed never to drop a distinct directive, and it asks you to approve each judgment call. You should still review the result, because the skill relies on that review to catch lost rules.
Can Trim shrink code or audio files?
No. Trim is not for code refactoring, audio or video trimming, or removing AI writing patterns from prose. The description points to AudioEditor for audio work.
Does Trim need an internet connection?
The source says it does not use the network. It runs local scripts and edits local files.
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
Trim suits people who run the LifeOS framework or keep large always-loaded preference and identity files in git, and who want a reviewed process for cutting size without losing rules. If you do not have that setup, or you need code refactoring or media editing, choose a different tool.
Download the skill