Skip to content

Instantly share code, notes, and snippets.

@arunsanna
Created July 10, 2025 21:14
Show Gist options
  • Save arunsanna/0a91c6ff05d737f0daa7c7ac3d93bd1e to your computer and use it in GitHub Desktop.
Save arunsanna/0a91c6ff05d737f0daa7c7ac3d93bd1e to your computer and use it in GitHub Desktop.
Claude-Code Integration with Gemini
## Prompt to Add Mandatory Gemini CLI Integration for Large Files
Please add the following functionality to my Claude Code configuration:
1. Create a MANDATORY rule that forces Claude to use Gemini CLI for any file larger than 300 lines
2. Claude must NEVER analyze large files itself - it MUST delegate to Gemini
3. All Gemini commands should run in background with output logging
4. Include "TASK COMPLETED" in all Gemini prompts for completion monitoring
5. Add monitoring loops that check for "TASK COMPLETED" in the output
Specifically:
- Add a new section "MANDATORY LARGE FILE ANALYSIS RULES" after the Privacy Rules in CLAUDE.md
- Update the Pre-Implementation Checks to make file size checking the FIRST step
- Create an /enforce-gemini-check slash command that automates this check
- Add reminders throughout the documentation (Quality Assurance, Code Review, etc.)
- For file splitting, Gemini must be used with prompts that preserve functionality
Example implementation for file analysis:
```fish
set output_file "gemini_analysis_$(date +%s).txt"
gemini --model gemini-2.5-flash -y -a -p "Analyze [file] thoroughly. End with 'TASK COMPLETED'." > "$output_file" 2>&1 &
while true
if test -f "$output_file" && grep -q "TASK COMPLETED" "$output_file"
echo "✅ Analysis complete"
break
end
sleep 2
end
Make these rules absolutely mandatory with penalties for non-compliance. I've noticed Claude missing important details in large files,
so this integration is critical.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment