Message Injector for Openclaw

A powerful OpenClaw extension that automatically prepends custom instructions or context to every user message before the agent processes it.

harukaon
v1.0.0
Feb 23, 2026
0
1.6k
0

Install & Download

1. ClawHub CLI

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

npx clawhub@latest install message-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 message-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 Message Injector?

The Message Injector is a streamlined workspace extension designed to enhance the reliability and consistency of AI interactions within the Openclaw Skills ecosystem. By leveraging the before_agent_start hook, this skill ensures that specific guidelines, memory search requirements, or project-wide context are injected into every turn of the conversation.

This tool acts as a gateway-level guardrail, allowing developers to enforce specific agent behaviors without manually repeating instructions. Whether you are using WebChat, Telegram, or Slack, this extension provides a seamless way to maintain persistent reminders and operational safety across all communication channels supported by Openclaw Skills.

Message Injector Use Cases

  • Enforcing mandatory memory search operations before an agent generates a reply to prevent hallucinations.
  • Injecting persistent project metadata such as tech stacks, environment variables, or active deployment environments.
  • Implementing global safety rules and operational constraints that the agent must strictly adhere to.
  • Adding recurring system-level reminders to ensure the AI maintains a specific persona or output format.

How Message Injector Works

  1. The skill registers a listener for the before_agent_start hook within the OpenClaw architecture.
  2. When a user sends a message through any channel, the Message Injector interceptor is triggered before the agent starts processing.
  3. The skill retrieves the configured text string from the workspace settings.
  4. It utilizes the prependContext method to hard-inject the text at the very beginning of the user's message payload.
  5. The modified message is passed to the AI agent, ensuring the injected instructions are prioritized in the model's attention mechanism.

Message Injector Setup

First, create the dedicated extension directory to house your new Openclaw Skills components:

mkdir -p ~/.openclaw/workspace/.openclaw/extensions/message-injector

Next, copy the required script files into the extension directory:

cp scripts/index.ts ~/.openclaw/workspace/.openclaw/extensions/message-injector/
cp scripts/openclaw.plugin.json ~/.openclaw/workspace/.openclaw/extensions/message-injector/

Add the configuration block to your ~/.openclaw/openclaw.json file under the plugins.entries section:

"message-injector": {
  "enabled": true,
  "config": {
    "enabled": true,
    "prependText": "Your custom instructions here"
  }
}

Finally, restart the gateway to enable the new functionality:

openclaw gateway restart

Message Injector Data Schema & Taxonomy

The skill manages its behavior through a simple JSON configuration schema:

Property Type Description
enabled boolean Toggles whether the injection logic is active for the workspace.
prependText string The raw text or instructions to be prepended to every incoming user message.
hook string Uses the before_agent_start hook to ensure priority execution.

Message Injector Advanced Features

  • Gateway-level hard injection that agents cannot bypass, ignore, or overwrite.
  • Full compatibility across all messaging channels including Telegram, Slack, and WebChat.
  • Dynamic configuration support allowing users to update instructions without restarting the underlying services.
  • Lightweight footprint that seamlessly integrates with other Openclaw Skills for complex multi-agent workflows.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*