DEV Community

Cover image for How I bundle my codebase so ChatGPT can actually understand it
Konstantin Tarkus
Konstantin Tarkus

Posted on

How I bundle my codebase so ChatGPT can actually understand it

LLM chat apps are great at answering questions — until you point them at a real codebase.

Once a project grows past a certain size, context becomes the bottleneck: too many files, too much noise, not enough structure.

I kept running into this while working with modern JS / Bun projects, so I built a small CLI to solve my own workflow problem.

The problem

Most LLM chat apps work best when:

  • context is linear

  • files are grouped by meaning, not size

  • references are precise (file + line)

But real repos are:

  • hierarchical

  • noisy

  • full of things the model doesn’t need

The result is vague or hallucinated answers.


The approach

Instead of feeding the whole repo, I generate an LLM-optimized snapshot:

  • code is bundled by domain (web, api, docs, etc.)

  • each bundle is indexed with file paths + line numbers

  • .gitignore is respected by default

  • no config needed to get started

The output is just plain text files — easy to upload or attach to ChatGPT, Gemini, or Claude.

That tool became srcpack.


How I actually use it

A few workflows where this has been surprisingly effective:

  • Exploring large repos – Asking “where does auth actually live?” or “what touches billing?”

  • Avoiding context limits – Instead of pasting files manually, I attach a focused bundle.

  • Sharing with non-technical teammates – I upload an LLM-friendly snapshot to Google Drive and share it.

PMs or designers can ask:

  • “What shipped this week?”
  • “What’s still in progress?”
  • “Which parts are risky?”

It acts like a lightweight, read-only AI interface to the codebase.


Example usage

npx srcpack # or bunx srcpack
Enter fullscreen mode Exit fullscreen mode

That’s it — zero config by default.


Links


Closing thought

I don’t think this is the final answer to LLM + codebase interaction, but it’s been a very practical improvement for day-to-day work.

Curious how others are handling large-repo context with LLMs — especially in fast-moving projects.

Top comments (0)