Exec-Truncate for Openclaw

Exec-Truncate is an intelligent output management tool that compresses verbose shell command results while preserving critical context for AI agents.

ether-btc
v1.0.1
Apr 9, 2026
0
744
0

Install & Download

1. ClawHub CLI

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

npx clawhub@latest install openclaw-exec-truncate

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 openclaw-exec-truncate 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 Exec-Truncate?

Exec-Truncate is a specialized utility designed to solve the common problem of context window saturation in AI agents. By providing domain-aware output truncation, it intelligently filters shell command results from tools like git, grep, and build systems. Unlike simple character-based clipping, this skill understands the structure of the data it processes, ensuring that the most relevant information remains intact while discarding noise.

As a versatile component of the Openclaw Skills ecosystem, it allows developers to wrap standard execution functions with a filtered layer. This ensures that agents receive concise, high-value data, leading to faster processing times and reduced token costs. It operates as a standalone utility, making it easy to integrate into custom workflows where managing large volumes of command-line data is a priority.

Exec-Truncate Use Cases

  • Reducing token consumption when AI agents perform deep git history or diff analysis.
  • Cleaning up verbose build logs to show only relevant error messages and warnings to the agent.
  • Managing massive search results from grep or find commands by capping matches and stripping redundant path prefixes.
  • Abbreviating directory listings (ls -la) to focus on file names and sizes without overwhelming the context window.

How Exec-Truncate Works

  1. The user or agent initiates a shell command through a wrapper or the filtered executor.
  2. The raw output is captured from the shell (stdout).
  3. The FilterRegistry matches the executed command against known patterns (e.g., git diff, npm run, grep).
  4. The corresponding domain-aware function processes the string, applying specific logic like keeping only the '+' lines in diffs or short hashes in logs.
  5. A fail-safe mechanism ensures that if processing fails, the original output is returned to prevent data loss.
  6. The compressed, context-rich result is returned to the AI agent or application.

Exec-Truncate Setup

To install the Exec-Truncate skill into your local environment, clone the repository or copy the module to your Openclaw Skills directory:

# Navigate to your skills directory
cd ~/.openclaw/workspace/skills/

# Clone the exec-truncate repository
git clone https://github.com/openclaw/exec-truncate.git

# Install dependencies (Deno environment)
deno cache mod.ts

Exec-Truncate Data Schema & Taxonomy

The skill is organized into modular TypeScript files to allow for easy extension and specific imports. Below is the primary module taxonomy:

Module Purpose
mod.ts Contains core truncation functions for git, grep, ls, and build tools.
filter-registry.ts Manages the mapping between shell command patterns and specific filters.
filtered-executor.ts Provides the high-level wrapper to automate truncation during execution.
index.ts The primary entry point for the Openclaw Skills integration.

Exec-Truncate Advanced Features

  • Custom Filter Registration: Developers can use FilterRegistry to define regex-based patterns for proprietary internal tools.
  • FilteredExecutor Factory: A higher-order function that wraps any async execution function with automatic truncation logic.
  • Fail-Safe Wrapper: Uses truncateWithFailSafe to ensure that regex crashes or memory limits never break the agent's execution flow.
  • Multi-Language Support: Includes a Python reimplementation and a shell wrapper for environments where TypeScript is not the primary runtime.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*