Skip to content
Course outline

AcademyModule 6 · Git, code, maps, and design

Work with the terminal and code graph

Lesson 2 of 410 min

What you'll learn

  • You can open, hide, resize, and kill terminal tabs, and explain why hiding never stops a shell.
  • You can hand a terminal's recent output to the AI with an @-mention and say exactly what gets captured.
  • You can explain how code intelligence maps symbols and cross-file relationships as triples, entirely on-device.
  • You can build the code index, make the cloud-embeddings decision, and read the four build stages.
  • You can find code intelligence on every surface it touches: sidebar, notes, entity pages, and chat.

You can ask the AI about a build failure without copying terminal output by hand. The code graph also lets you examine design notes alongside implementation code.

This lesson covers two developer tools. The terminal dock runs a shell inside the app and lets you attach its output to chat. Code intelligence indexes source-code symbols and relationships as a graph.

Run commands in the terminal dock

The terminal dock is a VSCode-style bottom panel that runs your real shell in a true PTY, the operating system's real terminal channel: zsh or bash on macOS, PowerShell or cmd on Windows. Prompts, colors, aliases, job control, vim, less, it all behaves like a standalone terminal, because it is one.

The shell comes from your $SHELL variable and launches login-style, so your PATH and aliases load. New shells start in the active workspace folder, so ls lists your notes right away.

