Skip to content

Inspect a change with an AI agent

Use this workflow before changing an unfamiliar method. It works with current Bee, Git and the .NET 10 SDK/reference pack, without MongoDB, a model provider or repository builds. Bee supplies evidence to your coding agent; it does not edit the source for you.

Create an empty directory, run the commands below, then save the two files exactly as shown. The shell examples use macOS/Linux syntax; PowerShell can run the same Git and Bee commands.

Terminal window
mkdir bee-demo
cd bee-demo
git init

Catalog.csproj:

<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup><TargetFramework>net10.0</TargetFramework></PropertyGroup>
</Project>

Price.cs:

namespace Catalog;
public static class Price
{
public static int Double(int value) => value * 2;
public static int Total() => Double(21);
}

2 · Discover declarations, then read a range

Section titled “2 · Discover declarations, then read a range”

outline reads an existing graph. Build it explicitly, verify freshness, then request a compact declaration list:

Terminal window
bee graph build --json
bee graph status --check --json
bee graph outline Price.cs --compact --json

This example returns three declarations: Price at lines 3–7, Double at line 5 and Total at line 6. All three commands exit 0. result.columns defines each row; reconstruct a full ID by joining result.idPrefix and idSuffix. Check result.counts.omitted and source freshness before selecting lines. The example graph reports an unrestored project tier; its resolved sample call does not prove that an arbitrary project needs no restore.

Read only the indicated method and its nearby context:

Terminal window
sed -n '5,6p' Price.cs

PowerShell:

Terminal window
Get-Content Price.cs | Select-Object -Skip 4 -First 2
Terminal window
bee graph callers 'Price.Double' --no-refresh --json --compact --output-budget-chars 8000
bee graph impact 'Price.Double' --no-refresh --json

The caller result identifies Catalog.Price.Total() at Price.cs:6, with via: direct and prov: resolved. Impact reports one dependent symbol in one file. These are static relationships, not proof that a test executed a branch or that every runtime caller is known. Use a full symbol ID when a short name is ambiguous.

--no-refresh prevents query-triggered writes. If the graph is stale, run an explicit build and query again. Missing graph/path for outline exits 3; stale, unsupported or incomplete outline exits 5. status --check uses 6 for stale. Do not apply one command’s exit table to every command.

Terminal window
bee code analyze --engine roslyn --json

The synthetic example returns status: clean, an empty findings list, analysisCoverage.compiled: 1 and exit 0. testCoverage.state remains not-measured. Compiler analysis reconstructs project inputs without running MSBuild targets or generators. A missing reference or unsupported context can produce exit 5 even with no findings.

The default bee code analyze uses native quality rules, not the Roslyn compiler engine. On this expression-bodied example, bee code analyze Price.cs --scope source --json returns exit 5 because native method-length/complexity coverage is incomplete. Select the engine for the question you are asking; do not discard an incomplete result as “no issues.”

After your normal test runner has produced a TRX file, summarize it. This step requires that artifact and does not run tests:

Terminal window
bee test summarize TestResults/results.trx --limit 5 --budget 8000 --json

Keep the runner’s original exit code and checkout identity alongside the artifact. Summary exit 1 means the report records failure; 5 means incomplete or no executed tests; 0 only describes an accepted completed artifact. Read omissions and skipped outcomes. A small synthetic failing report and output explanation are in Context size.

Source Navigation Analysis / recovery
C# Declarations and resolved calls, subject to coverage --engine roslyn; install required SDK/reference packs and restore your project separately when necessary
Vue / TypeScript / TSX Declarations and static imports; calls:none --engine vue or typescript; supply existing Node/toolchain paths and supported versions
Dart No Dart graph extractor is registered --engine dart; existing package configuration is required; Flutter is unsupported
Swift / Kotlin Syntax declarations and ranges; calls:none Explicit iOS/Android compilation context; no automatic Xcode/Gradle project evaluation

For Vue, partial parsing or unresolved aliases warrants inspecting the file/config; a syntax graph does not provide semantic TypeScript calls. For Swift/Kotlin, parsed means the supported syntax subset was read, not that the app compiles. Swift iOS analysis requires macOS/Xcode. Missing tools, unsupported compiler versions and incomplete contexts require recovery before a clean claim.

Code graph reference · Engine setup and limits · Context budgets and reuse · Behavior workflow