SuperAPI AI Directory

context-agent

Agents & models

View repository

Updated 10-16 01:49

About this skill

Context Agent

This guide is intentionally written in Brazilian Portuguese. The header Headers When to Use and Limitations remain in English only for compatibility with catalog discovery and automatic validation.

[!WARNING] This skill writes context, logs, an SQLite database, and MEMORY.md to local paths; maintenance can also archive and remove old summaries. Confirm the paths, keep a backup, and obtain explicit approval before running init, save, archive or maintain.

Overview

Context agent for continuity between sessions. Saves summaries, decisions, pending tasks, and loads an automatic briefing in the next session.

When to Use This Skill

  • When the user mentions "save context" or related topics
  • When the user mentions "save the context" or related topics
  • When the user mentions "next session" or related topics
  • When the user mentions "session briefing" or related topics
  • When the user mentions "session summary" or related topics
  • When the user mentions "session continuity" or related topics

When Not to Use This Skill

  • The task is not related to context continuity
  • A simpler, more specific tool can fulfill the request
  • The user only needs general assistance, without this specialization

How It Works

Seamless continuity between Claude Code sessions. Captures, compresses, and restores context automatically — topics, decisions, tasks, errors, modified files, and technical findings.

Location

C:\Users\renat\skills\context-agent\
├── SKILL.md
├── scripts/
│   ├── config.py               # Paths e constantes
│   ├── models.py               # Dataclasses
│   ├── session_parser.py       # Parser JSONL do Claude Code
│   ├── session_summary.py      # Gerador de resumos
│   ├── active_context.py       # Gerencia ACTIVE_CONTEXT.md
│   ├── project_registry.py     # Registro de projetos
│   ├── compressor.py           # Compressão e arquivamento
│   ├── search.py               # Busca FTS5
│   ├── context_loader.py       # Carrega contexto
│   └── context_manager.py      # CLI entry point
├── references/
│   ├── context-format.md       # Especificação de formatos
│   └── compression-rules.md    # Regras de compressão
└── data/
    ├── sessions/               # session-001.md, session-002.md, ...
    ├── archive/                # Sessões arquivadas
    ├── ACTIVE_CONTEXT.md       # Contexto consolidado (max 150 linhas)
    ├── PROJECT_REGISTRY.md     # Status de todos os projetos
    └── context.db              # SQLite FTS5 para busca

Initialization (First Time)

python C:\Users\renat\skills\context-agent\scripts\context_manager.py init

Save Current Session Context

When the session is ending or before a long task, save the context:

python C:\Users\renat\skills\context-agent\scripts\context_manager.py save

What it does:

  1. Finds the most recent session JSONL file
  2. Parses all messages, tool calls, and results
  3. Generates a structured summary (session-NNN.md)
  4. Updates ACTIVE_CONTEXT.md with new information
  5. Syncs with MEMORY.md (loaded into the system prompt)
  6. Indexes for full-text search

Load Context (Briefing)

At the start of a new session, load the context:

python C:\Users\renat\skills\context-agent\scripts\context_manager.py load

Generates a briefing with: active projects, pending tasks (by priority), blockers, recent decisions, conventions, and a summary of the latest sessions.

Quick Status

python C:\Users\renat\skills\context-agent\scripts\context_manager.py status

Summary in a few lines: projects, critical pending items, blockers.

Search the History

python C:\Users\renat\skills\context-agent\scripts\context_manager.py search "rate limit"

Full-text search (SQLite FTS5) across all sessions — topics, decisions, errors, files, etc.

Maintenance

python C:\Users\renat\skills\context-agent\scripts\context_manager.py maintain

Archives old sessions, compresses the archive, resyncs MEMORY.md, rebuilds the search index.

Workflow

[Sessão termina]
  → save → session-NNN.md + ACTIVE_CONTEXT.md + MEMORY.md

[Nova sessão começa]
  → MEMORY.md já está no system prompt (automático)
  → load → briefing detalhado com tudo que precisa saber

[Contexto cresce demais]
  → maintain → arquiva sessões antigas, comprime, otimiza

What Is Captured in Each Session

  • Topics: topics discussed
  • Decisions: technical and architectural choices
  • Completed tasks: what was done
  • Pending tasks: what remains (with priority)
  • Modified files: which files were edited/created
  • Findings: important technical insights
  • Resolved errors: problems and their solutions
  • Open questions: unanswered questions
  • Metrics: tokens consumed, messages, tool calls

Integration With Memory.Md

ACTIVE_CONTEXT.md is automatically copied to: C:\Users\renat\.claude\projects\C--Users-renat-skills\memory\MEMORY.md

Since MEMORY.md is included in the system prompt of every session, Claude always starts out knowing the current state of the projects, pending tasks and decisions made — without needing any manual action.

References

  • For the detailed format of the files: references/context-format.md
  • For compression and archiving rules: references/compression-rules.md

Best Practices

  • Provide clear and specific context about the project and its requirements
  • Review all suggestions before applying them to production code
  • Combine this skill with other complementary skills when necessary

Common Pitfalls

  • Using this skill on tasks outside its domain
  • Applying recommendations without understanding the specific context
  • Providing insufficient context for an accurate analysis

Related Skills

  • context-guardian - Complementary skill to preserve context before compaction

Limitations

  • Use this skill only when the task clearly matches the scope above.
  • The included implementation uses specific absolute Windows paths and those of the author; adapt and validate all paths before any execution.
  • Do not treat the output as a substitute for validation, testing or specialized review.
  • Stop and ask for clarification when inputs, permissions, safety limits or success criteria are missing.