claude-gemini-bridge  by tkaufmann

Intelligent code analysis integration

Created 2 months ago
285 stars

Top 91.9% on SourcePulse

GitHubView on GitHub
Project Summary

This project provides an intelligent bridge between Claude Code and Google Gemini, designed for large-scale code analysis. It automatically offloads complex or large code analysis tasks from Claude to Gemini, leveraging Gemini's extensive context window and processing power to enhance Claude's capabilities. This is beneficial for developers and researchers who need to perform in-depth analysis on large codebases without being limited by Claude's native context window.

How It Works

The bridge integrates with Claude Code via its hook system, specifically the PreToolUse hook. A decision engine within the bridge analyzes incoming tasks, considering factors like the number of files, total token count, and file size. If a task exceeds predefined thresholds (e.g., more than 50k tokens, 3+ files), it's delegated to the Gemini API. A path converter ensures compatibility between Claude's relative paths and Gemini's requirements, and a cache layer stores Gemini's responses to avoid redundant computations.

Quick Start & Requirements

  • Installation: Clone the repository and run the ./install.sh script. Restart Claude Code after installation.
  • Prerequisites: Claude Code CLI, Google Gemini CLI, jq, bash 4.0+.
  • Setup: The installer handles merging hooks, backing up settings, and testing components. Global installation is recommended for system-wide use. Project-specific configurations can be managed via environment variables or local .claude/settings.json.
  • Docs: README

Highlighted Details

  • Automatic delegation based on token count, file count, and size thresholds.
  • Excludes sensitive files (e.g., .env, .key, .secret) from analysis.
  • Supports global and project-specific configurations and overrides.
  • Includes a caching layer for Gemini responses and options for log/cache cleanup.

Maintenance & Community

The project is actively maintained, with clear guidelines for contributing and a focus on community feedback. Issues and feature requests can be submitted via GitHub.

Licensing & Compatibility

The project is licensed under the MIT License, permitting commercial use and linking with closed-source projects.

Limitations & Caveats

The effectiveness relies on the correct setup and configuration of both Claude Code and the Gemini CLI. Performance may vary based on network conditions and Gemini API response times. Some advanced configurations might require manual adjustments to the debug.conf file.

Health Check
Last Commit

1 month ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
1
Star History
53 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.