Trinity Compress for Openclaw

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

trinitybotserver
v1.0.0
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 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 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 for developers building with AI agents. It targets the prompt bloat that occurs during iterative development loops by stripping unnecessary characters and formatting from prompt files before they are sent to LLM providers. By integrating this into your workflow, you can significantly lower operational costs and stay within context limits without sacrificing the core logic of your instructions.

As part of the ecosystem of Openclaw Skills, it provides a lightweight, local-first solution for token management. Unlike model-based compressors, Trinity Compress runs entirely on your machine using bash scripts, ensuring that your data stays private while providing instant results.

Trinity Compress Use Cases

  • Reducing token consumption in high-frequency Ralph-style development loops.
  • Optimizing massive prompt libraries within agent or skill directories before deployment.
  • Managing context window constraints for token-billed AI providers.
  • Automating prompt cleanup within a CI/CD or local build process using Openclaw Skills.

How Trinity Compress Works

  1. The script reads the configuration defined in trinity-compress.config.json to identify target files and compression rules.
  2. It creates .bak backups of the original files to ensure no data is permanently lost.
  3. The local bash script processes the text, removing redundant whitespace and formatting while preserving critical elements like code blocks, URLs, and variables.
  4. It outputs the compressed versions, ready to be read by your AI agent or development script.
  5. Users can verify the reduction using the calculated metrics or instantly revert changes using the undo command.

Trinity Compress Setup

To get started with this addition to your Openclaw Skills library, follow these steps:

  1. Ensure you have bash 4+, jq, and bc installed on your system.
  2. Run the provided installer script for your operating system:
# For Linux/macOS
./scripts/install.sh

# For Windows
./scripts/install.ps1
  1. Configure your compression targets in trinity-compress.config.json.
  2. Execute the compression script:
bash scripts/trinity-compress.sh balanced

Trinity Compress Data Schema & Taxonomy

Trinity Compress organizes its operations through the following file structure:

File/Component Description
trinity-compress.config.json Central configuration defining rules, exclusions, and target directories.
scripts/trinity-compress.sh Core execution engine for local text processing and token reduction.
*.bak Temporary backup files created during the compression lifecycle for safety.
Makefile Snippets Optional integration points for commands like optimize-prompts and optimize-undo.

Trinity Compress Advanced Features

  • Multiple compression profiles including balanced and aggressive modes to control the depth of optimization.
  • Intelligent preservation logic that protects code blocks, URLs, file paths, and variable names from corruption.
  • Instant rollback capabilities that restore the entire workspace from .bak files in one command.
  • Seamless integration with existing Openclaw Skills and Ralph-style automated development workflows.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*