AgentStack
SKILL verified MIT Self-run

Context Manager

skill-rockarhymellc-claude-code-skills-context-manager · by RockaRhymeLLC

Manages Claude Code context window to prevent information loss. Tracks usage, saves state before compaction, and restores seamlessly after restart. Prevents the frustrating loss of work-in-progress when context fills up. Use when working on long tasks, when context is getting full, or when the user says /ctx.

No reviews yet
0 installs
4 views
0.0% view→install

Install

$ agentstack add skill-rockarhymellc-claude-code-skills-context-manager

✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access Used
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

Are you the author of Context Manager? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Context Manager

Prevent information loss when your Claude Code context window fills up. Automatically tracks usage, saves state, and restores after restart.

When to Activate

  • User says /ctx or /ctx save or /ctx check
  • User asks about context usage or remaining space
  • User is working on a long task that might exhaust context
  • Before starting a large task (reading many files, big implementation)

The Problem

Claude Code has a finite context window. When it fills up:

  • The system compresses earlier messages (lossy)
  • You lose working state, partial progress, and nuanced context
  • Multi-step tasks break halfway through
  • You repeat work you already did

Instructions

/ctx check — Check Current Usage

Read the context-usage.json file (updated by Claude Code hooks):

cat .claude/state/context-usage.json 2>/dev/null

Report to the user:

  • Green (>60% remaining): Plenty of room. Work freely.
  • Yellow (40-60% remaining): Getting warm. Save state before starting big tasks.
  • **Red (/dev/null

If state exists:
1. Read and internalize the saved context
2. Summarize to the user: "Picking up where we left off — [task summary]"
3. Continue from "What's Next"

### `/ctx auto` — Enable Automatic Management

Set up a hook that monitors context usage and auto-saves:

Create `.claude/hooks/context-watchdog.json`:

```json
{
  "hooks": {
    "PostToolUse": [
      {
        "matcher": { "tool_name": "*" },
        "hooks": [
          {
            "type": "command",
            "command": "node -e \"const f='.claude/state/context-usage.json';const fs=require('fs');try{const d=JSON.parse(fs.readFileSync(f));if(d.remaining_percentage .claude/state/context-usage.json
  1. Add a Claude Code hook to track context usage (requires Claude Code hooks support)
  1. Run your Claude Code session inside tmux for clean restart support:
tmux new-session -s claude "claude"
  1. Enable /ctx auto for automatic warnings

Tips

  • Save early, save often: The cost of saving is low. The cost of losing context is high.
  • Restart > clear: /clear only clears history within the session. Restarting Claude Code gives a completely fresh context window.
  • Front-load reading: Read all the files you'll need at the start of a task, before context fills up with working state.
  • Use state files as TODO lists: "What's Next" in the state file doubles as your task list after restart.
  • Checkpoint after breakthroughs: If you just figured out a tricky problem, save the insight immediately.

Source & license

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

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

Reviews

No reviews yet — be the first.

Versions

  • v0.1.0 Imported from the upstream source.