GC-301i · Module 2
Knowledge Sharing Patterns
3 min read
Gemini CLI sessions contain valuable knowledge that typically evaporates when the terminal closes. Session exports (/chat share) capture the full reasoning process — not just the final code, but the questions asked, alternatives considered, tradeoffs discussed, and decisions made. A team that exports and indexes significant sessions builds an organic knowledge base that is far more useful than formal documentation because it captures the context and reasoning, not just the conclusions.
Knowledge sharing through GEMINI.md is the most scalable pattern. When a developer solves a tricky problem with Gemini, the fix goes into the codebase, but the insight — "the auth middleware must run before the CORS middleware because..." — goes into GEMINI.md. Over time, the project memory file accumulates hard-won knowledge that every future developer and AI session benefits from. This is tribal knowledge made permanent, searchable, and automatically loaded into every Gemini session.
# Knowledge sharing workflow
1. CAPTURE: Export significant sessions
/chat share --format markdown > sessions/auth-migration-2026-04.md
2. DISTILL: Extract reusable insights into GEMINI.md
## Gotchas
- Auth middleware must run before CORS middleware (see sessions/auth-migration)
- Prisma batch operations limited to 1000 items — use chunking for larger sets
- Redis connection pool: max 10 in dev, 50 in prod (see infrastructure notes)
3. ENCODE: Convert patterns into custom commands
.gemini/commands/fix-auth.toml → Standard auth debugging workflow
.gemini/commands/optimize-query.toml → Query optimization checklist
4. SHARE: PR the knowledge artifacts
git add GEMINI.md .gemini/commands/
git commit -m "Add auth debugging workflow from migration session"
gh pr create --title "Share auth migration insights"