Research and tools addressing compatibility between Claude Code's claude.md '@' processing and Gemini CLI implementation.
Elevate the CLAUDE.md '@' compatibility issue from low priority by providing evidence-based research that documents differences, demonstrates impact, and builds community consensus.
docs/at-file-inclusion-specification.md- '@' file inclusion syntax specificationdocs/claude-compatibility/- summary and action planscripts/find-claude-md-examples.cjs- GitHub search for real-world examplesscripts/commit-msg,scripts/rewrite_msg.sh- conventional-commit hook and history rewrite toolintegration-tests/claude-compatibility.test.js- Compatibility test suite.github/workflows/ci.yml- CI (node 18.x/20.x)workspace/- my work with Google Gemini CLI (24 issues/PRs, with data)site/- portfolio site (deployed to GitHub Pages via.github/workflows/pages.yml)
Rendered workspace: workspace/ with 24 issues/PRs by or mentioning
@bniladridas (3 merged: #2230, #2978, #13374). Public site builds from the same
data on every push to main (see Pages deployment).
File Boundaries
- Claude:
--- File: /path/to/file.md --- - Gemini:
<!-- Imported from: ./file.md -->
Processing
- Claude: Flat concatenation with deduplication
- Gemini: Hierarchical with in-place replacement
Structure
- Claude: No hierarchy presentation
- Gemini: Tree format preserves hierarchy
LLM Processing
- Inconsistent file boundary recognition
- Variable content ordering affects context
- Different debugging approaches
Migration Challenges
- Existing CLAUDE.md files incompatible with Gemini CLI
- Manual conversion required
- Potential content structure issues
Priority Elevation
- Specification document ✓ (
docs/at-file-inclusion-specification.md) - Real-world examples ✓ (
docs/claude-compatibility/REAL-WORLD-EXAMPLES.md, 7 files / 14 imports) - Impact demonstration ✓ (test suite asserts flat-vs-tree deltas)
- Community engagement (next; draft ready:
docs/claude-compatibility/FORUM-DRAFT.md)
Technical Solution
- Use upstream
importFormat: 'flat'for Claude-style processing (already merged ingoogle-gemini/gemini-cli#2978) - Document tree vs flat modes and when to use each
- Standardized file boundary markers
- Migration tools for existing files
Prerequisites: node >=18.
GitHub Search (set GITHUB_TOKEN to avoid rate limits)
GITHUB_TOKEN=ghp_... npm run searchcd scripts && node find-claude-md-examples.cjsor
npm run searchCompatibility Tests
cd integration-tests && node claude-compatibility.test.jsor
npm run testSpecification Review
See docs/at-file-inclusion-specification.md for detailed syntax analysis.
Conventional Commits This project follows conventional commit standards. To enable commit message validation:
# Copy the commit-msg hook to enable validation (then make executable)
cp scripts/commit-msg .git/hooks/commit-msg
chmod +x .git/hooks/commit-msg
# Preview rewrites first (safe dry-run):
./scripts/rewrite_msg.sh
# Only when clean + backed up, apply:
./scripts/rewrite_msg.sh --applyCommit messages must:
- Start with types:
feat:,fix:,docs:,style:,refactor:,test:,chore:,perf:,ci:,build:,revert: - Have lowercase message body
- Be ≤60 characters for the first line
- Post
docs/claude-compatibility/FORUM-DRAFT.mdto gemini-cli discussions and link replies back here - Re-run
GITHUB_TOKEN=... npm run searchto replace curated examples with live API results - Develop migration guide
- Propose implementation changes (document
flatas recommended forCLAUDE.md-origin files)
This work is released under CC0 1.0 Universal - dedicated to the public domain.