If you're running an AI coding assistant in a loop—asking it to track bugs, manage backlogs, or collect feedback—you're probably hemorrhaging tokens without realizing it. Jack Franklin found this out the hard way while developing his game OnTrack (internal codename: routemaster), and he documented exactly how he fixed it.

The Markdown Trap

Franklin started using Claude Code as a playtesting buddy, logging bugs and suggestions in markdown files that grew unwieldy fast. After just an hour of playtesting he'd collect 50+ issues to fix. Within months his incomplete items file hit 3,000 lines; the completed items document reached 4,000. "Claude was managing this fine," he admits—until you asked it anything specific. The killer: even trivial queries like "show me all high-priority bugs" forced Claude to read the entire file. Want just a list of outstanding issues under one category? Same problem. Every interaction ate tokens parsing data that wasn't relevant to the question at hand.

Enter SQLite

Franklin's solution was a Deno CLI wrapped around an SQLite database with a dead-simple schema: title, detail, priority, status, category, project, and a done flag. Completed items never get deleted—they just get hidden from default queries, preserving full history for when you need it. The key insight was token optimization through query design. Franklin programmed his Claude skill to always list before showing details. "Titles and IDs use far fewer tokens than full item details," he explains in his post. "I didn't want it to have to view all the details of each task until I need it."

Context-Aware Intelligence

The skill also infers which project you're working on from conversation context, so Claude doesn't interrupt you with redundant --project flags every single query. And before storing any new feedback item, it checks for duplicates or related entries—something Franklin found himself doing constantly when describing the same bug two different ways without noticing. One example output shows how rich this gets: When logging a missing visual confirmation issue ("No toast notification when player performs an action"), Claude analyzed his codebase and identified that Logger (src/log.ts) is already a singleton EventTarget with LogOutput ready to render dismissing messages. The AI was doing implementation analysis on the fly while collecting feedback.

What This Teaches Us

The pattern here matters far beyond this specific use case. Structured data beats unstructured files when you're building AI-powered workflows. If your agent needs to query it, index it. And design your prompts to minimize token waste—list metadata first, fetch details on demand. Franklin released the skill on GitHub for anyone who wants to adapt it. He freely admits Deno was chosen because he wanted to try something new rather than always reaching for Node—but the point stands that Claude wrote most of the CLI anyway.

Key Takeaways

  • Unstructured files force AI agents to parse everything, even for targeted queries—structure your data from day one
  • Design skills to list metadata before showing full details—this alone can slash token costs by orders of magnitude
  • Let LLMs infer context rather than hammering them with redundant flags on every request
  • Build duplicate detection into any feedback collection loop—you're probably logging the same issue multiple ways without realizing it

The Bottom Line

The real cost of AI-assisted development isn't the model calls—it's the architectural decisions that make those calls expensive. Franklin turned a 7,000-line markdown nightmare into an efficient query machine by thinking like a database engineer instead of a note-taker. If you're building anything with AI in the loop, ask yourself: where are my agents reading more than they need to?