Context Gatekeeper for Openclaw

A context management tool that prunes bloated conversation threads by generating compact summaries and tracking pending actions.

davienzomq
v0.1.1
Feb 6, 2026
3
2.7k
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install context-gatekeeper

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install context-gatekeeper using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Context Gatekeeper?

Context Gatekeeper is a specialized utility designed to maintain lean and cost-effective AI interactions by reducing the volume of tokens sent to large language models. It works by synthesizing long conversation histories into essential decisions, next steps, and recent context snippets. By using this tool within the ecosystem of Openclaw Skills, developers can ensure their agents remain focused on high-priority tasks and project goals without being overwhelmed by the noise of extensive message threads.

The skill operates on a principle of discipline similar to manual compaction, replacing hundreds of old messages with a single, high-density briefing page. This results in significant token savings and improved model performance by keeping the most relevant data at the forefront of the prompt.

Context Gatekeeper Use Cases

  • Pruning bloated conversation threads to minimize API costs and latency.
  • Tracking pending actions and TODOs across long-running autonomous agent sessions.
  • Generating concise briefings for AI agents before a new processing turn.
  • Maintaining project context across multiple sessions without hitting context window limits.

How Context Gatekeeper Works

  1. Record every conversation exchange in a standardized ROLE: text format inside a history file, typically located at context/history.txt.
  2. Trigger the gatekeeper script which analyzes the history file to extract key decisions and identify open tasks like TODOs or follow-ups.
  3. Generate a structured Markdown artifact (context/current-summary.md) that synthesizes the conversation into a limited number of sentences.
  4. Inject the content of the generated summary into the next model prompt to provide a focused, token-friendly context.

Context Gatekeeper Setup

To get started with this skill, ensure your history file is updated and run the following command:

python skills/context-gatekeeper/scripts/context_gatekeeper.py \
  --history context/history.txt \
  --summary context/current-summary.md

You can customize the output by adjusting the --max-summary-sents and --max-recent-turns arguments to fit your specific workflow requirements.

Context Gatekeeper Data Schema & Taxonomy

The skill organizes its data through a simple file-based taxonomy to ensure portability and ease of use within Openclaw Skills:

File Path Format Description
context/history.txt Plain Text A line-by-line log of the conversation using the ROLE: Message format.
context/current-summary.md Markdown The synthesized summary including the briefing, pending tasks, and recent turns.
context/pending-tasks.md Markdown (Optional) A dedicated file for persisting extracted action items.

Context Gatekeeper Advanced Features

  • Configurable summary density allowing users to limit summaries to a specific number of sentences.
  • Dynamic extraction of keywords such as TODO, TASK, and FOLLOW-UP to highlight pending actions.
  • Sliding window context which preserves a specific number of recent turns for immediate conversational continuity.
  • Support for STDIN input, making it easy to pipe conversation data directly into the summarization engine.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*