frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Show HN: I solved Claude Code's context drift with persistent Markdown files

3•Tanishq0333•1h ago
I've been using Claude Code to build SaaS products, and kept hitting the same wall: it writes brilliant code for 20 minutes, then forgets your database schema and starts rewriting working code. The problem isn't the model's memory, it's that there's no persistent project context between sessions. Come back tomorrow and Claude has zero knowledge of what it built yesterday. My solution: Force Claude to read project truth files before every action. I built a multi-agent system that creates persistent context files upfront: PROJECT.md - What you're building, business model, core features REQUIREMENTS.md - Database schema, auth flows, API structure, edge cases ROADMAP.md - Build phases with success criteria STATE.md - Current position, completed work, pending tasks How it works:

AI Product Manager asks questions most developers skip:

"How does money flow through this?" "What happens when users cancel mid-month?" + Any Edge cases specific to your SaaS

Creates the markdown files from your answers. Claude Code reads these files before writing ANY code. No guessing. Can't forget the schema, it's literally documented. Executor agents spawn per task, each reading the same context files. They build in parallel but never break what's already working. Verifier agent tests against success criteria after each phase. If broken, spawns debugger agent with persistent investigation files.

Results: Built 3 products in 30 days using this system:

Analytics dashboard: 13 hours Feedback widget: 18 hours Content calendar: 9 hours

No context drift. No "Claude forgot my auth system" moments. Just consistent builds. The biggest difference: Saturday: Build auth with Claude Sunday: Come back, describe next feature Claude reads REQUIREMENTS.md, sees existing auth schema Builds new feature without touching auth vs. the normal experience of Claude rewriting everything. I packaged this as PropelKit (Next.js boilerplate + AI PM system that creates these files automatically). But the core concept, persistent markdown context, works with any Claude Code setup.

Try it: https://propelkit.dev

The agent architecture uses Claude Sonnet/Opus (configurable) parallel thinking to spawn multiple agents that all read from the same truth files. Happy to answer questions about the implementation.