Skip to main content

Reduce Claude Code token consumption by batching file tool calls.

Project description

Coalesce CLI

Reduce Claude Code token consumption by batching tool calls into single primitives.

Install

pip install ./coalesce-cli
# or one-liner:
curl -sSL <YOUR_BACKEND>/api/cli/install.sh | bash

Configure

coalesce configure --api-key coa_xxxxx --endpoint https://your-coalesce.example.com

Commands

  • coalesce configure — save API key + endpoint to ~/.coalesce/config.json
  • coalesce status — show current config
  • coalesce demo — run a synthetic optimization pass against a fake task and report savings to the dashboard
  • coalesce report — manually report a Claude Code session's naive/batched counts
  • coalesce version — print the version

How the batcher works

The coalesce.batcher.Batcher class collects individual read_file / edit_file / search requests and coalesces them into a small number of batched primitives:

  • batch_read(files=[...])
  • batch_edit(files=[...], plan="...")
  • batch_search(queries=[...])

Each batch primitive counts as ONE tool call regardless of how many files it touches, avoiding one LLM roundtrip per file.

Model auto-detection

Coalesce auto-detects the Claude model in use (Sonnet 4.5/4.6, Opus 4.7/4.8, Haiku 4.5) via the CLAUDE_MODEL environment variable or the --model flag passed to coalesce demo / coalesce report. Pricing rates are pulled per-model from the Coalesce backend so $ savings are accurate.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

coalesce_cli-0.1.0.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

coalesce_cli-0.1.0-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file coalesce_cli-0.1.0.tar.gz.

File metadata

  • Download URL: coalesce_cli-0.1.0.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.11.15

File hashes

Hashes for coalesce_cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 bf8776e37c1166d14284c103c331c4eb7a375a88345df23b7d13bd3b1239866a
MD5 d6727054bde1023f2d291383f9bd167b
BLAKE2b-256 68124fc6b2ac2650ba5dc45796d1fbeb559a427c537262d563d7bd15d1ea1df1

See more details on using hashes here.

File details

Details for the file coalesce_cli-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: coalesce_cli-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.11.15

File hashes

Hashes for coalesce_cli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0f0896b4c2b3fd8139243b008d2ac9d52691d61b69190951edc9d1589bd25db4
MD5 6ce870d1140f8fa149fd617013a5675b
BLAKE2b-256 36847d5e7ab7c1959afd278c8754520622c1aecfaa430589c08847167b3662a2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page