context-anchor

Recover from context compaction by scanning memory files and surfacing where you left off. Use when waking up fresh, after compaction, or when you feel lost about what you were doing.

7 stars

Best use case

context-anchor is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Recover from context compaction by scanning memory files and surfacing where you left off. Use when waking up fresh, after compaction, or when you feel lost about what you were doing.

Teams using context-anchor should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/context-anchor/SKILL.md --create-dirs "https://raw.githubusercontent.com/Demerzels-lab/elsamultiskillagent/main/public/skills/boscoeuk/context-anchor/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/context-anchor/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How context-anchor Compares

Feature / Agentcontext-anchorStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Recover from context compaction by scanning memory files and surfacing where you left off. Use when waking up fresh, after compaction, or when you feel lost about what you were doing.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Context Anchor Skill

Helps agents recover context after compaction by scanning memory files and generating a "here's where you are" briefing.

## Why This Exists

Context compaction loses memory. Files survive. But after waking up fresh, you need to:
1. Know what you were working on
2. See decisions that were made
3. Find open loops that need closing
4. Get oriented fast

This skill automates that recovery.

---

## Quick Start

```bash
# Full briefing (default)
./scripts/anchor.sh

# Just show current task
./scripts/anchor.sh --task

# Just show active context files
./scripts/anchor.sh --active

# Just show recent decisions
./scripts/anchor.sh --decisions

# Show open loops / questions
./scripts/anchor.sh --loops

# Scan specific number of days back
./scripts/anchor.sh --days 3
```

---

## What It Scans

| Source | What It Extracts |
|--------|------------------|
| `memory/current-task.md` | Current task status, blockers, next steps |
| `memory/YYYY-MM-DD.md` | Recent daily logs (last 2 days by default) |
| `context/active/*.md` | In-progress task files |
| Daily logs | Decisions (lines with "Decision:", "Decided:", "✅") |
| Daily logs | Open loops (lines with "?", "TODO:", "Blocker:", "Need to") |

---

## Output Format

The script outputs a structured briefing:

```
═══════════════════════════════════════════════════════════
                    CONTEXT ANCHOR
              Where You Left Off
═══════════════════════════════════════════════════════════

📋 CURRENT TASK
───────────────────────────────────────────────────────────
[Contents of memory/current-task.md or "No current task set"]

📂 ACTIVE CONTEXT FILES
───────────────────────────────────────────────────────────
• context/active/project-name.md (updated 2h ago)
  └─ First line preview...

🎯 RECENT DECISIONS (last 2 days)
───────────────────────────────────────────────────────────
[2026-01-30] Decision: Use Cloudflare Pages for hosting
[2026-01-30] ✅ Completed email capture setup

❓ OPEN LOOPS
───────────────────────────────────────────────────────────
[2026-01-30] Need to enable SFTP on NAS
[2026-01-30] TODO: Create Product Hunt account

═══════════════════════════════════════════════════════════
```

---

## Integration with AGENTS.md

Add to your "Every Session" routine:

```markdown
## Every Session

Before doing anything else:
1. Run `./skills/context-anchor/scripts/anchor.sh` for orientation
2. Read `SOUL.md` — this is who you are
3. Read `USER.md` — this is who you're helping
...
```

Or use it manually when you feel lost about context.

---

## Customization

### Change workspace root

```bash
WORKSPACE=/path/to/workspace ./scripts/anchor.sh
```

### Change days to scan

```bash
./scripts/anchor.sh --days 5  # Scan 5 days back
```

---

## No Dependencies

Pure bash. Uses only:
- `find`, `grep`, `head`, `tail`, `date`, `stat`
- Works on macOS and Linux
- No external tools required

---

## When to Use

- **Session start**: Quick orientation on what's happening
- **After compaction**: Recover lost context
- **Feeling lost**: "Wait, what was I doing?"
- **Handoff**: Show another agent where things stand
- **Daily review**: See what decisions were made

Related Skills

smart-context

7
from Demerzels-lab/elsamultiskillagent

Token-efficient agent behavior — response sizing, context pruning, tool efficiency, and delegation.

project-context-sync

7
from Demerzels-lab/elsamultiskillagent

Keep a living project state document updated after each commit, so any agent (or future session) can instantly understand where things stand.

auto-context-manager

7
from Demerzels-lab/elsamultiskillagent

AI-powered automatic project context management.

context-builder

7
from Demerzels-lab/elsamultiskillagent

Generate LLM-optimized codebase context from any directory using context-builder CLI.

contextkeeper

7
from Demerzels-lab/elsamultiskillagent

ContextKeeper — Safe project state tracking for AI agents.

context-viz

7
from Demerzels-lab/elsamultiskillagent

Visualize the current context window usage — token estimates per component (system prompt, tools, workspace files.

telegram-context

7
from Demerzels-lab/elsamultiskillagent

Toggle-enabled skill that fetches Telegram message history at session start for conversational continuity.

context-compactor

7
from Demerzels-lab/elsamultiskillagent

Token-based context compaction for local models (MLX, llama.cpp, Ollama) that don't report context limits.

multi-chat-context-manager

7
from Demerzels-lab/elsamultiskillagent

CLI tool to store and retrieve conversation contexts per channel/user.

context-gatekeeper

7
from Demerzels-lab/elsamultiskillagent

Keeps the conversation token-friendly by summarizing recent exchanges, surfacing pending actions, and delivering.

slack-context-memory

7
from Demerzels-lab/elsamultiskillagent

Conversation summarization and context compaction for Slack channels. Reduces context window usage by 70-99% while preserving key information through semantic summaries.

context-onboarding

7
from Demerzels-lab/elsamultiskillagent

Provide new contributors and agents with a concise tour of the workspace identity files (SOUL.md, USER.md, AGENTS.md, TOOLS.md) plus onboarding tips. Use when a newcomer needs context or when you want to double-check how this workspace is configured.