Core Concepts

Code Mode

Every project in SlyCode has two whole-screen modes. The Board | Code Mode toggle in the project header flips the kanban dashboard into the Codebase Atlas: a zoomable map of the codebase with AI-written explanations, backed by a real code editor, search, symbol index, git tools, and an embedded agent terminal.

Why Code Mode exists

Months of agentic development disconnect you from your own code: structure, key files, and how components hang together fade. Code Mode answers "what is this code and what changed" at a glance and keeps you on top of a codebase you no longer write by hand, without opening an IDE.

The layout: a collapsible left rail (files, symbols, search, git), a main canvas with breadcrumb navigation, a drag-resizable Atlas terminal docked on the right, and a bottom status strip with atlas stats and a refresh action. Appending ?view=code to a project URL deep-links straight into Code Mode. State survives switching modes: the open terminal and any delivered result deck are restored when you come back, and the Board button glows when board sessions are active.

The Codebase Atlas

The Atlas is an AI-maintained map of the project with four zoom levels, from whole-system down to a line of code. The landing view is always the map, never a file tree.

LevelWhat you see
System mapOne card per area, the top-level buildings of the codebase. Each card shows the area color, a five-pip churn meter (14-day git activity), and a freshness tag. First click opens a bottom drawer with the explanation and key files; second click zooms in.
Area viewThe area's modules as room cards, each with a name and summary. The drawer here also supports renaming the area and pinning it.
File atlasA file's functions, classes, and types as cards with AI one-liners, ordered by kind: classes and interfaces first, then functions, methods, and constants. Clicking a symbol opens the editor at that exact line.
EditorMonaco, opened at the chosen symbol.

Trivial files with only a handful of symbols skip the file atlas and open directly in the editor. A clickable breadcrumb trail and back navigation cover the whole stack. A project with no atlas yet gets a first-scan empty state, and symbols missing a one-liner note that the coverage crawl fills them in over time.

The two-layer honesty model

Code Mode separates what is always true from what an AI wrote, so you always know which one you are looking at.

  • The deterministic substrate: file tree, Monaco editor, ripgrep full-text search, tree-sitter symbol index, and git status, diff, blame, and log. Instant, always available, always true.
  • The AI enrichment layer: the area map, per-area explanations, module summaries, and per-symbol one-liners. Stored as schema-validated JSON artifacts inside the project (under documentation/atlas/, git-committed) and refreshed on a schedule.

Freshness is content-hash based. When a described file changes on disk, its area shows as stale on the map (an amber border) until the next refresh, and a drift banner offers a refresh. The AI layer can lag, but it is flagged when it does, and the substrate never lies.

The editor

  • Monaco, self-hosted: no CDN dependency, works offline, follows the SlyCode light and dark theme automatically.
  • Multi-file tabs with dirty tracking. Open files stay loaded as you move around the map, so unsaved changes survive navigation. Save via Ctrl/Cmd+S or the Save button; middle-click closes a tab.
  • Blame footer: toggle on to see the commit hash, author, and date for the line under the cursor.
  • Any project file is editable, dotfiles and .env included.

Explain with Atlas, a pinned toolbar action and a right-click menu entry, sends the current selection to the Atlas terminal for the agent to explain in context. With no selection it sends the word under the cursor with its line, or failing that the current line. When the agent highlights a range in return, the editor scrolls it into view, marks the lines, and shows the agent's note as a banner.

Search and symbols

The left rail has four tabs. The first three:

  • Files: the project tree. It respects .gitignore, excludes build output and dependency folders, and auto-expands to the active file while remembering your manual expand and collapse choices.
  • Symbols: jump-to-symbol powered by a tree-sitter index. Deterministic, no language server. It covers TypeScript/TSX, JavaScript/JSX, Python, Bash, and Java, and extracts functions, classes, methods, interfaces, types, enums, and constants. The index builds incrementally in memory and searches as you type, with prefix matches ranked first.
  • Search: full-text ripgrep search across the project, with results grouped by file, match highlighting, regex and case-sensitivity options, and a truncation note when results are capped.

