Context manager

From eddiebelaval/squire · View interactive version

Context manager is an AI agent skill from the GitHub repository eddiebelaval/squire. Manage conversation context and memory for optimal AI performance

How to use this skill

Skill file

Context Manager

The Context Manager skill helps you optimize conversation context to maintain Claude's effectiveness throughout long sessions. It tracks context window usage, identifies when to summarize or prune context, and helps you structure conversations to keep relevant information accessible while staying within token limits.

This skill is essential for complex, multi-day projects where conversation history grows large. It helps you decide what to preserve, what to summarize, and what to discard, ensuring Claude maintains awareness of important decisions and project state without hitting context limits.

Use this skill proactively during long development sessions, before starting new major features, or when you notice performance degradation due to context bloat.

Core Workflows

Workflow 1: Monitor Context Health

  1. Check current context usage:
  1. Analyze context composition:
  1. Identify problematic areas:
  1. Assess risk level:
  1. Recommend actions if needed
  2. Report status to user

Workflow 2: Summarize Long Conversation

  1. Review conversation history
  2. Extract key information:
  1. Organize by topic/timeline
  2. Create concise summary
  3. Validate with user
  4. Suggest starting new thread with summary

Workflow 3: Prune Irrelevant Context

  1. Identify candidates for removal:
  1. Categorize by importance:
  1. Propose pruning plan to user
  2. Execute approved removals
  3. Preserve critical context
  4. Verify coherence after pruning

Workflow 4: Optimize Context Structure

  1. Analyze current context organization
  2. Identify inefficiencies:
  1. Restructure for efficiency:
  1. Suggest external documentation for:
  1. Link to external docs instead of inlining
  2. Validate improved efficiency

Quick Reference

| Action | Command/Trigger |

|--------|-----------------|

| Check context status | "Check context window" or "How's our context?" |

| Summarize conversation | "Summarize this conversation" |

| Start fresh with summary | "Start new thread with summary" |

| Prune old context | "Clear old context" or "Prune conversation" |

| Optimize context structure | "Optimize our context" |

| Preserve key decisions | "Document key decisions" |

| Estimate context usage | "How much context are we using?" |

Best Practices

Context Optimization Strategies

Strategy 1: Hierarchical Summarization

Long conversation →
  Detailed summary (50% reduction) →
    Executive summary (80% reduction) →
      Key decisions (95% reduction)

Strategy 2: Time-Based Windowing

Keep in context:
- Last 1 hour: Full detail
- Last 4 hours: Summarized
- Last day: Key decisions only
- Older: Link to external docs

Strategy 3: Topic-Based Partitioning

Separate threads for:
- Feature development
- Bug investigation
- Deployment/ops
- Architecture discussion

Link between threads as needed

Strategy 4: Progressive Disclosure

Start with:
- Current task context only

Add on demand:
- Related decisions
- Relevant code
- Background information

Remove when done

Context Health Checklist

Before starting a major task, verify:

Warning Signs of Context Issues

Watch for these indicators:

External Memory Strategies

Move these to files, not context:

| Information Type | Best Storage |

|------------------|--------------|

| Project overview | README.md |

| Architecture decisions | ARCHITECTURE.md or ADRs |

| API contracts | OpenAPI spec or schema files |

| Current project state | PIPELINE_STATUS.md or TODO.md |

| Configuration | .env, config files |

| Code style rules | .eslintrc, prettier.config.js |

| Deployment process | DEPLOYMENT.md or CI/CD config |

| Team decisions | DECISIONS.md or meeting notes |

Context Templates

Project State Summary Template

## Project: [Name]
- **Status**: [Current pipeline stage]
- **Current focus**: [What we're working on]
- **Last completed**: [Recent achievement]
- **Next steps**: [Immediate tasks]
- **Blockers**: [What's preventing progress]
- **Key decisions**: [Recent important choices]

Decision Log Template

## Decision: [Topic]
- **Date**: [When]
- **Context**: [Why we needed to decide]
- **Options considered**: [Alternatives]
- **Choice**: [What we decided]
- **Rationale**: [Why this choice]
- **Consequences**: [Trade-offs accepted]

Session Summary Template

## Session Summary: [Date]
- **Duration**: [How long]
- **Accomplished**: [What we built/fixed]
- **Decisions**: [Choices made]
- **Issues found**: [Problems discovered]
- **Next session**: [Where to continue]

Advanced: Context Compression Techniques

For power users:

  1. Use references: Link to code instead of pasting
  1. Leverage AI memory: Store in knowledge graph
  1. Create abbreviations: Define once, use everywhere
  1. Use diff format: Show changes, not entire files
  1. Batch similar information: Group related items
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.