DEV Community

Cover image for I Got Tired of Reading Strangers’ Codebases, So I Built an AI That Reads Them For Me
Nithin Pradeep
Nithin Pradeep

Posted on

I Got Tired of Reading Strangers’ Codebases, So I Built an AI That Reads Them For Me

Every developer knows this feeling: you open a repo you've never seen before — maybe for a new job, a contribution, an audit, or just curiosity — and you're suddenly playing detective. Cmd+Shift+F for a function name. Scrolling through a 2,000-line file trying to figure out who calls what. Reading a README that was last updated two major versions ago.

It's not that the code is badly written. It's that understanding a codebase is fundamentally different from reading it. You don't need every line — you need answers to questions like:

  • "How does authentication actually work here?"
  • "Where would I add a new API route?"
  • "What does this PR change, and is it risky?"
  • "Which files would break if I touched this module?"

So I built CodeLens — a tool that lets you paste a GitHub or Bitbucket URL and just ask the codebase those questions in plain English, with streaming answers grounded in the actual source.

What it does

The flow is intentionally dead simple:

  1. Paste a repo URL. CodeLens clones it and indexes every source file into a vector store using syntax-aware chunking (tree-sitter under the hood, so it understands the difference between a function and a comment block).
  2. Open the chat. Ask anything — "Where are the database models defined?", "How is rate limiting implemented?", "What does the hybrid_retriever do?" — and get a streamed, source-cited answer.
  3. Go deeper than chat. Browse symbols, search code semantically, visualize the dependency graph, or get a health summary — all without leaving the repo you just indexed.

It's basically a research assistant that has actually read the whole codebase before you ask your first question.

A quick tour of what's inside

Natural language Q&A with streaming answers — Ask anything about the codebase and watch the answer stream token-by-token, with the actual source chunks it pulled from shown alongside.

Local or cloud, your choice — Run it fully offline with Ollama (zero data leaves your machine), or switch to Claude, OpenAI, Groq, or Gemini per chat session. Helpful when you're working with a sensitive private repo and want to keep everything local.

Semantic code search — Search by intent, not keyword. "Where do we handle file uploads?" finds the right code even if the function is named process_attachment.

Symbol navigator — Every function, class, and method extracted via AST, filterable by kind, with a one-click jump straight into a chat about that symbol.

Dependency map — An interactive force-directed graph of module-level imports, so you can actually see how a codebase is wired together instead of guessing from import statements.

Repo health summary — Complexity hotspots, TODO/FIXME/HACK locations, and a rough test-coverage estimate, generated automatically from the indexed code.

PR & diff analysis — Paste a GitHub PR URL or a commit SHA and ask "what does this change?" or "what could break?" — useful for reviewing other people's PRs or getting up to speed on what just landed on main.

Cross-repo comparison — Index multiple repos and ask comparative questions in a single chat (e.g. "how does this project's auth differ from that one's?").

Private repos, securely — Pass a GitHub PAT directly in the UI; it's never persisted server-side.

How it's built (for the curious)

Under the hood it's a fairly standard but carefully tuned RAG pipeline:

  • FastAPI backend serving everything over REST + Server-Sent Events for token streaming
  • LlamaIndex orchestrates the RAG pipeline, with a tree-sitter–backed CodeSplitter for syntax-aware chunking across Python, TypeScript, JavaScript, Go, Java, and more
  • ChromaDB as the vector store, persisted per repo
  • A hybrid BM25 + vector retriever with optional cross-encoder reranking, so answers are grounded in the most relevant chunks rather than just the most semantically similar ones
  • SQLite via SQLModel for relational data — repos, chats, messages, extracted symbols, dependency edges
  • Next.js 16 + TypeScript + Tailwind + shadcn/ui on the frontend, with TanStack Query handling all server state and native EventSource for the SSE streams

Nothing exotic — just a pipeline built to actually be useful for code, where structure and relationships matter more than they do for prose.

Try it yourself

It's open source (MIT licensed) and runs with a single command via Docker:

git clone https://github.com/nithiin7/repo-chat.git
cd repo-chat
cp backend/.env.example backend/.env   # add cloud API keys if you want CLOUD mode
docker compose up --build
Enter fullscreen mode Exit fullscreen mode

Open http://localhost:3000, paste in any public GitHub repo URL, and start asking questions. (First run: pull the local model once Ollama's container is up — docker exec -it <ollama-container-id> ollama pull qwen3:4b.)

If you'd rather skip Docker, the manual setup (Python 3.11+ / Node 22+) is just as quick — instructions are in the README.

What's next

I'm actively iterating on retrieval quality, adding more language support to the chunker, and refining the diff/PR analysis flow. If you try it and hit something confusing, broken, or just have an idea for what would make it more useful for your workflow — I want to hear about it.

If you find this useful

A star on github.com/nithiin7/repo-chat genuinely helps — it's the easiest way to support an open-source side project and helps other developers discover it too.

And if you give it a spin, I'd love to know: what's the first question you asked your codebase?

Top comments (0)