# Role Context Manager

> Context window management: persisting critical state, checkpointing, and preventing context degradation in long sessions. Trigger at ~60% context usage or before large tasks.

- **Type:** Skill
- **Install:** `agentstack add skill-saemihemma-lead-producer-oss-role-context-manager`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [saemihemma](https://agentstack.voostack.com/s/saemihemma)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [saemihemma](https://github.com/saemihemma)
- **Source:** https://github.com/saemihemma/lead-producer-oss/tree/main/.claude/skills/role-context-manager

## Install

```sh
agentstack add skill-saemihemma-lead-producer-oss-role-context-manager
```

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

## About

# Context Manager

## Use When
- Context usage around 60% or higher
- Long task about to generate noisy output
- Multi-agent coordination needs durable handoff
- Rereading same material due to context degradation

## Do NOT Use When
- Session is short and context is comfortable
- Problem is missing external knowledge, not memory hygiene
- Task is documentation authoring or product prioritization

## What You Own
- Smallest high-signal persistence before context collapse
- `_context/SESSION_STATE.md` as recovery entry point
- `_context/HANDOFF.md` for agent-to-agent transfer
- Keep vs persist vs drop decisions for working memory

## Reference Map
- `references/context-hygiene.md` — degradation signals, checkpoint timing, smallest-useful persistence

## Working Method
1. Keep live task, active files, preferences, next step in context.
2. Persist only reusable parts: settled decisions, finished findings, blockers.
3. Write `_context/SESSION_STATE.md` with current task, decisions, active files, blockers, next steps.
4. Write `_context/HANDOFF.md` only when another agent needs to resume.
5. On recovery, read SESSION_STATE.md first, then referenced files.

## Default Output
```text
CONTEXT CHECKPOINT
==================
Persisted: session state, decisions/findings worth reusing, handoff if needed
Kept In Context: current task, active files, next step
```

## Key Concepts (Inline Fallback)
If reference files are unavailable:
- **Context Degradation**: When the model starts repeating itself, losing track of decisions, or contradicting earlier conclusions. Signals: asking about something already resolved, re-reading files already summarized.
- **Checkpoint Trigger**: ~60% context usage, or before any operation that will generate large output (tree dumps, full file reads, multi-file diffs).
- **Smallest Useful Persistence**: Save decisions and pointers, not transcripts. A 10-line SESSION_STATE.md that lets the next context rebuild > a 200-line dump that wastes budget.
- **Handoff Protocol**: When transferring to another agent: task, constraints, decisions made, files touched, next step. Nothing else.
- **Recovery Priority**: On context restore, read SESSION_STATE.md first. Only pull referenced files if actively needed for the next step.

## Anti-Drift Rules
- Persist conclusions and pointers, not full tool transcripts.
- Do not persist away live user constraints or current next step.
- `_context/` is working-memory support, not documentation.

## Source & license

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

- **Author:** [saemihemma](https://github.com/saemihemma)
- **Source:** [saemihemma/lead-producer-oss](https://github.com/saemihemma/lead-producer-oss)
- **License:** MIT

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-saemihemma-lead-producer-oss-role-context-manager
- Seller: https://agentstack.voostack.com/s/saemihemma
- 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%.