Opening the dock splits the editor vertically without covering anything. The dock only exists while a workspace is open; on the Home screen the button hides and the shortcut does nothing.

  • Titlebar: the square-terminal icon in the right-hand tool cluster. Its tooltip reads "Terminal" with ⌘`, and it stays pressed while the dock is open.
  • Keyboard: ⌘` (Ctrl+` on Windows/Linux) toggles the dock, just like VSCode. You can rebind it in Settings ▸ Shortcuts as "Toggle terminal".
  • macOS menu bar: View ▸ "Toggle Terminal".
  • "Search everything" palette (⌘⇧F): run the "Toggle terminal" entry. It shows your current shortcut, rebound or not.
  • GitHub sign-in: when it can't use the automatic device flow, the dialog offers "Open terminal" and hints to run gh auth login.

Tabs, hide vs. kill

ControlWhereWhat it does
+ ("New Terminal")Dock header, next to the tabsOpens a fresh shell tab in the workspace folder and focuses it. Tabs are named "Terminal 1", "Terminal 2"… in the order you create them.
Double-click a tabTab stripOpens the "Rename" dialog. Name your shells "dev server", "git", whatever tells them apart.
✕ on a tab ("Kill terminal")Visible on hover and on the active tabEnds that shell process for real. Killing the last tab also collapses the panel.
Chevron ("Close panel")Dock header, right sideHides the dock. Every shell keeps running with its scrollback intact.
Drag the top edgeThin line above the dockResizes the split. The height sticks across restarts (default 300px, minimum 120px, and at least 120px of editor always stays visible).

Collapsing a panel does not kill it. Closing with the chevron or ⌘ only hides it, so shells keep running and scrollback survives. ⌘ works even while your cursor is inside the terminal, and only the ✕ ("Kill terminal") ends a process.

If a shell exits on its own, say you type exit or it crashes, a dim "[process exited]" line appears. The dead tab stays until you close it. There's no restart button, so kill it and open a new one.

Name your terminals to find them faster later

Run several shells side by side: one for a dev server, one for git, one for scratch commands. Each tab is an independent session with its own scrollback and processes.

Double-click to rename them. A terminal called "dev server" is much easier to pick out later in the chat's @-mention picker than "Terminal 3".

Attach terminal output to chat

Here's what no standalone terminal can do. In the chat composer, type @ and the mention picker offers a "Terminals" category. Pick one and a chip like @Terminal 1 lands in your message, carrying a snapshot of that terminal's recent output, captured the moment you picked it.

Ask "why did this build fail?" and the agent reads that output. No copy-paste, no screenshots.

Two shells, one bridge

The dock is your terminal. The agent runs its own commands in the separate sandboxed executor you approve with cards in the chat, and those commands never appear in the dock.

The @-mention is the one bridge between them: it lets the agent read what happened in your shell. It never lets the agent type into it.

Code intelligence: code as triples

The second tool wakes up the moment your workspace contains source code. A local indexer reads it: a fast on-device parser, with no AI model and no network calls.

It records every symbol and every cross-file relationship as triples in a per-workspace code-graph store. Functions, methods, classes, structs, enums, traits, modules, type aliases, constants: all of them. It respects .gitignore, skips hidden directories, and runs at roughly 8 ms per file, so it's fast and free.

On top of that deterministic map sits an optional cloud pass. You opt in first, and then it embeds short code excerpts so code becomes searchable by meaning. The same pass puts your notes and concepts in one shared vector space, the cross-modal bridge.

The code intelligence view for following symbols, references, and related files.
The shape of the code graph: files and symbols joined by four kinds of edge
graph.ts      imports →     types.ts
buildGraph()  calls →       parseNote()
NoteIndex     extends →     BaseIndex
render.ts     references →  buildGraph()
PTY (pseudo-terminal)
A real, OS-level terminal channel. That's why prompts, colors, vim, and job control all behave normally in the dock.
Code graph / code index
A deterministic, local map of your source code: files and symbols as nodes, calls / imports / extends / references as edges, stored per workspace as triples.
Semantic code embeddings
An optional cloud pass, which you consent to once, that makes code searchable by meaning rather than by exact words.
Cross-modal bridge
Code symbols and note/concept labels embedded in one vector space, so the app can rank "which code is closest to this concept" and vice versa, shown as a match %.
LSP (language server)
An external per-language server found on your PATH that powers autocomplete, hover, and go-to-definition. Without one, the editor navigates with the code graph instead.
LanguageIndexed in the code graphIDE features (language server)
Rust (.rs)Yesrust-analyzer
TypeScript / TSXYestypescript-language-server
JavaScriptYestypescript-language-server
Python (.py)Yespyright
Go (.go)YesNone (graph navigation only)

One discipline: notes and code

Consilience treats code the way it treats notes: find the things, record the relationships, store both as triples. In knowledge-representation terms, a function is an object and a call is a link. It's the same object-link-property model that runs the big analyst platforms.

The difference is epistemic. The note graph is built by an LLM reading prose, so it's probabilistic. The code graph is built by a parser, so it's deterministic: a call edge either exists in the source or it doesn't. That's why the code index is free, offline, and instant, and why only the embeddings, the one probabilistic layer, ask for your consent.

Building the index

  1. Open the management panel

    In the knowledge graph view, choose "Code intelligence" in the left menu. The build section is titled "Code in AI search". (If the master switch is off, you'll see "Code intelligence is off" with an "Open Settings" button. The toggle lives in Settings ▸ Code intelligence.)

  2. Press "Build"

    The row "Build code index" scans your source files, respecting .gitignore. A staged checklist runs: "Scan files" → "Parse code" → "Link references" → "Embed symbols", each with a live done/total count. "Cancel" stops it anytime.

  3. Decide on cloud embeddings

    On the first build a one-time dialog asks "Make your code searchable by meaning?" "Turn on meaning-based search" enables the semantic layer. "Keep everything on this device" keeps the index local-only. Either way, identifier and graph search still work, and the local index builds in every case.

  4. Read the verdict

    When it finishes, the plain-language verdict reads "Your code is searchable". From there a file watcher keeps the index current as files change, and "Rebuild" is the escape hatch for a stale or wrong index.

Where code intelligence shows up

  • The workspace sidebar grows a "Code context" group when a code tab is active. "Code graph" carries a live badge ("Indexed" / "Not indexed" / "Parse error") and lists "Defined symbols", "Used by", and "Uses". Every row is a jump, tagged with its relationship: calls / imports / extends / references.
  • "Related knowledge", in the same group, follows your caret. Put the cursor in a function and it lists the notes and concepts closest in meaning; "View as graph" opens a 3D constellation around the symbol.
  • "Related code" shows up on both a note's document sidebar and entity pages, taking you from prose or a 360° profile straight into the symbols that implement it.
  • "Concept ↔ code", in the Code intelligence panel: search a concept, expand it, and get the matching symbols ranked by a match %. Click one to open the file.
  • Chat: once the index completes, the agent can map the repository, search code by meaning, and follow a symbol's neighbors. Workspace search results grow a "Code" section.
  • The 3D graph has a "Show code" toggle that renders code files as their own node class. The file tree marks unprocessed code files with a red status dot and parse errors with a warning triangle.

Classic IDE features layer on top once an external language server is installed: F12 (or Cmd-click) to go to definition, Shift+F12 for references, F2 to rename across files, ⇧⌥F to format, plus diagnostic squiggles as you type. When a code file opens without its server, a one-time toast links to the install page, naming the language: "Richer TypeScript support available". Until then the editor quietly navigates via the code graph instead.

Run, mention, ask

  1. Press ⌘ (Ctrl+ on Windows/Linux). The dock opens and "Terminal 1" starts up in your workspace folder.
  2. Run something with real output, like ls -la, or git status if the workspace is a repo.
  3. In the chat composer, type @, choose "Terminals", and pick "Terminal 1". A chip appears in the composer.
  4. Ask "What do you see in this terminal, and what does it tell you about my workspace?" and send.
  5. Optional, if your workspace contains source code: open the knowledge graph view ▸ "Code intelligence" and press "Build". Watch "Scan files" → "Parse code" → "Link references" → "Embed symbols" run.

The agent answers from the captured scrollback, no copy-paste needed. If you built the index, the verdict flips to "Your code is searchable" and code files gain a "Code graph" section in the sidebar.

Collapse to hide, mention again for fresh output

Collapsing the panel tucks the dock away safely. Every shell keeps running with its scrollback intact, ready the instant you press ⌘` again.

Mention a terminal again right after new output lands, and the agent reads the freshest snapshot of your shell.

That's the developer pair: a real shell one keystroke away with a one-chip bridge into the chat, and a codebase mapped with the same triple discipline as your notes. Ideas and their implementations can finally find each other. Those same triples can carry coordinates too, and the agent will draw them for you on a map.

Work with the terminal and code graph