Ask HN: How do you search large code-base before adding a feature or fixing bug?

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • hound

    Lightning fast code searching made easy

  • Especially if this is long term, this is a great tool:

    https://github.com/hound-search/hound#hound

    It would be great if someone integrated this with tree-sitter plus something to make the search semantics a bit smarter about usages of X:

    https://www.etsy.com/codeascraft/announcing-hound-a-lightnin...

    Screenshots:

    https://jaxenter.com/hound-go-react-code-search-engine-15008...

    Another trick I use for Java: javap all the Enums out of the compiled artifacts; these indicate weird things like "modes" that you can use to start asking questions relevant to the domain. Like "why are there four ways to reprice an invoice" or finding the "types" of fees or w/e in a billing system. (assuming enum classes are used)

  • the_silver_searcher

    A code-searching tool similar to ack, but faster.

  • I almost always fall back on ag (https://github.com/ggreer/the_silver_searcher).

    Honourable mentions to cscope and ctags. They work for me since most of my $dayjob involves me mucking around with C++.

    All tools get invoked from within Vim. (Which _also_ works reasonably well in Windows Terminal).

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • septum

    Context-based code search tool

  • I work on code bases with millions of lines, so I wrote a tool called Septum to help me (https://github.com/pyjarrett/septum/). This isn't to replace grep or ripgrep or silver searcher, those are all great tools you should have!

    Septum is neighborhood based (context-based) search, so you can find contiguous groups of lines which contain specific things, but exclude other things. It's also interactive so you can add/remove filters as needed. This makes it useful for those cases where terms change based on their context so you can exclude terms related to the contexts you don't want to keep. It reads .septum/config which contains its normal commands to load directories and settings, so you can have different configs per project you're working on.

  • codesearch

    Discontinued Fast, indexed regexp search over large file trees

  • Whenever I work on huge codebase (think 1M+), I always reach for Russ Cox's codesearch https://github.com/google/codesearch. It requires indexing the codebase first, which takes 15 minutes or so, but after that searches are instant.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts