Skip to content

The AI coding agent for C and C++Writes C++.
Proves it compiles, runs, and passes.

ByteAsk is an AI coding agent for C and C++.Every change arrives compiled, sanitized and tested against your build.

$ curl -fsSL https://code.byteask.ai/install.sh | sh

ByteAsk runs in the terminal on your laptop.

Send yourself the install command and run it at your desk.

Book a demo

ByteAsk indexes a whole codebase, then pinpoints the cause of a bug. Shown on a real open-source C++ library, nlohmann/json: ByteAsk replays its build (43 compiler runs) and maps 77 files, 57,234 lines of code, 907 functions, 184 classes, 20,463 template versions and 1,762 function calls, in 2 minutes 16 seconds. When bug report 1982, "json_pointer.contains() exception is incorrectly raised", arrives, it weighs six kinds of evidence, narrows 603 places to 40 suspects, and names nlohmann::json_pointer::contains (include/nlohmann/detail/json_pointer.hpp:655) as the most likely cause. The graph is the real index; the lit-up dots show the idea, not the exact matches.

A recorded fix of nlohmann/json issue #2019. ByteAsk finds the code, writes a failing test, fixes it, then checks it.

Condensed replayOriginal session time 5:15

Fixed #2019: contains("/b/x"_json_pointer) now returns false. Updated the old exception expectations, added regression coverage, updated documentation, and regenerated the single header.
Built test-json_pointer and ran both variants:
test-json_pointer_default Passed
test-json_pointer_all Passed
100% tests passed, 0 tests failed out of 2
The standalone ASan/UBSan reproducer also passed. The test build used DOCTEST_CONFIG_NO_POSIX_SIGNALS to work around this host’s compatibility issue with old doctest.
Playing recordingRecorded result

Select a stage to read its transcript. Esc pauses playback.

Read the session

Condensed transcript from the same recording. Some output is shortened.

read build

