title: Reading Your Graph in the Browser
codegraph ui opens a viewer for a project you have already indexed. It is the same graph your agent reads, on screen.
codegraph init # once per project, if you haven't already
codegraph ui # opens http://127.0.0.1:4747 in your browser
Pick a symbol and you get three columns that all describe the same thing:
creates marks a constructor.A class, interface, struct or enum shows its members in source order instead of a body, each with how many things call it and how many things it calls.
Under the source, a blast radius strip counts what a change here would reach: direct dependents, everything within three hops, and how many files, test files and routes that touches.
The viewer never presents a guess as a fact:
/ or Cmd-K: every symbol and file, grouped by kind, with signature and file:line. Arrow keys and Enter, no mouse needed.Clicking any file path opens the file view: everything that file depends on, its outline in source order, and everything that depends on it.
The Source tab on that screen replaces the outline with the file itself, top to bottom, with the same gutter markers and the same right-hand list of what each line calls — a 6,800-line file scrolls as smoothly as a 60-line one, and the text pages in behind you.
The margin on the left is the part you cannot get anywhere else: an arc for every call that stays inside the file, drawn from the calling line to the line the callee is defined on. Source order is the only layout — nothing is placed by an algorithm, because the author already placed it — so the shape of a file's internal call structure is legible at a glance. Hover a line to light the arcs the function under your cursor takes part in; click an arc to jump to the other end. On a file with more than forty of them the diagram narrows to the symbol you are reading rather than drawing a wash of overlapping sweeps, and the count stays in the header.
A rail on the far left lists the file's symbols and follows you as you scroll, when the window is wide enough for it.
Type "how does execute reach getFile" into the search box — or execute -> getFile — and the first result opens the Flow strip: the call path between the two symbols, left to right, one card per hop.
Each card is opened at the line that makes the next call, not at the top of the function, so reading the strip is reading the six or eight lines that actually carry the request. The identifier being called is a link; click a card's header to open it in the symbol screen with the trail already set to the path you have read so far.
The "Read as flow" button on the trail turns a walk you did by hand into the same strip. It is the same path finder codegraph_explore leads its answers with, so the picture and what your agent tells you cannot disagree.
The Map tab (m) draws the project at module granularity — one box per directory — with dependencies pointing down. Nothing is placed by hand: a module sits one layer above whatever it depends on, so the top of the picture is what runs first and the bottom is what everything else stands on, and the same project always draws the same picture.
It is honest about what it leaves out. Links carrying only a handful of references stay hidden until you select a module they touch, and references CodeGraph isn't confident about are excluded from every count on the screen — the panel prints how many. The vertical order rests on the dependencies your code writes down (imports, qualified names, inheritance, typed receivers), because a method name shared by two unrelated folders should not be able to move a box; when a project has too few of those to go on, the panel says the order came from raw reference counts instead.
The map opens on your project's source directory. The picker switches to any other top-level folder or the whole repository, the checkbox brings test modules in, and ?depth=2 in the address splits a large folder into its sub-folders — the useful setting on a monorepo. What you are looking at lives in the URL, so the view is shareable.
codegraph ui [path] |
Read a specific indexed project instead of the current directory |
--port <n> |
Pin a port. Without it the viewer takes 4747, or the next free one |
--no-open |
Print the URL instead of opening a browser (headless boxes, SSH) |
CODEGRAPH_BROWSER=<command> |
Choose which browser opens. CODEGRAPH_BROWSER=none never opens one |
codegraph web is an alias for the same command.
The viewer listens on 127.0.0.1 only, so nothing on your network can reach it, and requests claiming to come from any other host are refused. It is read-only: it opens an index that already exists, never creates one, and never writes to your project or your graph.
It sends nothing anywhere — no code, no paths, no analytics. The page in your browser talks only to the server on your own machine, and that server makes no outbound connections at all. See Telemetry for the complete picture.
The viewer reads an index that already exists, so run codegraph init in the project first.