Code mode: Sledbot's built-in code editor
Use Sledbot's Code mode editor: explorer, tabs, Find in Files, language servers, previews, saving, remote files, and the VS Code features it lacks.
Updated 10 min read
On this page
This page shows you how to use Code mode, the Sledbot code editor, to read and edit files on this Mac or on a remote machine. Code mode is a VS Code-like editor built on Monaco. Its editor assets are bundled with the app, so the editor itself loads without any network or CDN access. It is built for reviewing and adjusting what your agents write. It is not a full IDE replacement (see What Code mode doesn't do).
Open Code mode, the Sledbot code editor
You can open Code mode in any of these ways:
- Use the Workspace | Code switch in the toolbar, or View ▸ Show Code (⇧⌘E, Command-Shift-E). The same shortcut switches back to Workspace.
- Choose ⌘K ▸ Switch to Code.
- Choose Open in Code from a space's context menu or from an agent session's header.
- ⌘-click a
file:linepath in a terminal to open that file in Code.
If no folder is open, you see "No folder open" with Open Folder…. Pick a space in the sidebar, or open any folder on this Mac.
The start screen lists Recent files and these shortcuts:
| Action | Shortcut |
|---|---|
| Go to file | ⌘P |
| Find in files | ⇧⌘F |
| Command palette | ⌘K |
| Toggle sidebar | ⌘B |
| Terminal (bottom panel) | ⌃` |
The sidebar has the activity tabs Explorer, Search, Source Control, GitHub and Problems. The bottom panel has Terminal, Problems, Output and References. Below 700 pt wide, the sidebar floats over the editor. ⇧⌘P opens Sledbot's ⌘K palette. There is no separate editor palette.
Explorer: file operations, drag and drop, nesting
The file tree loads folders as you expand them. It shows git status letters and problem colors, and it dims git-ignored files. Typing in the tree filters only folders that are already loaded. To search every file, use ⌘P.
- Header buttons: New File, New Folder, Reveal Active File, Collapse Folders and a filter. With the editor focused, ⌘N also creates a new file.
- Row menu: includes Open to the Side, Duplicate, Find in Folder…, Open in Terminal, Select for Compare / Compare with “name”, Add to .gitignore, Rename…, Copy Path and Copy Relative Path. Select two files to get Compare Selected.
- Drag and drop: dragging inside the tree moves files, and holding ⌥ while dragging copies them. Moves may ask you to confirm. Files from Finder can only be dropped into a local space.
- Delete: in a local space, Move to Trash sends files to the Trash. On a remote machine, Delete… is permanent ("Remote files are deleted permanently. This can’t be undone.").
- Hidden by default:
.git,.svn,.hg,CVS,.DS_Store,Thumbs.db, plus anything in yourfiles.excludesetting. - File nesting: related files sit under a parent file. For example, lockfiles nest under
package.jsonandPackage.resolvednests underPackage.swift.
These view options are all on by default: Compact Folders, File Nesting, Dim Git-Ignored Files, Reveal Active File Automatically and Confirm Drag and Drop.
Tabs, split editor and quick open
A single click opens a file in an italic preview tab. To pin it as a normal tab, double-click the file, edit it, or choose Keep Open.
| Action | Shortcut |
|---|---|
| Reopen closed tab | ⇧⌘T |
| Previous / next tab | ⇧⌘[ / ⇧⌘] |
| Pick tab 1–8 / last tab | ⌘1…⌘8 / ⌘9 |
| Split Editor | ⌘\ |
| Go to Line… | ⌃G |
| Go to Symbol in File… | ⇧⌘O |
You can split the editor into up to 3 groups. Use View ▸ Split Editor, or drag a tab to split. If you try to add a fourth group, you see "Sledbot shows up to 3 editor groups."
Quick open (Go ▸ Go to File…, ⌘P) uses fuzzy matching and puts recent files first. It shows up to 60 results and accepts these forms:
:lineto go to a line@symbolto find a symbol in the current file#to find a workspace symbolfile:line[:col]to jump straight to a position
The breadcrumb bar shows the file path and the language server's symbol chain.
Find, replace and Find in Files
Inside a file, Monaco's built-in find (⌘F) and find-and-replace (⌥⌘F) work as usual. The terminal Find menu is turned off in Code mode.
Find in Files (Go ▸ Find in Files, ⇧⌘F) has these controls:
- Match Case, Match Whole Word and Use Regular Expression.
- Fields for files to include and exclude, for example
src/**, *.swiftornode_modules/**. - Toggle Replace, then Replace or Replace All. Replace All asks you to confirm first. It skips files that have unsaved changes in the editor.
- For each file: Replace in This File and Dismiss.
Results stop at 2,000, followed by "(more not shown)". If ripgrep is installed on the machine that holds the files, search uses it. Otherwise it uses a built-in walker. Either way, it always skips .git, node_modules, .build, build, DerivedData, and any file over 10 MB.
Outline and Timeline
Outline lists the file's symbols from the language server, up to 5,000. When there is no server, Markdown files show their headings instead. The view has Filter, Collapse All and Refresh buttons.
Timeline shows a file's history:
- Git commits, 50 at a time, with Load More.
- Local save history. It keeps 50 versions per file and skips versions larger than 4 MiB.
- The current unsaved buffer.
You can filter the list by Git History or Local History. Right-click an entry for Compare with Current, Show Changes in This Commit, Open File at This Revision or Copy Commit Hash. Go ▸ Line History runs git log -L.
Language servers: which ones and how to install them
A language server starts when you open a file in its language, if the server's binary is on that machine's PATH. Sledbot never installs servers for you. Install each one you need on the machine that holds the files, whether that is this Mac or a remote machine.
| Language | Server | Install |
|---|---|---|
| Swift | xcrun sourcekit-lsp (Mac), sourcekit-lsp (Linux) | Xcode or xcode-select --install. On Linux, a Swift toolchain from swift.org |
| TypeScript / JavaScript | typescript-language-server | npm install -g typescript-language-server typescript |
| Python | pyright-langserver | npm install -g pyright (or pipx install pyright) |
| Go | gopls | go install golang.org/x/tools/gopls@latest |
| Rust | rust-analyzer | rustup component add rust-analyzer |
| C / C++ / Objective-C | clangd | xcode-select --install or brew install llvm (Mac). Your distribution's clangd package (Linux) |
When a server is running, you get:
- Diagnostics in Problems, plus completion, hover and signature help.
- Go to definition, references, rename and formatting.
- Code actions, inlay hints and call hierarchy (results open in References).
The status bar shows LSP, LSP starting, No LSP or LSP error. Language server logs appear in the Output panel.
Ask an agent from the editor
Select some code, right-click, and choose Ask Agent About Selection or Fix with Agent. Fix with Agent is also on the lightbulb next to a problem.
Sledbot sends the file, the line and the code to an agent's terminal. It picks the agent in this order:
- The focused agent.
- The most recent agent in this folder.
- Any live agent.
If no agent is running, you see "No agent is running here. Start one (⌘T), then ask again." Each request can be up to 100,000 characters.
Quick diff and inline blame
Marks in the gutter show your changes against the git index. Click a mark to open a peek with Previous Change, Next Change, Stage Change and Revert Change. Revert Change only changes the buffer, so you can undo it.
Inline blame appears as ghost text on the cursor line while the file has no unsaved edits. Its hover card has Open Commit, Copy Hash and Blame Previous Revision. It also has Open on GitHub, but only for local checkouts.
To review everything on an agent's branch, see Review an agent's changes.
Previews: images, CSV, Markdown and more
- Images (png, jpg, gif, webp, heic, tiff, avif, svg and others): Zoom In and Zoom Out. SVG files also have Edit as XML.
- PDF: Open in Preview.
- Audio and video (mp4, mov, webm, mkv, mp3, m4a, wav, flac and others): play in the system player.
- CSV, TSV and .tab: a sortable grid that detects the delimiter. It has a Header row option and Edit as Text. Files longer than 1,000,000 rows are truncated.
- Other binary files: a Quick Look preview with Open in Default App and Open as Text Anyway.
Markdown has a live preview that scrolls in sync with the source. Open it with View ▸ Toggle Markdown Preview (⇧⌘V). To open it beside the source, use Open Markdown Preview to the Side (⌘K, then V).
- It renders GitHub-style alerts, footnotes, task lists, Mermaid diagrams and KaTeX math.
- Clicking a task-list checkbox edits the source.
- Links to other
.mdfiles open in Sledbot. - Remote images stay blocked until you click Load remote images.
- To export, use Copy Markdown Preview as HTML, Export as HTML… or Export Markdown Preview as PDF….
Saving, conflicts and hot exit
Save the current file with ⌘S, or all open files with Save All (⌥⌘S). If you close a tab with unsaved edits, you can choose Save, Don’t Save or Cancel.
When a file changes on disk, for example because an agent edited it:
- No unsaved edits in the editor: the file reloads silently.
- You have unsaved edits: a banner offers Compare, Keep Mine or Take Theirs.
- The file was deleted on disk: your edits stay in the editor, with Save Again or Close.
Hot exit saves unsaved buffers to ~/Library/Application Support/Sledbot/HotExit/ about 2 seconds after each change. On the next launch, they reopen as tabs with unsaved changes.
Files are always read and written as UTF-8. Files over 10 MB don't open ("File too large to open").
Remote files
Code mode can open a space on a remote machine. Reading, writing, language servers, search and git all run on that machine. While you work there, the status bar shows "Files on <machine>". Some things work differently on remote machines:
- Deleting a file is permanent.
- You can't drop files from Finder into the tree.
- The GitHub panel and Open on GitHub work only for local checkouts.
To set up a remote machine, see Run agents on your own servers.
Settings files
Code mode reads settings with VS Code key names from these files:
~/.config/sledbot/settings.json<root>/.sledbot/settings.json<root>/.vscode/settings.json(you can turn this off withsledbot.honourVSCodeSettings).editorconfig, which wins over the others
Only these keys are applied:
editor.tabSize,editor.insertSpaces,editor.detectIndentationfiles.eol,files.trimTrailingWhitespace,files.insertFinalNewlinefiles.associations,files.exclude
All other keys are ignored, including formatOnSave, wordWrap, rulers and files.encoding.
The app has three editor settings:
- Settings ▸ Appearance ▸ Editor ▸ Font size: 9–24 pt. The default is 13 pt.
- Settings ▸ General ▸ Code ▸ TextMate syntax highlighting: on by default. If you turn it off, the change applies after Sledbot restarts.
- Settings ▸ General ▸ Code ▸ File icons: Coloured, Minimal or None.
From the status bar, you can also change the indentation, the line endings (LF or CRLF) and the file's language (54 languages).
What Code mode doesn't do
If you come from VS Code, expect these gaps:
- No extensions or marketplace, debugger, notebooks, Live Share, Emmet or Zen mode.
- No back/forward navigation history.
- No AI inline completions (ghost text). Use Ask Agent About Selection instead.
- No untitled buffers and no Save As. Create new files in the Explorer.
- No snippets, semantic highlighting, HTML preview, search editor tab or "respect .gitignore" toggle.
- No settings UI for font family, ligatures, word wrap, minimap, rulers or format on save.
- No custom keybindings or VS Code keymap. Monaco's default editing keys still work.
- No automatic language server installs, and only the 6 server families listed above.
Troubleshooting
- "No LSP" or "No language server for
<Language>on this machine." The server isn't on that machine's PATH. Install it from the table above on the machine that holds the files, then reopen the file. - "The language server stopped": the server crashed. Check the Output panel for its log, then reopen the file.
- "File too large to open": the file is over 10 MB. Read it in a terminal instead, for example with
less. - "
<name>can’t be shown as text.": the file is binary. If you see the Quick Look preview, Open as Text Anyway shows the raw contents. - "Couldn’t save
<name>:<error>": check the folder's permissions. For a remote file, check the machine's connection on the Machines screen. - "Editor bundle missing" or "Preview bundle missing": the app install is broken. Download Sledbot again from macsuite.app and replace the copy in Applications.
- Find in Files misses results: it always skips
node_modules,build,.build,DerivedData,.gitand files over 10 MB. It also stops at 2,000 results, so narrow the search with an include pattern.