Git tools

The fourth rail tab is Git: live working-tree status grouped by staged, unstaged, and untracked files, a branch dropdown with switch and create-branch, and entries for a whole-tree diff and commit history. Two views render on the main canvas:

  • Diff viewer: whole-tree diffs as per-file collapsible cards with added and removed counts; single-file diffs render as one patch with an "Open in editor" shortcut. Any commit can be opened as its own diff view.
  • Log view: commit history for the project or a single file (it follows renames). Clicking a commit opens its diff.

The Atlas terminal

A live provider CLI session is docked to the right of the code. Each project gets its own dedicated atlas session, separate from board sessions. On startup the session is briefed as the Atlas terminal, loads the atlas skill, and follows a "show, don't tell" rule: when you ask to see, find, or locate something, the agent drives the view rather than replying with a list of paths.

The agent drives the view through three one-shot directives:

DirectiveWhat it does
navigateOpens a file, optionally at a line, with an optional note shown as a toast.
highlightOpens a file with a line range highlighted and a note banner explaining it.
deckDelivers a titled list of up to 30 clickable file:line results, rendered as a docked result deck beside the code. It never floats over your code.

Directives are fire-and-forget. After delivery, the result deck and navigation are entirely yours; the agent is never in the interaction loop.

The sly-atlas CLI

The CLI is the sole write path for atlas artifacts. Agents never edit the JSON directly: every write is validated against the schema, and a rejected write leaves the atlas untouched. A confused agent can produce a rejected write, never a corrupt atlas. Writes are atomic, rejections print exactly what to fix, and the CLI runs from anywhere inside the project.

terminal
sly-atlas status
CommandWhat it does
sly-atlas initScaffolds the atlas directory and a default (disabled) refresh config.
sly-atlas statusThe work list: per-area staleness (exactly which files changed) plus per-area coverage, ending with the thinnest area to enrich next. Supports --json.
sly-atlas propose-areasWrites or replaces the root map. Pinned areas must survive, and any colors the agent sends are stripped.
sly-atlas write-nodeWrites an area node. Every referenced path must exist on disk or the write is rejected, a guard against hallucinated paths. --merge enriches an existing node without dropping content.
sly-atlas navigate / highlight / deckEmit the one-shot view directives, validated before delivery.

The artifacts themselves are small: a root map with a project overview, up to 16 areas, and up to 12 labeled flows between areas (the load-bearing relationships, not a full dependency graph); one node per area with its explanation, key files, modules, per-symbol one-liners, and content hashes of every file it describes; and declared collections, file families (specs, migrations, generated files) described once as a family rather than file by file. Schema limits cap counts and explanation length so the map stays legible.

Scheduled refresh and coverage crawl

The AI layer refreshes on a per-project nightly schedule, configured from a settings modal in Code Mode: an enabled toggle (refresh starts disabled until you turn it on), a cron schedule with a live human-readable preview (defaults to 3 AM), provider and model overrides, and a "Run now" button that kicks off a refresh immediately and opens the terminal.

  • Incremental by design: the agent re-analyzes only the areas the status report marks stale, then re-checks area boundaries if the codebase shifted. A project with no atlas gets a first scan instead: explore, propose 4 to 8 meaningful areas, write a node per area.
  • Coverage crawl, every run: freshness is not completeness. Even when nothing is stale, each run enriches the one or two thinnest areas with new module and symbol summaries and declares collections for bulk file families, so the atlas grows every run and converges on full coverage.
  • Product-owned scheduler: not a user automation card. It uses the last run time as its re-fire guard and still fires if a scheduled window was missed within the past six hours.

What stays yours

The map is AI-maintained, but your corrections stick. Renaming an area pins it automatically, and pinned areas keep their identity across refreshes: a refresh must not rename or remove them. The visual side goes the other way: card colors are assigned deterministically by the product from a fixed palette, and layout is rendered by the product, never chosen by the AI. The agent provides structure and meaning; the product renders it.

Next steps