# Context

> Context window manager. Snapshots session state, compacts conversation, and resumes via hook. Use when context exceeds 70% or a large new task begins.

- **Type:** Skill
- **Install:** `agentstack add skill-epicsagas-epic-harness-context`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [epicsagas](https://agentstack.voostack.com/s/epicsagas)
- **Installs:** 0
- **Category:** [AI & ML](https://agentstack.voostack.com/c/ai-and-ml)
- **Latest version:** 0.1.0
- **License:** Apache-2.0
- **Upstream author:** [epicsagas](https://github.com/epicsagas)
- **Source:** https://github.com/epicsagas/epic-harness/tree/main/skills/context
- **Website:** https://crates.io/crates/epic-harness

## Install

```sh
agentstack add skill-epicsagas-epic-harness-context
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Context — Context Window Management

## When to Trigger
- Context window > 70% capacity
- Long conversation with many tool calls
- Before starting a large new task in an existing session
- User asks to "clean up" or "start fresh"

## Process

### 1. Assess
- Estimate current context usage
- Identify what's consuming the most context (large file reads, verbose outputs)

### 2. Preserve
Before compacting, ensure critical state is saved:
- Current task and progress → `$HARNESS_DIR/sessions/`
- Key decisions made → note in conversation
- Files being worked on → list explicitly

### 3. Compact
Suggest or trigger compaction with a clear summary:
```
Summary for compaction:
- Working on: [task description]
- Files modified: [list]
- Current status: [what's done, what remains]
- Key decisions: [important choices made]
- Next step: [what to do after compaction]
```

### 4. Resume
After compaction, the `resume` hook will reload:
- Session snapshot from `$HARNESS_DIR/sessions/`
- Project memory from `$HARNESS_DIR/memory/`
- Evolved skills from `$HARNESS_DIR/evolved/`

## Anti-Rationalization

| Excuse | Rebuttal | What to do instead |
|--------|----------|-------------------|
| "I still have context left" | Quality degrades well before the hard limit. 70% is the trigger. | Compact proactively. Better to lose 5 min than lose coherence. |
| "Compacting will lose important context" | That's why you preserve first. The resume hook restores it. | Save state → compact → resume loads snapshot + memory + skills. |
| "I'll just re-read the files" | Re-reading 5 large files wastes 30%+ of your fresh context. | Summarize key facts before compacting. Read only what you need after. |

## Evidence Required

Before compacting, confirm ALL of these:

- [ ] Current task and progress noted in summary
- [ ] Files being worked on listed explicitly
- [ ] Key decisions recorded (not just "some decisions were made")
- [ ] Next step specified clearly
- [ ] Snapshot written to `$HARNESS_DIR/sessions/` (show file name)

**Compacting without a summary = guaranteed context loss.**

## Red Flags
- Continuing with 90%+ context without compacting (quality degrades)
- Compacting without saving state (lose track of progress)
- Re-reading large files after compaction (defeats the purpose)

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [epicsagas](https://github.com/epicsagas)
- **Source:** [epicsagas/epic-harness](https://github.com/epicsagas/epic-harness)
- **License:** Apache-2.0
- **Homepage:** https://crates.io/crates/epic-harness

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-epicsagas-epic-harness-context
- Seller: https://agentstack.voostack.com/s/epicsagas
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
