---
name: Paleo Trim Context
slug: paleo-trim-context
category: AI Engineering
description: Automatically trim, summarize, or drop stale content from the context window to save tokens while preserving task state. Use during long sessions, large file dumps, or before calling expensive models.
github: "https://github.com/mocasus/paleo/tree/main/skills/paleo-trim-context"
language: Python
stars: 11
forks: 0
install: "git clone https://github.com/mocasus/paleo"
added: 2026-07-16T13:43:28.087Z
last_synced: 2026-07-17T07:10:03.168Z
canonical_url: "https://dirskills.com/skills/paleo-trim-context"
---

# Paleo Trim Context

Automatically trim, summarize, or drop stale content from the context window to save tokens while preserving task state. Use during long sessions, large file dumps, or before calling expensive models.

**Install:** `git clone https://github.com/mocasus/paleo`

## README

# paleo-trim-context
Keep context small. Drop stale, keep task state.

## Rules
- Summarize old tool output into 1-2 lines; keep only the result that matters.
- Drop: resolved errors, obsolete file reads, duplicate logs.
- Keep: current plan, open TODO, key IDs/paths, last decision.
- Use session_search / notes for history instead of re-pasting.
- Prefer code/script over long prose explanations in context.
- Pre-thinking compression (biggest savings): BEFORE the model reasons, compress retrieved docs / RAG context / long file dumps into key facts + a source pointer. Drop full-doc dumps.
- Effort pinning: trivial task -> signal low effort, no over-think. Reuse a prior conclusion instead of re-reasoning the same thing.

## Scope boundary (don't collide with siblings)
- Context hygiene + effort pinning + pre-thinking compression = THIS skill (runs automatically during the session).
- `paleo-converse` = explicit conversation-turn compression + dedup (on-demand, when the user points at history or context is heavy).
- `paleo-summary` = one bulky artifact (log / diff / dump / stdout) -> tight intisari.
- Hand off to those when the target is a specific turn-block or a single artifact; don't re-implement them here.

## When
- Long session (>20 turns), big file dumps, repeated similar output.
- Before calling an expensive model — shrink first.

## Gotchas
- Don't trim the user's latest instruction.
- Keep ground truth (file paths, IDs) — summarize derivations only.
- If unsure what's stale, ask once. Don't guess-drop critical state.