›Fix this bug (issue #2019). The fix changes what contains() does, so also update any existing test that expects the old exception. Then build and run the json_pointer tests and show they pass.
json_pointer.contains() exception is incorrectly raised
To reproduce:
json test = { { "a", "Ok" }, { "b", { "bad", "exception", "case" } } };
cout << "/a: " << test.contains("/a"_json_pointer) << endl;
cout << "/b/0: " << test.contains("/b/0"_json_pointer) << endl;
cout << "/b/x: " << test.contains("/b/x"_json_pointer) << endl;
Current behavior: /a: 1, /b/0: 1, /b/x: exception
Expected behavior: /a: 1, /b/0: 1, /b/x: 0
I’ll use context_bundle to locate the contains() implementation and tests, then fix the behavior and run the json_pointer tests.
Called
└ context_bundle({"task":"Fix issue #2019: json_pointer.contains() incorrectly raises an exception for a nonnu…
…","worktree":"~/src/json","budget_tokens":7000})
context_bundle · Fix issue #2019: json_pointer.contains() incorrectly rai…
Index: build setting debug, commit b7be613b6ec6
build setting: debug | commit b7be613b6ec6 | compiler clang 21.1.8 | facts from the compiler, not text search
## Where to look (most likely first)
1. nlohmann::json_pointer::contains include/nlohmann/detail/json_pointer.hpp:655 [defines `contains` named in the task]
└ the task’s example reaches nlohmann::json_pointer<nlohmann::basic_json<>>::contains (2 calls deep)
2. nlohmann::json_pointer include/nlohmann/detail/json_pointer.hpp:17 [its code changed in a similar past commit: Add json_pointer::pa…
3. nlohmann::basic_json::contains include/nlohmann/json.hpp:4089 [words of the title (BM25)]
4. nlohmann::basic_json::contains include/nlohmann/json.hpp:4056 [defines `contains` named in the task]
5. nlohmann::json_pointer::array_index include/nlohmann/detail/json_pointer.hpp:330 [called by nlohmann::json_pointer::contains]

find code

contains() calls the throwing array-index parser before checking whether the token is numeric. I’ll inspect the repository instructions, existing tests, and build configuration before changing that path.
Ran pwd
│ git status --short
│ rg --files -g AGENTS.md -g '*json_pointer*' -g '*amalgam*' -g 'CMakeLists.txt' …
└ ~/src/json
benchmarks/thirdparty/benchmark/CMakeLists.txt
… +134 lines
The tests currently expect exceptions for both "one" and "01" as array indices. I’ll check the documented contract and use autosar_ref to verify the bounds checks needed before inspecting a token’s characters.
Called
└ autosar_ref({"query":"C++ Core Guidelines bounds string indexing empty container SL.con.3","limit":2})
autosar_ref · C++ Core Guidelines bounds string indexing empty contain…
## Results for "C++ Core Guidelines bounds string indexing empty container SL.con.3"

test first

I’ll use apply_patch to add the reported example and invalid-index cases, then run cpp_test_select before fixing the implementation to confirm the tests expose the bug.
Edited test/src/unit-json_pointer.cpp (+20 -0)
277 {
278+ SECTION("contains with invalid array indices (issue #2019)")
279+ {
280+ const json j = {{"a", "Ok"}, {"b", {"bad", "exception", "case"}}};
281+ CHECK(j.contains("/a"_json_pointer));
282+ CHECK(j.contains("/b/0"_json_pointer));
283+ CHECK(not j.contains("/b/x"_json_pointer));
284+
285+ for (const auto& token : {"", "x", "one", "01", "00", "+1", "-1", " 1", "1 ", "1+1", "1x", "-"})
286+ {
287+ CAPTURE(token);
288+ CHECK(not j.contains(json::json_pointer(std::string("/b/") + token)));
289+
290+ // These tokens are valid object keys, even inside an array.
291+ const json object = {{token, true}};
292+ const json nested = {object};
293+ CHECK(object.contains(json::json_pointer(std::string("/") + token)));
294+ CHECK(nested.contains(json::json_pointer(std::string("/0/") + token)));
295+ }
296+ }
298 SECTION("nonconst access")
I’ll use cpp_test_select to build and run the json_pointer test program with the new regression cases.
Called
└ cpp_test_select({"changed":["test/src/unit-json_pointer.cpp"],"build_dir":"build","tier":2,"wait_s":60,"jobs":2})
cpp_test_select · run
CMake 3.25, build tree build (existing: built incrementally, never reconfigured); targets from the build t…
CHANGE vs session-start commit b7be613b6e: 1 file(s) (test/src/unit-json_pointer.cpp); symbols: none found
PLAN: tier 1 = 2 test(s) · tier 2 = 2 test(s) · tier 3 = 8 of 90 test(s), 6 of them unmapped script/data tests
tier 2: test-json_pointer_default, test-json_pointer_all
BUILD test-json_poi…
The build hit an existing compatibility problem: this old doctest uses SIGSTKSZ as a compile-time constant, which fails with the host’s headers. I’ll check doctest’s configuration switch and disable its POSIX signal handler in the local build so the tests can run.
Ran cmake -S . -B build -DCMAKE_CXX_FLAGS=-DDOCTEST_CONFIG_NO_POSIX_SIGNALS
└ -- Using the multi-header code from ~/src/json/include/
-- Configuring done
-- Generating done
-- Build files have been written to: ~/src/json/build
Both json_pointer test runs now fail on the new regression, confirming the bug.

fix

I’ll use apply_patch to reject invalid array tokens before conversion and replace the old contains() exception expectations with false checks.
Edited include/nlohmann/detail/json_pointer.hpp (+9 -6)
648 return *ptr;
649 }
650
651- /*!
652- @throw parse_error.106 if an array index begins with '0'
653- @throw parse_error.109 if an array index was not a number
654- */
651+ /// @brief check whether this JSON pointer resolves to a stored value
652 bool contains(const BasicJsonType* ptr) const
653 {
⋮
672 {
676- if (JSON_HEDLEY_UNLIKELY(reference_token == "-"))
673+ if (JSON_HEDLEY_UNLIKELY(reference_token.empty() or
674+ (reference_token.size() > 1 and reference_token[0] == '0') or
675+ not std::all_of(reference_token.begin(), reference_token.end(),
676+ [](const unsigned char x)
677 {
678- // "-" always fails the range check
678+ return x >= '0' and x <= '9';
679+ })))
680+ {
681+ // array indices must be numbers without leading zeros
682 return false;
683 }
Edited include/nlohmann/json.hpp (+2 -2)
4077
4078- @throw parse_error.106 if an array index begins with '0'
4079- @throw parse_error.109 if an array index was not a number
4078+ @note Array indices with leading zeros or non-numeric characters do not
4079+ resolve to a stored value.
4080
Edited test/src/unit-json_pointer.cpp (+4 -12)
332 "[json.exception.parse_error.106] parse error: array index '01' must not begin with '0'");
333- CHECK_THROWS_AS(j.contains("/01"_json_pointer), json::parse_error&);
334- CHECK_THROWS_WITH(j.contains("/01"_json_pointer),
335- "[json.exception.parse_error.106] parse error: array index '01' must not begin with '0'");
336- CHECK_THROWS_AS(j_const.contains("/01"_json_pointer), json::parse_error&);
337- CHECK_THROWS_WITH(j_const.contains("/01"_json_pointer),
338- "[json.exception.parse_error.106] parse error: array index '01' must not begin with '0'");
333+ CHECK(not j.contains("/01"_json_pointer));
334+ CHECK(not j_const.contains("/01"_json_pointer));
The guard now rejects empty, nonnumeric, and leading-zero array tokens. I’ll run make amalgamate to regenerate the single header from the source headers, as the contribution guide requires.
Ran make amalgamate
└ third_party/amalgamate/amalgamate.py -c third_party/amalgamate/config.json -s . --verbose=yes
/usr/bin/env: ‘python’: No such file or directory
make: *** [Makefile:523: single_include/nlohmann/json.hpp] Error 127
make amalgamate stopped because its script requests python, while this machine has python3. I’ll run the same generator explicitly with python3.
Ran python3 third_party/amalgamate/amalgamate.py -c third_party/amalgamate/config.json -s . --verbose=yes
└ Config:
target = single_include/nlohmann/json.hpp
… +17 lines
test/src/unit-json_pointer.cpp | 36 +++++++++++++++++++++-----------
4 files changed, 46 insertions(+), 28 deletions(-)
Both json_pointer test variants pass. I’ll use cpp_check and cpp_tidy to check the edited code for static-analysis issues.

lint

Called
└ cpp_check({"path":"test/src/unit-json_pointer.cpp","timeout_sec":120})
cpp_check · test/src/unit-json_pointer.cpp
scope: this file, with its flags from ~/src/json/build/compile_commands.json (0 extra include dir(s))
status: 4 finding(s)
cppcheck error ~/src/json/include/nlohmann/json.hpp:2986:13 Found an exit path from function with non-vo…
cpp_check reported four missing-return warnings in unchanged JSON access functions. I’ll inspect those paths and run cpp_tidy to check for findings related to this change.
Called
└ cpp_tidy({"path":"test/src/unit-json_pointer.cpp","build_dir":"build","checks":"-*,clang-analyzer-*,bugprone-*"})
cpp_tidy · test/src/unit-json_pointer.cpp
status: clean - clang-tidy ran and reported nothing.
No findings.
Result: PASS: No findings.

sanitize

The focused cpp_tidy checks are clean. I’ll now call cpp_sanitize for the json_pointer target, including the doctest compatibility definition.
Called
└ cpp_sanitize({"project":true,"target":"test-json_pointer","run_args":"--no-skip","timeout_sec":120})
cpp_sanitize · project target test-json_pointer
PROJECT BUILD FAILED - nothing was run, so this is neither clean nor a finding.
The fresh sanitizer build hit the same doctest SIGSTKSZ error. I’ll create a standalone reproducer in /tmp for ASan/UBSan and compare cppcheck’s warnings with the base headers.
Added /tmp/byteask-issue2019.cpp (+26 -0)
7+int main()
8+{
9+ using nlohmann::json;
10+ const json j = {{"a", "Ok"}, {"b", {"bad", "exception", "case"}}};
11+ assert(j.contains("/a"_json_pointer));
12+ assert(j.contains("/b/0"_json_pointer));
13+ assert(!j.contains("/b/x"_json_pointer));
⋮
I’ll use cpp_sanitize on the standalone reproducer to verify the reported output and invalid-token cases under ASan/UBSan.
Called
└ cpp_sanitize({"source":"/tmp/byteask-issue2019.cpp","include_dirs":["~/src/json/include"],"std":"c++11","timeout_sec":120})
cpp_sanitize · /tmp/byteask-issue2019.cpp
clean: exit 0, no sanitizer errors
program stdout:
/a: 1
/b/0: 1
/b/x: 0
No findings.
Result: PASS: The program ran to exit 0 with no sanitizer errors.
The reproducer prints /a: 1, /b/0: 1, and /b/x: 0 with no sanitizer errors. I’ll use exec_command to prepare the base headers for comparison and check the final diff.
Ran mkdir -p /tmp/byteask-issue2019-baseline
│ git archive HEAD include | tar -x -C /tmp/byteask-issue2019-baseline
│ git diff --check
│ … +3 lines
└ diff --git a/include/nlohmann/detail/json_pointer.hpp b/include/nlohmann/detail/json_pointer.hpp
… +107 lines
13:100% tests passed, 0 tests failed out of 2
I’ll use context_remember to save the cause, fix, and test results for future work on contains().
Called
└ context_remember({"task":"Fix issue #2019: contains(json_pointer) throws on nonnumeric array tokens instead of returning
false.","root_cause":"json_pointer::contains passed arbitrary array reference tokens into the throwing…
context_remember · Fix issue #2019: contains(json_pointer) throws on nonnum…
{"items":[{"saved":1}],"partition":"json"}
Result: PASS: answered from completed index snapshots
Fixed #2019: contains("/b/x"_json_pointer) now returns false. Updated the old exception expectations, added regression coverage, updated documentation, and regenerated the single header.
Built test-json_pointer and ran both variants:
test-json_pointer_default Passed
test-json_pointer_all Passed
100% tests passed, 0 tests failed out of 2
The standalone ASan/UBSan reproducer also passed. The test build used DOCTEST_CONFIG_NO_POSIX_SIGNALS to work around this host’s compatibility issue with old doctest.

The blockers C++ developers report with AI assistants.

Question 9: what issues or blockers have you faced when using AI assistants for C++ coding? AI-generated output is incorrect: 77.5%. Lack of trust in output: 69.9%. Lack of understanding relevant context: 51.4%.

  • 77.5%

    AI output is incorrect

  • 69.9%

    do not trust AI output

  • 51.4%

    AI lacks relevant context

Standard C++ Foundation, 2026 Annual C++ Developer Survey

In C++, the name is not the code.

validate(order);327 matches · 86 files
  1. Namespaces
  2. Overloading
  3. Virtual functions
  4. Templates
  5. Build config
  6. +322 more: comments, tests, mocks
Which one actually gets called?

Review a diff that already ran your build, tests and sanitizers

  1. Ticket

    Assign it in Jira or Linear, or mention @ByteAsk in Slack.

  2. Context

    It finds the code your production build runs, with its callers and tests.

  3. Model

    It gets the few functions that matter, not the whole repository.

  4. Build and test

    It builds the change and runs your tests before and after.

  5. Checks

    Sanitizers and static analysis run on the code it touched.

  6. Pull request

    You review a diff that already compiles and passes.

Works with the toolchain you already use

  • C/C++
  • LLVM
  • GCC
  • clang
  • Compiler Explorer
  • gdb
  • Valgrind
  • ASan, UBSan, TSan
  • perf
  • make
  • CMake
  • QuickBench
  • vcpkg
  • Conan
  • Git
  • GitHub
  • GitLab
  • Bitbucket
  • Jira
  • Linear
  • Slack
  • Microsoft Teams
  • Jenkins
  • GitHub Actions
  • Confluence

Your code stays inside your walls

On-prem, air-gapped, or bring your own model key.

Deployment and controls

On-prem and air-gapped
Run ByteAsk inside your network, including networks with no route to the internet.
Your keys, your gateway
Company API keys through a ByteAsk gateway in your network, with model and provider allowlists.
SSO, SCIM and roles
SAML single sign-on, SCIM provisioning and role-based access control.
Audit logs
Every session and tool call on record, with spend limits per user and per organization.
Retention you set
Custom data retention controls and IP allowlisting.
DPA, SLA and purchase orders
Data processing agreement, uptime SLA, invoicing and purchase orders.
Zero data retention
Your prompts and code are processed to answer the request, then dropped. Nothing is kept. Read the privacy policy
Not used to train models
Your repositories are not used to train any model. Ours or anyone's.
Passwordless sign-in
A signed magic link logs you in. No password to manage, and nothing to paste or leak.

Common questions

Does it work with my agent?

Yes. ByteAsk Context connects over MCP, so any agent that speaks MCP can use it. Claude Code also gets it through hooks: before the first step it hands over the few places the fix most likely belongs, and after an edit it builds and runs only the affected tests.

Claude Code already has an LSP plugin (clangd). Why do I need ByteAsk Context?

An LSP answers questions about one symbol at a time: where it's defined, where it's used, whether your last edit compiles. To use it, the agent first has to know which symbol matters, so it still searches the codebase. ByteAsk Context starts from the issue itself. Before the agent's first step, it hands over the few places the fix most likely belongs, with their code, callers and the tests that cover them, all from a compiler-accurate index of your real build. After an edit, it builds and runs only the affected tests. It doesn't stop at compile errors.

In our same-model tests on hard C++ issues, Claude Code with ByteAsk Context used 59% fewer tokens, cost 39% less and finished 43% faster than Claude Code with the clangd plugin.

Why use ByteAsk instead of Claude Code, Cursor or Codex?

They are good general-purpose agents. ByteAsk adds the two things C and C++ need.

Context. It reads your build, not just your text: the preset, flags and macros your production binary compiles. On the same model, it finds the right function first 54% of the time instead of 36% (Multi-SWE-bench C++, 129 issues).

Harness. Every change is compiled, run under AddressSanitizer, UBSan and ThreadSanitizer, and tested before you see it. When your program crashes or hangs, it joins the gdb session you already have open.

It works with the models you already use, or your own key.

Do I have to use your models?

No. Sign in and use OpenAI, Anthropic and Google models through ByteAsk with no API key to paste, or bring your own key, in which case traffic goes straight to the provider. You can also point ByteAsk at your own OpenAI-compatible server, including vLLM, Ollama, llama.cpp, LM Studio, TGI, SGLang or a LiteLLM proxy.

Can we run it inside our own network?

Yes, on the Enterprise plan: on-prem deployment including air-gapped networks, company API keys through a ByteAsk gateway in your network, SSO, SCIM, audit logs and IP allowlisting.

Which editors does it work in?

VS Code, Cursor, JetBrains IDEs, Neovim, Emacs and Zed, plus Windsurf and VSCodium through Open VSX. Every connector needs the byteask CLI on your PATH, since the editor plugin drives the same CLI.

Install ByteAsk in one lineGet ByteAsk on your laptop

Rolling out to a team?
Book a demo or contact us.

$ curl -fsSL https://code.byteask.ai/install.sh | sh
Other ways to install
$ pip install byteask
$ uv tool install byteask
$ npm i -g @byteask/cli

Also in VS Code, Cursor, JetBrains, Neovim, Emacs. Editor setup

ByteAsk runs in the terminal on your laptop.

Send yourself the install command and run it at your desk.

Show desktop install commands
$ curl -fsSL https://code.byteask.ai/install.sh | sh
Other ways to install
$ pip install byteask
$ uv tool install byteask
$ npm i -g @byteask/cli

Also in VS Code, Cursor, JetBrains, Neovim, Emacs. Editor setup