PRECC Tool Cuts Claude Code API Costs with Pre-Tool-Call Compression

PRECC is an open source tool that reduces Claude Code API costs by compressing redundant context before it reaches the model. It uses a pre-tool-call hook that intercepts Bash, Read, and Grep calls to apply compression algorithms.
How It Works
The tool addresses cost issues where API bills were climbing due to redundant context being sent multiple times. Common sources of waste include:
- Same file contents sent repeatedly
- Verbose shell output
- Overlapping grep results that the model doesn't need in full
The pre-tool-call hook runs RTK (Redundancy-aware Token Kompression) on tool output before it reaches Claude. The compression process:
- Deduplicates repeated spans
- Strips noise
- Summarises large reads
- Returns compressed version to the model
Performance Results
The hook runs in approximately 2.93ms, adding no perceptible latency to operations. In practice, users see 40-66% fewer input tokens across typical coding sessions. Model output quality remains unchanged because the compression preserves signal while stripping redundancy.
This type of optimization is particularly useful for developers using Claude Code extensively, where repeated file reads and tool outputs can significantly increase token usage and costs.
📖 Read the full source: r/ClaudeAI
👀 See Also

Bridge Claude Code to Chat Apps for Remote Interaction
A GitHub project called cc-connect bridges Claude Code to messaging platforms like Slack and Telegram, allowing remote interaction without exposing your local machine. The agent runs locally while a small bridge relays messages between the agent and chat apps.

YouTube Transcript MCP Improves Claude Research Workflow
A YouTube transcript MCP allows Claude to pull full transcripts with timestamps from YouTube links, eliminating manual tab switching and copy-pasting. The user reports significantly better answers when Claude has actual transcripts versus user summaries.

Qhatu: Platform Turns GitHub Repos into Pay-Per-Use Micro SaaS with Claude
Qhatu is a platform that takes a GitHub repository and deploys it as a pay-per-use micro SaaS with a generated frontend and integrated payment processing. The system uses Anthropic APIs to analyze code, generate Dockerfiles, and create storefront UIs.

Chapper: Native iOS Client for LM Studio, Ollama, and OpenAI-Compatible Local Models
Chapper is a native SwiftUI iOS app that connects to LM Studio, Ollama, and OpenAI-compatible local models without cloud services or accounts. It offers real-time token streaming, full sampling controls, reasoning model support with <think> tags, and export in 7 formats.