hive.context-preservation
This Claude Code skill manages information retention within finite context windows by directing users to proactively extract and store critical values from tool results into working notes before automatic pruning removes them. Use this skill when working with multiple tool calls, long workflows, or tasks requiring handoffs, where you need to preserve specific URLs, API fields, IDs, or analysis conclusions that you'll reference later in the conversation.
git clone --depth 1 https://github.com/aden-hive/hive /tmp/hive.context-preservation && cp -r /tmp/hive.context-preservation/core/framework/skills/_default_skills/context-preservation ~/.claude/skills/hive.context-preservationSKILL.md
## 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.SOP for debugging browser automation failures on complex websites. Use when browser tools fail on specific sites like LinkedIn, Twitter/X, SPAs, or sites with Shadow DOM.
Claim tasks, record step progress, and verify SOP gates in the colony SQLite queue. Applies when your spawn message includes a db_path field.
Follow a structured recovery decision tree when tool calls fail instead of blindly retrying or giving up.
Maintain a free-form scratchpad of decisions, extracted values, and open questions so context pruning doesn't lose anything you still need.
Periodically self-assess output quality to catch degradation before the judge does.
Author a new Agent Skill for a Hive agent that conforms to the Agent Skills specification (SKILL.md with YAML frontmatter, optional scripts/references/assets directories). Use when the user asks to create, scaffold, add, or package a new skill for a Hive agent.