Agent Runtime for Openclaw

A comprehensive runtime system for AI agents that manages tool lifecycles, permissions, and context optimization.

xhmqq616
v1.0.0
Apr 6, 2026
0
708
0

Install & Download

1. ClawHub CLI

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

npx clawhub@latest install agent-runtime

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 agent-runtime 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 Agent Runtime?

The Agent Runtime is a sophisticated system designed to orchestrate the lifecycle of intelligent agents. It provides a robust framework for integrating tool registries, enforcing permission policies, and intercepting tool execution via hooks. By leveraging this tool within the ecosystem of Openclaw Skills, developers can build specialized sub-agents tailored for tasks like code exploration, strategic planning, or automated verification, all while maintaining strict control over token usage and context compression.

Agent Runtime Use Cases

  • Orchestrating specialized sub-agents for complex coding tasks.
  • Enforcing security policies and tool permissions during agent execution.
  • Monitoring and tracking token usage across multiple agent sessions.
  • Implementing pre- and post-execution hooks for debugging and logging.
  • Compressing long conversation histories to optimize context window efficiency.

How Agent Runtime Works

  1. The user message is received and processed by the core Agent Runtime.
  2. The system queries the ToolRegistry to locate and route required functions.
  3. PermissionPolicy checks are performed to ensure the agent has authority to execute specific tools.
  4. The Hook Runner executes PreToolUse logic before the primary action occurs.
  5. The Executor runs the tool and passes the output to the PostTool hook for final processing.
  6. The SessionCompactor optimizes the context while UsageTracker records token consumption before returning the result.

Agent Runtime Setup

To integrate this into your environment, ensure the core runtime script is accessible within your project structure. Using Openclaw Skills allows for seamless script management.

# Navigate to your project directory
cd your-project-path

# Ensure the runtime script is located in the scripts folder
ls ./scripts/agent-runtime.mjs

Initialize the runtime in your JavaScript environment:

import { AgentRuntime } from './scripts/agent-runtime.mjs';

const agent = new AgentRuntime({
  agentType: 'explore',
  maxTokens: 100000
});

Agent Runtime Data Schema & Taxonomy

The Agent Runtime organizes data through a structured pipeline to ensure consistency across Openclaw Skills implementations:

Component Responsibility Data Type
ToolRegistry Tool registration, search, and routing Object Map
PermissionPolicy Permission level control and security Policy Config
HookRunner Intercepting PreToolUse and PostToolUse Middleware
SessionCompactor Context and history compression String/Buffer
UsageTracker Token and usage statistics tracking JSON Analytics

Agent Runtime Advanced Features

  • Support for multiple specialized agent types including explore, plan, and verify.
  • Dynamic tool registration allowing agents to expand their capabilities on the fly.
  • Advanced hook system for injecting custom logic before and after tool execution.
  • Integrated context compactor to maintain performance during long-form interactions.
  • Detailed usage tracking for monitoring costs and token efficiency within Openclaw Skills.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*