Trim Context — Development skill for Claude Code
Find and fix sources of Claude Code "token bloat" in a repo — oversized CLAUDE.md (vs the 40k-char limit), bloated memory files, large always-loaded files, and .claude/ cruft — then auto-apply the fix.
How to install Trim Context
Installs to ~/.claude/skills/ksdisch-claude-config-trim-context/SKILL.md
mkdir -p ~/.claude/skills/ksdisch-claude-config-trim-context && curl -fsSL https://raw.githubusercontent.com/ksdisch/claude-config/HEAD/commands/trim-context.md -o ~/.claude/skills/ksdisch-claude-config-trim-context/SKILL.md Restart Claude Code, or start a new session, for it to be picked up.
What Trim Context does
description: Find and fix sources of Claude Code "token bloat" in a repo — oversized CLAUDE.md (vs the 40k-char limit), bloated memory files, large always-loaded files, and .claude/ cruft — then auto-apply the fixes. Optionally sweeps every repo under a parent dir. Run at a repo root, or pass a repo path / repos root. argument-hint: [optional: a repo path, or a parent dir like ~/Projects to sweep all repos under it] allowed-tools: Bash, Read, Edit, Glob, Grep
Target (optional): $ARGUMEN
Alternatives in Development
- Om Tidy — Self-maintenance pass — acts on every hygiene flag: archives completed work, groups loose clusters, splits ove 4.6k ★
- Clauditor — Stop Claude Code from burning through your quota in 20 minutes 367 ★
- Working Memory — This is your working memory 192 ★
Full documentation available on GitHub
View Source RepositoryRelated Skills
Opencode Large Image Optimizer
OpenCode plugin that automatically optimizes oversized images to prevent context window bloat and API errors
Cruft Sweep
Scan for reclaimable scratch and orphans; apply only if confirmed.
Init Rules
Scaffold opt-in path-scoped nested CLAUDE.md rule files into the project to lazy-load per-area conventions whi
Decision Kernel
Distil how you make decisions from your Claude Code history into an always-loaded CLAUDE.md kernel. Local, ver
Always Loaded Diet
Discipline for the files your agent loads every session (CLAUDE.md, MEMORY.md): one nightly writer, measured b
Knowledge Base Rules
Always-on. Knowledge-base consultation discipline. Projects declare their knowledge sources in PROJECT.md; age
Related Agents
Size Purist
The merciless executioner of bloated files. Use this agent to find oversized files, god classes, mega-componen
Mb Context Doctor
Diagnoses CLAUDE.md and .claude/ bloat. Runs token counts, identifies what's redundant or stale, and proposes
Flutter Refactorer
Use to improve existing code structure without changing behavior. Splits oversized Blocs, extracts widgets, ti