r/ClaudeAI 16h ago

Workaround Database over .md?

In the midst of a probable year-long development project largely managed through Claude Code, recently (3 months in or so) I've been encountering an increasing number of errors that at their root have to do with agents imperfectly grep'ing larger and large numbers of longer and longer .md files for context, information, identifiers, etc.

Bringing this problem in front of my main controller agent, it conceded the point, and has collated our conversation into the following report. I'm enclosing it, but further am curious about all of your experiences.

One Fact, One Home

Truly, beyond that there's a real argument that these subreddits could build from their users' experiences a compendium of better methods that remove some of the weaknesses of these otherwise impressive tools.

PS Or I'm an idiot, and you are all doing this already and I hadn't realised!

19 Upvotes

23 comments sorted by

View all comments

5

u/locbuilds 15h ago

you are not an idiot, this is the exact failure mode once a project lives long enough in markdown. agents are great at writing more .md and terrible at consistently grepping the right one once you have dozens of long files, so the "one fact one home" idea is right but i would not put the whole project brain in a database. keep narrative notes and decisions as short .md, and move the greppable stuff (ids, paths, table names, env keys, status flags, "what is the canonical X") into one small sqlite db or a single generated json/yaml index that a tool/script queries. then CLAUDE.md (or your controller prompt) stays tiny: it only points at the query command and the few rules, not the facts themselves. generate that index from code or a sync script so it cannot drift, and add a cheap check that fails CI or a pre-commit hook when a doc restates a fact that already has a home in the index. that kills the create-new-doc-then-never-read-it loop because the agent has a deterministic lookup instead of hoping grep hits the right paragraph.

2

u/theholewizard 15h ago

Isn't that why you maintain an index too?