---
name: Context Preservation
slug: context-preservation
category: AI Engineering
description: Context Preservation proactively extracts critical values from tool results into working notes before automatic context pruning destroys them. Use it when an agent must retain URLs, API fields, IDs, and analysis conclusions across long tasks.
github: "https://github.com/aden-hive/hive/tree/main/core/framework/skills/_default_skills/context-preservation"
language: Python
stars: 10907
forks: 5668
install: "npx degit https://github.com/aden-hive/hive/tree/main/core/framework/skills/_default_skills/context-preservation ~/.claude/skills/context-preservation"
installs_to: ~/.claude/skills/context-preservation
source_path: core/framework/skills/_default_skills/context-preservation/SKILL.md
collection_size: 24
category_size: 2451
collection_url: "https://dirskills.com/collections/aden-hive/hive"
added: 2026-08-15T06:50:11.694Z
last_synced: 2026-08-15T06:50:11.694Z
canonical_url: "https://dirskills.com/skills/context-preservation"
---

# Context Preservation

Context Preservation proactively extracts critical values from tool results into working notes before automatic context pruning destroys them. Use it when an agent must retain URLs, API fields, IDs, and analysis conclusions across long tasks.

**Install:**

```bash
npx degit https://github.com/aden-hive/hive/tree/main/core/framework/skills/_default_skills/context-preservation ~/.claude/skills/context-preservation
```

## README

## Operational Protocol: Context Preservation

You operate under a finite context window. Older tool results WILL be pruned. Extract what you need while it's still in context.

**Save-as-you-go.** After any tool call producing information you'll need later, immediately extract the key data into `_working_notes` or `_preserved_data`. Do not rely on referring back to old tool results — once they're pruned they're gone.

**What to extract:**
- URLs and key snippets (not full pages)
- Relevant API fields (not raw JSON blobs)
- Specific lines, values, or IDs (not entire files)
- Analysis conclusions (not raw data)

**Handoffs between tasks** happen through `progress.db`, not through shared-buffer handoff blobs. When you finish a task, any state the next worker needs goes into the task row itself (`steps.evidence`, `tasks.last_error`, `sop_checklist.note`) — see `hive.colony-progress-tracker`. Use `_working_notes` for things the DB schema doesn't cover.

You will receive an alert when context reaches {{warn_at_usage_ratio_pct}}% — preserve immediately.
