Skip to content

Claude Code with a Language Server: Higher Cost, No Clear Gain in C/C++ Bug Fixes

Comparing Claude Code with and without the clangd code navigation tool on 255 issues from 40 software projects.

Pratyush Saini, CTO, ByteAsk Research; Anirudha Kulkarni, CEO, ByteAsk Research · pratyush@byteask.ai · anirudha@byteask.ai · November 4, 2026 · Preprint · 13 pages

First page of the paper

Key findings

  1. Adding the tool did not clearly improve bug fixes. Each version of Claude Code made 359 repair attempts: 270 succeeded with the tool, compared with 275 without it. Across all code search and repair tasks, using the tool cost 11% more.
  2. Having the tool available was not enough to make Claude Code use it. In a separate test of 30 code search tasks, each run twice, Claude Code used the optional tool in only 5% of runs. In the main experiment, when instructed to use the tool, Claude Code still used ordinary text search in 70% of runs.
  3. The tool added little even on tasks designed to test code relationships. On 29 tasks, Claude Code had to find code that calls a specific function while ignoring other functions with the same name. Without the tool, it found 96.6% of the functions making those calls, on average. Requiring the tool improved this by 0.6 percentage points, averaged across tasks, at 11% higher cost.
  4. The test questions often gave enough clues to locate the needed changes. For 126 of 255 issues, the model identified every location needing a change from the problem description alone, without access to the project files, in at least two of three tries. This limits what these tasks can tell us about the value of a code search tool.

Abstract

AI coding assistants must find the right parts of a program before they can fix a bug. A language server is a tool that helps them find where a piece of code is defined or used. We tested whether adding this tool to Claude Code would improve bug fixes or reduce cost. We compared Claude Code with and without the clangd language server on 255 issues from 40 projects written in C and C++. We prepared the tool and instructed Claude Code to use it. Each version made 359 repair attempts: 270 succeeded with the tool, compared with 275 without it. This difference was too small to establish an improvement. Across all code search and repair tasks, the setup with the tool cost 11% more. Its search results were shorter, but Claude Code read more code and made more requests to the AI model. The tests also had a limitation: for 126 issues, the model could identify all the locations needing changes from the problem description alone, without seeing the project files. For the tasks and instructions we tested, adding the language server increased cost without a clear improvement in bug fixing. Different tools, instructions, or tasks may produce different results.

Why the tool increased AI usage costs

Claude Code processed about 244,000 tokens per task without the language server and 290,000 with it. Estimated AI usage cost rose from about US $0.26 to $0.29 per task. The largest increase in text came from reading files.
Each pair of bars compares Claude Code without the tool (Plain) and with it (LSP). The left chart counts tokens, the small units of text processed by the AI model, including text read more than once. The right chart estimates the average AI usage cost per task in US dollars. With the tool, shorter search results were outweighed by more file content and additional AI requests. Figure 2 of the paper.

Cite this paper

Pratyush Saini and Anirudha Kulkarni. Claude Code with a Language Server: Higher Cost, No Clear Gain in C/C++ Bug Fixes. ByteAsk Research, preprint, November 2026. byteask.ai/research/lsp-claude-code-cpp

@misc{saini2026lsp,
  title        = {Claude Code with a Language Server: Higher Cost, No Clear Gain in C/C++ Bug Fixes},
  author       = {Saini, Pratyush and Kulkarni, Anirudha},
  year         = {2026},
  month        = nov,
  institution  = {ByteAsk Research},
  howpublished = {\url{https://byteask.ai/research/lsp-claude-code-cpp}},
  note         = {Preprint. Code and sample tasks: \url{https://github.com/ByteAsk/lsp-claude-code-cpp}}
}

Questions about the study: contact@byteask.ai All research