whatisgithub

What is harnesstrim?

giuliastro/harnesstrim — explained in plain English

Analysis updated 2026-05-18

11TypeScriptAudience · developerComplexity · 3/5Setup · easy

In one sentence

A cross-tool token-saving system that reduces noisy output for AI coding assistants like Claude Code and Codex.

Mindmap

mindmap
  root((HarnessTrim))
    What it does
      Cuts token usage
      Works across tools
      Shared policy
    Tech stack
      TypeScript
      Node.js
      Agent Skills
    Use cases
      Diagnose token waste
      Install per-tool adapter
      Slim noisy output
      Run benchmarks
    Audience
      Developers
      AI power users
    Notes
      Supports 5 coding tools
      Measured, not just claimed

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Diagnose how much of a coding agent's token budget is wasted on noisy tool output.

USE CASE 2

Install an adapter to automatically slim test logs, diffs, and file listings before they reach the model.

USE CASE 3

Pipe command output like test results through the reducer to shrink it before pasting into a chat.

USE CASE 4

Run the benchmark suite to measure real token savings instead of relying on self-reported claims.

What is it built with?

TypeScriptNode.jsnpmpnpm

How does it compare?

giuliastro/harnesstrim1476989162/vue-bill-print1e3pm/knowledge-chatbot
Stars111111
LanguageTypeScriptTypeScriptTypeScript
Setup difficultyeasyeasymoderate
Complexity3/52/53/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

Runs directly via npx with no checkout needed, a full clone with pnpm is only required for development or benchmarks.

So what is it?

HarnessTrim is a tool that cuts down how many tokens AI coding assistants use, working across several different tools at once, including Claude Code, Codex, OpenCode, Hermes Agent, and Pi. Tokens are the units these AI systems are billed on, and they get spent in several places: reading noisy tool output like test logs and file listings, the model's own reply text, its internal reasoning, always loaded instruction files, and the conversation history that survives as a session goes on. Most existing tools only reduce waste in one of those areas. HarnessTrim's approach is to coordinate all of them under one shared policy instead. The project has three layers. At the core is a portable pack of Agent Skills, a format supported by each of the tools it targets, which carries the actual policy and costs almost nothing until it is used. On top of that sit small adapters written specifically for each coding tool, translating the shared policy into that tool's own hooks or plugin system. Finally, a benchmark suite backs up its claims with reproducible measurements rather than self reported numbers. In practice, once an adapter is installed, HarnessTrim intercepts the output of tool calls, such as test runs or file reads, and automatically shrinks that output before it reaches the model, while trying to keep the important lines, like error messages or failing assertions, intact. It measures both how much it reduces token usage and whether that important signal actually survives the reduction. You can try it without installing anything by running it directly through npx, using commands to diagnose token waste in a project, install an adapter for a specific coding tool, or pipe noisy command output through it to slim it down. For development or to run the built in benchmarks, you clone the repository and install dependencies with pnpm.

Copy-paste prompts

Prompt 1
Help me run npx harnesstrim doctor to diagnose token waste in my project.
Prompt 2
Walk me through installing the Claude Code adapter for HarnessTrim.
Prompt 3
Explain how HarnessTrim reduces tool output without breaking prompt caching.
Prompt 4
Show me how to pipe my test output through harnesstrim reduce.

Frequently asked questions

What is harnesstrim?

A cross-tool token-saving system that reduces noisy output for AI coding assistants like Claude Code and Codex.

What language is harnesstrim written in?

Mainly TypeScript. The stack also includes TypeScript, Node.js, npm.

How hard is harnesstrim to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is harnesstrim for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.