‹ BackHN Continuity

Thread

One Month Without AI

188 points · 228 comments · saibotk

  1. stack_framer · · focus · HN ↗
    My employer pays for Claude, and my approach is to use it as a better Google search. It's often not better.

    Just today it made three glaring mistakes in one session:

    1. It read a file in the wrong directory, because that file had the same name as the file in the right directory. It apologized when I challenged it, promising me that it would remember to "read import statements" in the future.

    2. It miscounted the number of times a function was called in my repo. It said 20, while my built-in IDE search accurately showed 17. Again, it apologized when I corrected it.

    3. It referred to a variable by name that does not exist anywhere in my code. It apologized, and said it was referring to a variable used internally by one of the third-party packages installed in my repo.

    So many apologies.

    It's the little things like this that remind me on a regular basis just how little I can trust artificial "intelligence."

    1. dkn · · focus · HN ↗
      I have had a ton of success in exposing AST-based tools to agents when working in large, old codebases.

      Without them, not only do agents get simple things like function call counts wrong, they tend to return different results. I use this as an example when showing people how the tooling works.

      Grep is fine for simple use cases. A step up from that is ast-grep and I need to explore this tool more. But I had the most success building a small pipeline that reads the old code base, parses it file by file using tree sitter, and then loads it into a SQLite database for querying. For example, I have it capture construct definitions and usages and represent those as directed edges and nodes in a single table depending on the node type. The agent is instructed on how to query it and perform interesting queries like build call graphs, or determine dependencies between domains (modularity is not great in this codebase) which is helpful for us to extract around capability lines.

      I also calculate fitness statistics, and have some code to capture specific details and knowledge about this very old framework that short circuits agent work in the future. We have some “interesting” magical libraries and functions that block static analyzers from going beyond the call site. This is mitigated, and means agents don’t have to “guess”.

      Making all of this available to the different team members at my work has been pretty helpful. It’s faster (fewer tool calls), cheaper (fewer tokens), and accurate.

      1. jiehong · · focus · HN ↗
        I wish LSP servers would fill that gap, but they tend to work based on a cursor position.

        Otherwise, that’s exactly the tool to help those kind of queries IMO

Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.