trim-context
Trim CLAUDE.md and AGENTS.md files to reduce context cost. Apply the "less is more" finding from empirical research on agentic coding context files. Use when user says "trim our context files", "lean up CLAUDE.md", "optimize our agents.md", "reduce context", "our CLAUDE.md is too long", or asks to audit instruction files for bloat.
What this skill does
# Context File Trimmer
Apply research-backed pruning to CLAUDE.md and AGENTS.md files. The core finding from ETH Zurich / LogicStar.ai (2025): LLM-generated context files reduce task success by ~3% and increase inference cost by 20%+. Agents treat every instruction as a constraint, making tasks harder. The fix is ruthless removal.
See [references/research.md](references/research.md) for the evidence base.
## The Rule
**Only include what the agent cannot discover by reading the codebase.**
If the agent can find it in `package.json`, `go.mod`, a README, directory listing, or any committed file, it does not belong in CLAUDE.md.
## Step 1: Find all context files
```bash
find . -name "CLAUDE.md" -o -name "AGENTS.md" -o -name ".claude.local.md" 2>/dev/null | grep -v node_modules | grep -v ".git"
```
Also check `~/.claude/CLAUDE.md` for the global file.
## Step 2: Classify each section
For every section in every file, ask: **can the agent discover this from the repo?**
| Category | Discoverable? | Action |
|---|---|---|
| Stack / tech descriptions ("Go + PocketBase", "SvelteKit 2 + Svelte 5") | Yes, from go.mod / package.json | Remove |
| Project structure / directory listing | Yes, by listing dirs | Remove |
| Product description / what the app does | Yes, from README | Remove |
| Conventions that duplicate another CLAUDE.md | Yes, from parent file | Remove |
| Build and run commands | No | Keep |
| Tooling quirks and non-obvious constraints | No | Keep |
| Non-obvious naming conventions / patterns | No | Keep |
| Environment variable requirements | No | Keep |
| Things the agent repeatedly gets wrong | No | Keep |
## Step 3: Flag duplicates across files
Check whether conventions in a project CLAUDE.md duplicate those in `~/.claude/CLAUDE.md`. If they're already in the global file, remove from the project file.
## Step 4: Report before cutting
Present a list of proposed removals with one-line justifications:
```
REMOVE: Stack section (go.mod + package.json already tell the agent this)
REMOVE: Project structure (agent lists dirs autonomously)
REMOVE: Conventions section (duplicates ~/.claude/CLAUDE.md lines 18-24)
CONDENSE: Playwright warning → 1 line (full detail only needed when bumping versions)
KEEP: Commands section (not discoverable)
KEEP: Nix quirks (not discoverable from any file)
```
Show estimated token savings.
## Step 5: Apply after approval
Use the Edit tool to apply each cut. Preserve structure and order of what remains.
## What lean looks like
A well-trimmed CLAUDE.md typically contains:
- Commands (build, test, dev, eval)
- One-liner warnings for non-obvious tooling constraints
- Workflow steps the agent cannot infer (optimization loops, release steps)
- Specific env vars or config paths that aren't in .env.example
It does NOT contain: stack overview, directory map, product description, generic coding conventions.
Related in Security
mac-ops
IncludedComprehensive macOS workstation operations — diagnose kernel panics, identify failing drives, audit launchd startup items, decode wake reasons, triage TCC permission denials, manage APFS snapshots, recover from no-boot. Use for: Mac is slow, slow bootup, won't boot, kernel panic, kernel_task hot, mds_stores CPU, photoanalysisd, cloudd, login loop, gray screen, sleep wake failure, drive failing, IO errors, APFS snapshots eating space, Time Machine local snapshots, Spotlight indexing, launchd, LaunchAgent, LaunchDaemon, login items, TCC permissions, Full Disk Access, Screen Recording denied, Gatekeeper, quarantine, com.apple.quarantine, app is damaged, helper tool, /Library/PrivilegedHelperTools, pmset, wake reasons, dark wake, sysdiagnose, panic.ips, DiagnosticReports, configuration profile, MDM profile, remote diagnostics over SSH.
a11y-audit
IncludedRun accessibility audits on web projects combining automated scanning (axe-core, Lighthouse) with WCAG 2.1 AA compliance mapping, manual check guidance, and structured reporting. Output is configurable: markdown report only, markdown plus machine-readable JSON, or markdown plus issue tracker integration. Use this skill whenever the user mentions "accessibility audit", "a11y audit", "WCAG audit", "accessibility check", "compliance scan", or asks to check a web project for accessibility issues. Also trigger when the user wants to verify WCAG conformance or map findings to a specific standard (CAN-ASC-6.2, EN 301 549, ADA/AODA).
erpclaw
IncludedAI-native ERP system with self-extending OS. Full accounting, invoicing, inventory, purchasing, tax, billing, HR, payroll, advanced accounting (ASC 606/842, intercompany, consolidation), and financial reporting. 413 actions across 14 domains, 43 expansion modules. Constitutional guardrails, adversarial audit, schema migration. Double-entry GL, immutable audit trail, US GAAP.
assess
IncludedAssesses and rates quality 0-10 across multiple dimensions (correctness, maintainability, security, performance, testability, simplicity) with pros/cons analysis. Compares against project conventions and prior decisions from memory. Produces structured evaluation reports with actionable improvement suggestions. Use when evaluating code, designs, architectures, or comparing alternative approaches.
spring-boot-security-jwt
IncludedProvides JWT authentication and authorization patterns for Spring Boot 3.5.x covering token generation with JJWT, Bearer/cookie authentication, database/OAuth2 integration, and RBAC/permission-based access control using Spring Security 6.x. Use when implementing authentication or authorization in Spring Boot applications.
code-hardcode-audit
IncludedDetect hardcoded values, magic numbers, and leaked secrets. TRIGGERS - hardcode audit, magic numbers, PLR2004, secret scanning.