zap  by bitan-del

CLI proxy for AI coding assistants

Created 1 month ago
262 stars

Top 97.0% on SourcePulse

GitHubView on GitHub
Project Summary

Summary

Zap is a high-performance CLI proxy written in Rust designed to significantly reduce the number of tokens AI coding assistants consume. It addresses the problem of noisy and verbose command-line output overwhelming AI models, offering users substantial token savings (60-90%) with zero quality loss. The tool operates entirely on-device, making it a private and efficient solution for developers integrating AI into their workflows.

How It Works

Zap functions as an intermediary between an AI coding assistant and the shell. It intercepts command output, applying one of twelve distinct filtering strategies—including stats extraction, error-only modes, grouping, deduplication, structure-only views, code filtering, and failure focus—to condense information. This approach ensures that AI models receive a compact, relevant summary instead of thousands of raw lines, optimizing interaction efficiency and cost.

Quick Start & Requirements

  • Prerequisites: Rust toolchain installed via rustup.
  • Installation: Clone the repository (git clone https://github.com/bitan-del/zap.git), navigate into the directory, and run cargo install --path .. This compiles Zap and places the binary in ~/.cargo/bin/. Ensure this directory is in your system's PATH.
  • Build Time: Initial build takes approximately 1-2 minutes; subsequent builds are much faster.
  • Integration: Global hooks can be installed for seamless integration with AI tools like Claude Code, Cursor, Gemini CLI, and Copilot using zap init -g. Restarting the AI tool is necessary after hook installation.
  • Documentation: zap --help and zap init --help provide command-line assistance.

Highlighted Details

  • Achieves 60-90% token savings by filtering command output, with real-world examples showing up to 80% reduction.
  • Employs 12 sophisticated filtering strategies tailored to various command types (e.g., git, cargo, pytest, docker).
  • Provides zap gain for detailed analytics on token savings, including global and per-project scope, historical data, and visual graphs.
  • Offers seamless, transparent integration with numerous AI coding assistants via installable hooks.

Maintenance & Community

The project welcomes contributions, particularly new filters, with a clear checklist provided in src/cmds/README.md. No specific community channels (like Discord or Slack) or notable contributors/sponsorships are mentioned in the README.

Licensing & Compatibility

Zap is licensed under the Apache License 2.0. This license is permissive and generally compatible with commercial use and linking within closed-source projects.

Limitations & Caveats

Users must have the Rust toolchain installed. Troubleshooting may be required if shell environment variables (like PATH) are not correctly configured or if AI tool hooks fail to load, necessitating verification with zap init --show and restarting the AI application.

Health Check
Last Commit

1 month ago

Responsiveness

Inactive

Pull Requests (30d)
1
Issues (30d)
2
Star History
92 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.