Skip to main content
skill CX Codex

trim-agent-setup — Claude Code skill: audit and install

The trim-agent-setup Claude Code skill checks which setup files recorded agent sessions read and how many tokens they consume. It helps identify unused rules and trim loaded instructions.

MIT ★ 149 updated 2026-11-16

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add jackulau/coding.sh --skill trim-agent-setup -a claude-code
Open on GitHub

What trim-agent-setup does

trim-agent-setup calls harness_audit through the coding.sh MCP server to inspect sessions recorded on the machine and instruction files on disk. By default, it covers the last 30 days; pass since, such as 90d, to choose another window.

The report gives file token counts, load, read and write totals, and flags files that were never read, only written, or loaded without being used. The skill suggests files to remove or shorten, but makes no changes before approval. A short time window can miss files used rarely.

After edits, a second audit with check: true compares uncommitted changes with the last commit and flags safety rules that were weakened or removed. The result may also offer a coding.sh refine run command to test a shorter file against an eval suite; running it takes minutes.

What it helps with

  • find instructions and skills that sessions never read
  • measure token costs for loading setup files
  • trim oversized AGENTS.md or CLAUDE.md files
  • check edits for removed safety rules

Example prompts for the agent

  • Audit my agent setup and find files that sessions never read.
  • Measure token costs and suggest cuts to AGENTS.md.
  • Repeat the audit for 90d and find skills that went unused.

How to install trim-agent-setup

1Skills CLI (Vercel)

npx skills add jackulau/coding.sh --skill trim-agent-setup -a claude-code

2Manually: put the files in place

~/.claude/skills/trim-agent-setup/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/trim-agent-setup/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about trim-agent-setup

How do I install trim-agent-setup in Claude Code?

Run npx skills add jackulau/coding.sh --skill trim-agent-setup -a claude-code. The skill file is placed at ~/.claude/skills/trim-agent-setup/SKILL.md.

What does trim-agent-setup do?

It analyzes recorded sessions and instruction files, reporting what agents read or wrote and the token cost of loading files. It proposes edits but waits for approval before changing anything.

What does trim-agent-setup need to run?

It needs the coding.sh MCP server to call harness_audit. The audit reads sessions recorded on the machine and instruction files on disk.

Source text

SKILL.md · MIT
---
name: trim-agent-setup
description: "Finds the memory files, instruction files, rules and skills that recorded agent sessions never read, and what the files they load cost in tokens, then helps remove or shorten them safely. Use when the user asks to trim or audit their agent setup, shorten AGENTS.md or CLAUDE.md, cut context or token cost, or find unused skills and memory files."
license: MIT
---

# Trim the agent setup

Uses the coding.sh MCP server's `harness_audit` tool. It reads sessions recorded on this machine
and the instruction files on disk, and changes nothing.

## Steps

1. Call `harness_audit`. Pass `since` when the user names a window, such as `90d`. The default is
   30 days.
2. Read `files`. Each has its size in `tokens`, how many sessions `loaded`, `read` and `wrote` it,
   and `flags`. List the flagged files first:
   - `never-read`: no session loaded it or read it.
   - `write-only`: sessions wrote it and none read it back.
   - `loaded-not-read`: a skill that was listed in context and never used.
3. Then give what loading costs: `loadTokensPerSession` for the whole setup, and the files with the
   largest `loadTokens`, which is what loading that file cost over the whole window. These are
   files to shorten, not to delete.
4. Propose what to delete or shorten. Change nothing until the user says yes.
5. After the edits, call `harness_audit` with `check: true`. It compares the uncommitted edits with
   the last commit. `check.rejections` lists each protected safety line that was deleted, reworded
   or relaxed. Show each one and put it back unless the user asked for that removal. This result's
   `next` is the command that allows the removal: give it only when the user wants that.
6. The result of step 1 can have `next`: a `coding.sh refine run` command that tests a shorter file
   on an eval suite. Give it to the user to run, because it takes minutes. When that result also
   has `note`, there is no suite to test on yet: tell the user that instead.

## Rules

- A file the sessions never read can still be loaded on purpose. Ask before removing a rule that
  forbids something, such as a line about force pushes or secrets.
- A short window hides files that are used rarely. Before deleting a skill, run the audit again
  with a longer `since`.
- Delete nothing yourself that the user did not agree to in this conversation.

© jackulau · MIT · jackulau/coding.sh

Similar skills

All skills for Agent setup: memory, context, orchestration →

From the same set4

Project sponsors

Companies that keep this analytics open