8 ms·
Grep beats LSP? Why coding agents ignore your fancier tools
- fif7y 12d ago[flagged]
- nomilk 13d agoTangental, but my LSP config breaks every few months. I don't bother to fix it anymore, I open an LLM in ~/dotfiles and complain until it works again, usually in a few minutes. What's interesting is observing how much work this takes. (it gives me much more empathy toward my past self; how was a clumsy human supposed to know and reason about these things!?, especially when I hadn't touched the configs since a few months prior and had forgotten them almost entirely). Most often there's 10-20 very small programs all working together to give the desired experience. The amount of minutes and tokens required to solve these seemingly simple problems like "My LSP isn't working" is sometimes much more than expected.
- weknowbetter 13d agoI bet if you look back, you were using a lot less effort in the past than what you see the LLM doing now. They are pretty bad at taking a straight line to the solution.
- tombert 13d agoI have the exact same anecdote; it makes me wonder if this is a common enough use case that a small language model could be trained and run locally for these kinds of “configuration bullshit problems”. I feel like a very large percentage of my Claude usage ends up having it automate configuration shit, because historically that has been the part of software engineering I have always hated.
- SSLy 13d agoit's not small but DS4F is cheap enough to have a go on this, it works wonderfully
- 6yyyyyy 13d agoThis seems like the LLM is vastly overcomplicating things. My entire Neovim config is a single 500 line init.lua and this is enough for LSP to work.
- jeltz 13d agoLLMs love overcomplicating things so that is to be expected.
- lelandbatey 13d agoMy nvim LSP config is 20 lines and mostly consists of "if you see X language, use Y program as LSP". I also have been using the same LSP config for approximately 7 years. I don't get the pain.
- chachachainsaw 13d agoI mentioned on the main thread, but thought it would be topical here too. Claude Code ships LSP support but only if packaged within a plugin. So there are hoops you have to jump through to get it rather than getting it out of the box. But it might be long term more reliable than ad hoc fixes?
- wonnage 13d agoThis article presents some evidence for why Grep might work better but I don’t think it does a great job of explaining why it gets chosen - is it something that was intentionally reinforced during training or was it just because LSP is harder to train on because it’s usually hidden behind some IDE interface There’s no reason why you couldn’t write a search tool that e.g combines LSP and grep. Or ast-grep, for that matter. It feels like one of those things we haven’t spent much time investigating because grep is good enough
- kaonashi-tyc-01 13d ago"is it something that was intentionally reinforced during training or was it just because LSP is harder to train on because it’s usually hidden behind some IDE interface" that's also my doubt, it's much easier to train with grep while only a fraction of project can setup LSP properly.
- nullbio 13d agoTraining a model on ast-grep would be a huge intelligence and performance boost, I think.
- poytr1 13d agoI am thinking of where the initial training data came from. For example, Claude Code likely collected a substantial number of real-world coding trajectories through its CLI. However, trajectories involving tools such as LSP, MCP, or AST-grep were probably scarce in the dataset. This lack of representation may also indirectly limit the effectiveness of subsequently generated synthetic data.
- brunoborges 13d agoWhat has worked well for me is to have a SKILL that instructs to use the LSP more often than not. LSP works best when using dependencies that are already compiled locally, but if all source is available, yeah... I still don't have a solid answer on which one is best. But again, for already compiled dependencies (think Java bytecode), without LSP configs, the agent is likely going to attempt to extract binaries from JAR files, use grep and javap, and potentially attempt to decompile the .class files.
- nxc18 13d agoIt is astonishing how easy it is to see the AI hand at work in the writing. Really, it is almost impossible not to see. I don’t get how these people feel it is appropriate to pass off slop like this and not even bother to edit it. Just painful to read.
- rexpop 13d agoShut up. Just shut up. > Avoid generic tangents. > Please don't post shallow dismissals > Please don't complain about tangential annoyances—e.g. article or website formats, name collisions, or back-button breakage. See: Hacker News Guidelines
- nxc18 13d ago> Please don't post shallow dismissals I’ll point out you also violate this guideline. Do you seriously read the article and not see that it is extremely low signal-to-noise? And full of non-sequiturs and strange unnecessary clarifications? And passed off as a research project. “Claude, write an article about why agents use grep instead of LSP” This would have saved everyone the pain of reading this. As another user pointed out: “Training support is a hypothesis consistent with these results, not something this study proves.” is not a sentence a human would write, nor is it a sentence that a human should ever be made to read. I apologize for reproducing it; the article is chock full of these “gems”.
- chvid 13d ago100%. This article is written by AI. The problem is it makes you doubt the whole thing: Did the person behind this do any work at all? Or is this just content marketing for an AI project - something that used to require time and effort - but now can be done by anyone with a click on a button. Too bad. Because this is sort of an interesting subject.
- IanCal 13d agoHave you never read human writing before? Humans write all kinds of confusingly worded things all the time - it’s why we have editors even for writers who are the cream of the crop. But also that sentence is entirely fine as it is to me, it’s pretty simple and clear isn’t it?
- tonyarkles 13d agoThere’s been an interesting co-evolution that I’ve been experiencing with Claude Code. I’ll ask it to do a task, I’ll watch what it’s doing (often lots of find and grep and ripgrep) and then after the task is complete I’ll ask it if there are any tools that would’ve made the job easier. This has led to tools like fzf and others (notmuch for indexing email, for example). I’ve then taken those tools and figured out how to work them into my own workflow, both CLI and Emacs. We’ve also collaborated on some Python tooling that takes a rather slow data format that I often have to process and analyze, indexed the whole corpus, and for analysis I can do (or Claude Code can) a single-pass conversion to Parquet which is then queryable with DuckDB. That tool has dramatically improved my turnaround time on one-off analysis tasks and as a Python CLI tool using Typer, the interface is also nicely discoverable for LLM harnesses to work with.
- NewsaHackO 13d agoWhen you use “we” hopefully you are referring to someone on your team. Just be careful, the first step down the rabbit hole of AI psychosis is humanization of LLM.
- monster_truck 13d agoThis has not been my experience at all.
- aitchnyu 13d agoWhich language and agent? I used Aider on a Python project which had string references (as opposed to module tree) and cross-repo references. LSP lookups were fast and I hated it when Aider used 2M tokens a day, but grep was more complete.
- monster_truck 12d agoAny, any. I've got something a bit more cursed and complicated going on. Need to clean it up, just ask your LLM to explain it https://github.com/doublemover/PairOfCleats https://github.com/doublemover/PairOfCleats
- fithisux 13d agoI don't see why someone needs an LLM as an LSP when code is structured data.
- farhanhubble 13d agoJust a few days ago I was pondering why an Emacs like environment that provides such powerful tools to examine and manipulate texts is not being used more prominently than say VSCode where you need to be build many features or use plugins or rely on system utilities.
- normie3000 13d agoIt's CapEx vs OpEx.
- szundi 13d ago[dead]
- luciana1u 13d ago[flagged]
- polotics 13d agoAt the end of the first paragraph there is this sentence: "Training support is a hypothesis consistent with these results, not something this study proves." I understand it, but I find the wording very unnatural. To improve readability I would have written it in the active form: "We cannot prove training explains this result, but this fits the data best."
- temac 13d agoThe text seems LLM generated. Maybe it is mixed with some human editing because it is not too bad. But you still have typical LLM constructs.
- x-complexity 13d agoSetting up an LSP relies on 2 requirements to properly work: (a) The LSP's tools being competently built & consistent, and (b) the LLM using it having been properly trained to use LSPs in general. Using a native tool like grep has the same 2 assumptions, but (a) is satisfied due to ossification of grep's core features (a good thing), and (b) is extra-satisfied because the LLM can be trained to properly use grep specifically, and not "20th variation of grep wrapped behind an LSP, but just different enough to throw curveballs". On top of that, grep is almost always present in default Linux environments, so its presence is assumed & can be relied upon when needed.
- moustache_hn 12d ago[flagged]
- Glyptodon 13d agoTBH I frequently have a hard time getting Claude to use LSP at all. I'm not sure if it just breaks or what. It's like 10 items down on my list of random crap to figure out eventually.
- the_duke 13d agoI've had great success with a tool I wrote that can print sparse ASTs for code. https://github.com/theduke/smartedit https://github.com/theduke/smartedit With the skill installed GPT 5.6 usually automatically uses it, and it reduces code exploration time and token usage significantly, for example by just printing the types and functions in a file without bodies, and only expanding when needed. (note: it also has editing functionality, which doesn't work so well, since the models are heavily tilted towards common editing tools in post training)
- vorticalbox 13d agoThis look interesting. I have a large mono repo at working ill got it a go.
- poytr1 13d agoInteresting tool, it seems that dedicated skills for these tools are important. Even explicit system-prompt instructions—such as “you must use tool X for code exploration”—often fail to behave as expected. Another tricky part is that how to evaluate customized toolsets properly and ensure they continue to work perfectly as the underlying model/harness evolves.
- anilgulecha 13d agoVery good tool: I see the go support is not released. Will you be cutting a new release? Will take it for a spin. IMO you can specialize this as a read only AST/search tool, as you said, let models use regular edit tool. Also some sample commands runs and output, would be useful in the README, for anyone passing by.
- the_duke 13d agoYeah, I'll do a new release with a whole bunch of local fixes later today.
- bandrami 13d agoAs a guy who started in lisp I always find LSP to be a weird uncanny valley situation. It's like 99% of a REPL, but it will always have corner cases where that 1% difference is important.
- aerzen 13d agoI still don't understand what is about REPL that lisp people find particularly useful. Do you recommend any resources explaining the workflow?
- bandrami 13d agoIt's the same reason people like symbolic debuggers: you can run your program as many lines at a time as you want and stop and inspect the state whenever you need to. I haven't really used jupyter but I understand the workflow there is very similar.
- norman784 13d agoNot only Lisp, but Javascript and Ruby (AKA dynamic languages) devs also rely heavily in REPLs, for me at least the reason is that you don't know what value a variable holts, so you need to inspect them somehow, with typed languages you have less reasons to reach such tool.
- bandrami 13d agoiPython was famous for a while but I think its popularity has waned, but yes as you point out really any dynamic language can do a repl; it's just that it's mostly the lisp/scheme and forth families that have leaned so heavily into the idea.
- Bjartr 12d agoNot only dynamic languages! Java has `jshell` for instance
- deleted 13d ago[deleted]
- mangecoeur 13d agoI’ve had good results with JetBrains AiChat in that really integrates in their IDEs - you can see it using ide tools and i generally found it spends less time thrashing about compared to Claude.
- byako 13d ago[dead]
- pytonslange 13d agoI wonder if the experiments were done before https://github.com/anthropics/claude-code/issues/30948 https://github.com/anthropics/claude-code/issues/30948 was closed. There still seems to be a lot of issues with lsp/pyright, and might contribute to why grep at least gives a more stable and predictable performance (https://github.com/anthropics/claude-code/issues?q=is%3Aissue%20state%3Aopen%20pyright%20label%3Abug%20state%3Aopen https://github.com/anthropics/claude-code/issues?q=is%3Aissu...)
- kaonashi-tyc-01 13d agoit's done before that. Also, I hope we do experiments for other agents like codex.
- zby 13d agoHumans don't use command line lsp tools - why should agents use them? I use lsp when it is integrated in the IDE - but I haven't seen yet any usable command line tools - even if theoretically it would be very useful to type 'lsp-python -replace-function-name foo bar'.
- ramon156 13d agohow come we shifted away from tree-sitter? i still feel like if you're going to let a neural network program, let it generaye an AST. it doesnt matter if it gets the name wrong, as long as the code makes sense.
- alankritxghoshx 13d ago[dead]
- wodenokoto 13d agoAnyone noticed how Gemini in antigravity often devolve into catting scripts into a python file and the script is just a search and replace against an existing file. So and edit operation becomes 1. Use bash to stream code into a new file 2. Run file 3. Check the change step 2 did. 4. Delete file from step 1
- runtime_lens 13d ago[dead]
- RyoItabashi 13d ago[flagged]
- ghthor 13d agoI use serena as an MCP for all LSPs and it works great. She does installs hooks into Claude reminding to use LSP tools.
- ahmedelsama 13d ago[flagged]
- zfy0701 13d agoanyone had experience with https://github.com/colbymchenry/codegraph https://github.com/colbymchenry/codegraph?
- czottmann 12d agoIt's good, and my agent is using it just fine (explicitly told it to prefer it over just grepping randomly). I use it in Swift, Go, and Node projects. If you use worktrees, make sure to run `codegraph init` post-setup to avoid confusing the robot :)
- patwolf 8d agoI played around with codegraph. I did a quick experiment where I gave claude code a feature to implement, and I had it perform the same task with and without codegraph. This wasn't scientific, so take it all with a grain of salt. The codegraph implementation used fewer tokens. However, I performed an automated code review on each implementation, and there were more issues with the codegraph version. These weren't major issues, more like it re-implemented a function that already existed, or used styling that wasn't consistent with the rest of the codebase. My theory is that there's useful information an LLM gleans while grepping through code that is missed when it uses codegraph instead.
- chachachainsaw 13d agoClaude Code ships LSP support, but only as part of a plugin. I think they’re currently the only vendor to fully support it.
- felixlu2026 12d ago[dead]
- genxy 12d agoI see no one has referenced the written by ai paper itself https://arxiv.org/abs/2608.13568 https://arxiv.org/abs/2608.13568 https://github.com/agentconnect-md/lsp-vs-grep-token-study https://github.com/agentconnect-md/lsp-vs-grep-token-study The author uses their own harness, I'd want to see if what they are seeing is related to the harness, they should at the minimum also use CC which has direct LSP support. Their metric is token economy, many of us don't pay per token and capability in terms of difficulty and quality are a more important metrics for the kinds of work I do. I'd want those tested as well.
- poytr1 10d agoYes, I’m the author of this paper. One correction: the paper is inaccurate on this point. If you look at the implementation(https://github.com/agentconnect-md/lsp-vs-grep-token-study/blob/58b0c1a2daad83cbb2731b3b4e951482a81b0454/harness/harness.py#L27 https://github.com/agentconnect-md/lsp-vs-grep-token-study/b...), the harness is actually based on Claude Code, with a system prompt and custom LSP tools registered. Sorry for the confusion! :)
- casey2 12d agoI'd wager it's because most people use grep over an language server
- fooofw 12d ago> On a noisy TypeScript repository, it improved F1 by 0.246 and used 12% fewer tokens. The useful predictor was lexical noise, not whether the language had strong static types. What is "lexical noise", which appears to be a key term in the argument, and why is it not defined? Does it mean that an identifier could show up in, say, a docstring in a non-structured way where a semantic tool would not identify it? Makes sense to me that LLMs, which are language based, would match better with a tool that searches at a language lever rather than at a deeper structured level.
- subratamalik102 9d ago[flagged]