Trinity Compress for Openclaw

A lightweight local script that compresses prompt files to minimize token usage in iterative AI development cycles.

trinitybotserver
v1.0.1
Feb 14, 2026
0
0
0

Install & Download

1. ClawHub CLI

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

npx clawhub@latest install prompt-compression

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 prompt-compression 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 Trinity Compress?

Trinity Compress is a specialized utility designed to optimize the efficiency of AI coding agents by reducing the token footprint of prompt files. As a featured tool within the Openclaw Skills ecosystem, it operates as a local bash script that strips unnecessary characters and bloat from prompts before they are processed by token-billed providers. Unlike model-based compressors that might introduce hallucinations, Trinity Compress runs locally and preserves critical elements like code blocks, URLs, and variable names, ensuring that your AI agent maintains perfect context while consuming fewer resources.

By integrating this skill into your repository, you can significantly lower API costs and improve the speed of iterative development loops. The tool is designed to be non-destructive, utilizing a backup system that allows for instant restoration of original files, making it a safe and essential addition to any professional AI development workflow.

Trinity Compress Use Cases

  • Reducing API costs during long, iterative development sessions by minimizing prompt overhead.
  • Shortening massive system prompts or instruction sets for faster LLM processing.
  • Optimizing Ralph-style loops or multi-step agentic workflows where context window limits are a concern.
  • Maintaining repository hygiene by automating prompt minimization within local development environments.
  • Integrating with Openclaw Skills to streamline multi-agent communication efficiency.

How Trinity Compress Works

  1. The script reads the configuration defined in trinity-compress.config.json to identify target files and specific compression rules.
  2. It automatically creates .bak backups of all target files to ensure zero data loss and enable easy recovery.
  3. The local compression engine processes the text to remove whitespace and non-essential characters while strictly ignoring sensitive areas like code blocks and identifiers.
  4. The optimized, token-efficient prompt is saved back to the original file path, ready for the next AI agent iteration.
  5. The tool provides a summary of savings using jq and bc calculations to show the impact of the compression.

Trinity Compress Setup

To integrate Trinity Compress into your project, follow these steps:

# For Windows (PowerShell)
./scripts/install.ps1

# For Linux/macOS (Bash)
bash scripts/install.sh

# To run compression in balanced mode
bash scripts/trinity-compress.sh balanced

# To undo changes and restore backups
# If using the provided Makefile:
make optimize-undo

Ensure that you have bash 4+, jq, and bc installed on your system for full functionality.

Trinity Compress Data Schema & Taxonomy

Trinity Compress manages its operations through a specific set of files and metadata structures:

Component Description
trinity-compress.config.json The primary configuration file defining rules, targets, and exclusion patterns.
scripts/trinity-compress.sh The core execution logic for the prompt optimization workflow.
*.bak Automatic backups generated for every modified file to ensure safety.
Makefile Snippets Optional targets like optimize-prompts and optimize-undo for CLI automation.
.gitignore Automatically updated to ignore .bak files and prevent repository bloat.

Trinity Compress Advanced Features

  • Multi-mode compression profiles including balanced and aggressive levels to suit different project needs.
  • Intelligent content preservation that protects URLs, file paths, and code blocks from being modified.
  • Seamless integration with existing Openclaw Skills to enhance automated agent-led development.
  • Low-dependency local execution that requires no external API calls or model processing.
  • Automated backup and instant undo functionality for risk-free prompt experimentation.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*