Files and Git
The Files right-panel tab combines checkout browsing, local changes and commit history. Selecting a row is separate from opening its central reader.
Browse a checkout
- Open Files and choose Workspace.
- Select Worktree to browse when you want a different checkout; expand folders as needed.
- Click a file row to select it. Use its eye action to open or close the central preview.
- Use Refresh if the visible snapshot needs rechecking.
| Mode | Reads | Effect on the conversation |
|---|---|---|
| Workspace | Files in the browsed checkout | No session move or branch checkout |
| Changes | Index and working-tree changes | Git mutations happen only through explicit actions |
| Commits | Paginated commit history and revision contents | Read-only history; no checkout |
Expanded folders survive mode changes. Visible Workspace folders pick up files created, edited, renamed or deleted on the backend host by themselves, at most once every five seconds during continuous activity; collapsed folders and other worktrees are reread only when you show them.
Row actions include Copy path and, where the client supports opening backend paths, file-manager/editor/terminal actions such as Open with default application, Show in folder, Open in file manager and Open terminal here. Actions can move into More actions for {name} when space is limited; the file or folder name replaces {name}. A remote browser cannot assume a server path is a local-device path; see Remote Control.
Workspace .mmd files open as diagrams. Use Show source to edit and Show diagram to preview the current draft; Save remains explicit. The same Mermaid formats and limits apply.
Edit source and save safely
- Open a Workspace text file with its eye action.
- For Markdown, choose Show source to edit, or Preview Markdown to read the rendering.
- Edit and choose Save, or press Ctrl/Cmd+S while the editor has focus.
- If the file changed externally, review the overwrite confirmation; choose Cancel to keep your draft without overwriting that change.
Save writes the actual file in the browsed checkout, including a linked worktree; it does not send a prompt or stage/commit the edit. The conflict dialog says File was modified by the agent. Overwrite agent's changes?; treat any external writer's changes with the same care. Save checks the file version before replacing it; if a change is detected while saving, the save is refused and your draft is kept so you can Refresh or Save again.
With Restore previous state enabled, reopen the same file in the same project and checkout after restarting the desktop app to recover your draft. If the file changed on disk, CodeNomad keeps the draft and flags the conflict. The original changes only when you explicitly save. Each desktop profile retains up to 32 drafts, with a total limit of 256 KiB. If the window stays open because a draft could not be kept, save your edits or copy them before discarding the draft. Refresh asks before discarding a draft.
Closing the reader with its trailing close button returns to the conversation; the composer remains available below the reader. Hiding the panel with Right panel, or a window too narrow for it, leaves the reader open with the freed width; showing the panel again keeps it as it was. Changing session/worktree clears the selected reader, not a promise to save its draft. Opening a browser preview replaces the reader; opening a file returns that view to chat mode.
Reader replacement and closure affect only the current project tab. Duplicate tabs can read different files or keep a file beside chat/web/Mission content. Source/rendered choice, editor selection and scroll survive tab switches while their in-memory target/model is retained. Files mode is restored per tab; diff and wrap preferences remain shared.
Read-only and bounded previews
- Open an image, binary file or historical change with the eye action.
- For a diff, use Switch to split view / Switch to unified view, word wrap and unchanged-region controls as needed.
- Close the reader to return to chat.
| Content | Available behavior |
|---|---|
| Workspace text, including Markdown source | Editable with explicit Save |
| Workspace image | Read-only image preview |
| Other binary content | Read-only unavailable-preview fallback |
| Changes/Commits text diff | Read-only comparison, not an editor for either side |
| Git image diff | Before/After images from the exact compared revisions |
Preview reads are bounded; large/unsupported content may be unavailable rather than loaded without limit. Historical images never substitute the current worktree file. Open the file with an appropriate external application where available, without changing its revision just to obtain a preview.
Stage, unstage and commit
- Choose Changes and inspect Staged Changes and Changes.
- Use Stage file / Unstage file, select several rows for the corresponding selected-files action, or drag rows between the sections.
- Enter a message at the top of Staged Changes, then choose Commit.
Collapsed section headers remain drop targets. Collapsing sections or changing modes preserves their state and the commit-message draft. A long section shows its first 200 files, then a line such as 480 files not shown with Show 200 more to reveal the next ones in place; section counts remain full totals, and the current, previewed and selected files stay shown. Shift-click ranges cover shown rows only, so a bulk action never includes a file you cannot see. Staging/unstaging changes the index in the browsed worktree; committing records staged content only. Unstaging does not discard the worktree edit.
Review staged files before committing, especially when agents or another client also write there.
Read commit history
- Choose Commits and select a commit to read its message and changed files.
- Use Filter loaded commits… to filter the loaded set, or Load older commits to fetch another page.
- Open a changed file with its eye action.
Text history compares the commit with its first parent (or an empty base for a root commit). It does not switch HEAD or move sessions. Filtering loaded commits is not a server-wide Git log search. Refresh to start from current history after new commits; existing pagination retains its starting history snapshot.
Whitespace and line endings
- Open Settings → Advanced → Hide whitespace-only changes.
- Turn it off if you need to inspect unstaged whitespace-only edits omitted from Changes.
- Review the actual diff and staged content before committing.
The setting is on by default. Its main effect is hiding qualifying unstaged tracked text modifications from the Changes list, counts, selection, bulk staging and drag actions. Hidden files remain unstaged. Staged files remain visible, as do untracked, added/deleted/renamed and binary files.
Git's list detection can ignore inner whitespace, CRLF-only changes and added/removed final newlines. The diff reader's whitespace comparison is narrower: indentation and trailing spaces/tabs, not all inner whitespace. Stage and Commit always act on exact content, regardless of the display preference.
Line-ending and byte-order-mark differences may produce a factual note instead of highlighted lines. Turning the setting off cannot make the editor draw every line-ending/BOM change or every same-length trailing-whitespace swap. A visually empty diff is not proof of identical bytes.
Initialize Git
- Open Changes or Commits in a folder that is not a repository.
- Choose Initialize Git; it runs immediately without confirmation.
- Wait for the project/session refresh, then stage and commit explicitly when ready.
Initialization creates .git in the explicitly opened folder; it does not initialize a parent directory or create a first commit. If Git is missing on the backend, directory-only conversations and Workspace browsing remain possible, but initialization and Git operations are unavailable. See Projects.