Session Context Injector for Openclaw

A specialized skill that ensures AI agents maintain project continuity in Telegram by injecting context from local status files after session resets.

nissan
v1.0.0
Apr 3, 2026
0
607
0

Install & Download

1. ClawHub CLI

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

npx clawhub@latest install session-context-injector

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 session-context-injector 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 Session Context Injector?

The Session Context Injector is a high-utility component of Openclaw Skills designed to solve the blank-slate problem encountered during AI agent interactions. When an AI session is cleared or a new collaborator joins a room, the agent typically loses its immediate project awareness. This skill bridges that gap by parsing local STATUS.md files—containing resume points, blockers, and next actions—and automatically broadcasting a structured update to the relevant Telegram chat.

By ensuring every reset is followed by a project-specific reorientation, it allows developers and teams to pick up exactly where they left off without manually re-explaining the current state. It supports multiple message formats including project room refreshes, direct message summaries for lead developers, and welcome messages for new project rooms, making it a cornerstone for professional Openclaw Skills implementations.

Session Context Injector Use Cases

  • Automatically re-orienting a group chat after a scheduled session refresh.
  • Onboarding new collaborators into a project room with a summary of current progress and allowed topics.
  • Sending a daily activity summary to a project lead via direct message after a context clear.
  • Initializing a new project room with specific context and purpose definitions to guide the AI agent.

How Session Context Injector Works

  1. Parse the local STATUS.md file within the project directory to extract key metadata like resume points and current blockers.
  2. Select the appropriate message template based on the chat type, whether it is a group, direct message, or a new room setup.
  3. Construct a formatted HTML message, ensuring it stays within the Telegram 4096-character limit through intelligent truncation.
  4. Send the context injection via the Telegram Bot API using a secure bot token retrieved from environment variables or secret management.
  5. Log the success or failure of the injection to the local memory files to maintain an audit trail of the Openclaw Skills activity.

Session Context Injector Setup

To integrate this into your Openclaw Skills workflow, ensure your environment is configured correctly:

# Ensure the Telegram Bot Token is available in your environment
export TELEGRAM_BOT_TOKEN="your_token_here"

# Or retrieve via 1Password if your project uses secret injection
op read "op://OpenClaw/Telegram Bot Token/credential"

# Ensure python3 is installed as the skill uses it for parsing and API calls
python3 --version

Session Context Injector Data Schema & Taxonomy

The skill interacts with the following data points to maintain project state across the Openclaw Skills ecosystem:

Attribute Description Source
chat_id The unique Telegram identifier for the room or user sessions.json
slug The project-specific directory name used for lookups telegram-groups.json
STATUS.md Markdown file containing RESUME FROM HERE and Blockers projects/slug/STATUS.md
memory/log.md Daily log where injection events and status codes are appended Local filesystem

It organizes the message output using HTML tags for robust compatibility across different Telegram clients.

Session Context Injector Advanced Features

  • Smart regex-based parsing that extracts specific Markdown headings even from complex status files.
  • Automated message truncation that prioritizes key project info to prevent Telegram API errors for long reports.
  • Multi-variant messaging logic supporting specific templates for Group, Direct, and Welcome chat types.
  • Built-in dry-run mode for developers to test injection templates in the CLI without sending live messages.
  • Error-resilient workflow that logs failures to memory without breaking the primary automation loop.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*