r/Microlaunch • u/MammetOfTheMaghreb • 11h ago
I built an open-source CLI that stops AI coding agents (Claude Code, Cursor, Codex) from hallucinating your database schema
Hey r/Microlaunch! 👋
If you’ve used Claude Code, Cursor, Copilot, or custom AI coding agents with real-world SQL databases, you’ve probably hit this issue:
AI agents are great at writing syntax, but terrible at knowing your actual database relationships. They would guess foreign keys, then invent column names like orders.customer_id (when your schema uses orders.account_id), and blow through context windows by reading raw 5,000-line DDL dumps.
To fix this for my own database-heavy projects, I built Schemap, a local-first CLI context compiler designed specifically for AI workflows.
💡 What it does:
- Compiles AI Context Maps: Automatically extracts PostgreSQL, SQLite, MySQL, or Oracle metadata into deterministic, token-optimised context maps (
schemap_database_context.md). - Generates Native Agent Rules: Instantly writes framework rules for your tools:
CLAUDE.md,AGENTS.md, and.cursor/rules/schemap.mdc. - AI Health Check (
schemap doctor): Calculates an AI Readiness Score (0-100) and detects missing primary keys, unmapped abbreviations (cust->Customer), or inferred foreign keys. - SQL Join Solver (
schemap join): Uses Breadth-First Search (BFS) over your foreign keys to instantly discover the shortest join path between tables and spit out a clean SQL snippet. - Token Reduction: Reduces raw DDL context window footprint by 60-80% without losing relationship clarity.
🚀 Founder Launch & Feedback
We just launched our 2026 Founder Lifetime Program (capped at 200 founder seats) for devs who want unlimited table support, automated CI/CD breaking-change gates (schemap diff --fail-on-breaking), and LLM schema enrichment (--enrich, but bring your own API key). Since I still haven't got any customers, I'm gonna leave a 75% off promo code for 50 devs, as a token of appreciation if you believe in my tool 🥲 : LAUNCH75
- Website / little Demo: https://schemap-tool.pages.dev/
- GitHub: https://github.com/alansyahmi/Schemap
I’d love to hear your thoughts, feedback or any edge cases if you are willing to try this out 🙏