token-optimization

Audit prompts and agent histories to reduce token usage with quantified savings.

2|Updated Apr 10, 2026
One-click install
npx skills add https://github.com/t0lab/harness-kit --skill token-optimization-t0lab
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: token-optimization
Source: https://github.com/t0lab/harness-kit/tree/main/.agents/skills/token-optimization
Command: npx skills add https://github.com/t0lab/harness-kit --skill token-optimization-t0lab

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Reduce token usage without sacrificing quality across prompts, system prompts, agent history, RAG pipelines, and tool schemas by auditing and compressing repetitive patterns and outputs.

Core Features & Use Cases

  • Audit prompts, system prompts, and history to identify repeating surfaces and high-cost sections.
  • Propose concrete, safe diffs with estimated token savings and rationale.
  • Support for surface-level optimizations like trimming verbosity, shortening tool schemas, and consolidating histories.
  • Real-world use: optimize a long chain-of-thought prompt to fit within budget while preserving constraints.

Quick Start

Use this skill to audit a current prompt pipeline and return a prioritized list of token-reducing changes with expected savings.

Frequently Asked Questions about token-optimization

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I reduce token usage in LLM prompts without losing quality?

To reduce token usage without losing quality, audit prompts, system prompts, and agent histories to identify repeating surfaces. Apply concrete, safe diffs to compress repetitive patterns and trim verbosity while preserving original behavior.

What's the best way to optimize tokens in a RAG pipeline?

The best way to optimize tokens in a RAG pipeline is to audit high-cost sections and repetitive patterns. Consolidate histories and shorten tool schemas to deliver quantified token savings while maintaining retrieval accuracy.

How does a token audit work for agent histories?

A token audit for agent histories works by measuring baseline token counts and identifying repeating surfaces. It delivers structured diffs with suggested changes and risk notes to safely compress history length.

Can I optimize tool schemas to save tokens across AI workflows?

Yes, you can optimize tool schemas to save tokens across AI workflows. Shortening tool schemas is a surface-level optimization that reduces token waste while preserving function definitions and expected behavior.

Does prompt compression affect chain-of-thought constraints?

Prompt compression preserves chain-of-thought constraints by proposing safe diffs with risk notes. It optimizes long prompts to fit within budget while ensuring original constraints and reasoning behavior remain intact.

Why does my LLM prompt exceed the token budget during long conversations?

Your LLM prompt exceeds the token budget due to repeating surfaces and high-cost sections in agent histories. Auditing and consolidating these repetitive patterns provides quantified token savings to fit within budget.