[{"data":1,"prerenderedAt":40},["ShallowReactive",2],{"doc:en:git":3},{"title":4,"lede":5,"html":6,"headings":7},"Git: changes, diffs and commits","This page explains how to see what your agents changed, read a diff, commit, browse the repository’s history, and show the conversation and the files side by side.","\u003Ch2 id=\"the-uncommitted-files-panel\">The uncommitted files panel\u003C\u002Fh2>\n\u003Cp>The panel opens to the right of an agent’s conversation. In the classic layout, the “Files ▸” counter in the conversation’s header opens and closes it, as does \u003Ccode class=\"key\">Ctrl+Shift+B\u003C\u002Fcode> (\u003Ccode class=\"key\">⇧⌘B\u003C\u002Fcode> on macOS); the panel’s × closes it too. It has two tabs: “Uncommitted”, followed by the number of files, and “History”, described \u003Ca href=\"#history-and-the-git-graph\">below\u003C\u002Fa>.\u003C\u002Fp>\n\u003Cp>Under the tabs, two buttons choose what the list shows:\u003C\u002Fp>\n\u003Cdiv class=\"table\">\u003Ctable>\n\u003Cthead>\n\u003Ctr>\n\u003Cth>Button\u003C\u002Fth>\n\u003Cth>What you see\u003C\u002Fth>\n\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\u003Ctr>\n\u003Ctd>“This agent”\u003C\u002Ftd>\n\u003Ctd>The agent’s files. If it has a \u003Ca href=\"\u002Fen\u002Fdocs\u002Fworktrees\u002F\">worktree\u003C\u002Fa>, those of its worktree (“worktree .claude\u002Fworktrees\u002Frefacto-auth · isolated from the other agents”). Otherwise, the files it changed in the project folder, based on its edits.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>“Whole project”\u003C\u002Ftd>\n\u003Ctd>The files of the project folder and those of each agent’s worktree, each tagged with the name of the agent it belongs to.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftbody>\u003C\u002Ftable>\u003C\u002Fdiv>\n\u003Cp>Each row gives the letter for the file’s state (\u003Ccode class=\"key\">M\u003C\u002Fcode> modified in amber, \u003Ccode class=\"key\">A\u003C\u002Fcode> added in green, \u003Ccode class=\"key\">D\u003C\u002Fcode> deleted in red), its name, its folder, then the number of lines added (\u003Ccode class=\"key\">+29\u003C\u002Fcode>) and deleted (\u003Ccode class=\"key\">−3\u003C\u002Fcode>). A new file that git doesn’t track yet counts as added. The list updates by itself while the agent works, and as soon as anything changes in the folder. It shows at most 500 rows, then “… and N more files”; the diff and the commit cover all the files.\u003C\u002Fp>\n\u003Cp>When there is nothing, the list says “No files changed by this agent.” or “No uncommitted changes.”\u003C\u002Fp>\n\u003Ch3 id=\"what-you-can-do-with-a-file\">What you can do with a file\u003C\u002Fh3>\n\u003Cul>\n\u003Cli>Clicking a row opens its diff (classic layout) or shows it under the list (\u003Ca href=\"#side-by-side-conversation-and-files\">side-by-side layout\u003C\u002Fa>).\u003C\u002Fli>\n\u003Cli>The \u003Ccode class=\"key\">&lt;\u002F&gt;\u003C\u002Fcode> button that appears at the right of the row when you hover it, or “Open in editor” in its menu (right-click), opens the file in the \u003Ca href=\"\u002Fen\u002Fdocs\u002Feditor\u002F\">editor\u003C\u002Fa>, in the agent’s worktree if it has one. For a deleted file, the button isn’t there and the menu entry is greyed out.\u003C\u002Fli>\n\u003Cli>Right-clicking also lets you undo a file:\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Cdiv class=\"table\">\u003Ctable>\n\u003Cthead>\n\u003Ctr>\n\u003Cth>Menu entry\u003C\u002Fth>\n\u003Cth>For a file that is…\u003C\u002Fth>\n\u003Cth>What happens\u003C\u002Fth>\n\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\u003Ctr>\n\u003Ctd>“Discard changes…”\u003C\u002Ftd>\n\u003Ctd>modified\u003C\u002Ftd>\n\u003Ctd>After confirmation, it goes back to its state at the last commit: its uncommitted changes are lost.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>“Delete the file…”\u003C\u002Ftd>\n\u003Ctd>added\u003C\u002Ftd>\n\u003Ctd>After confirmation, it is deleted from your disk and can’t be recovered, because it was never committed.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>“Restore the file”\u003C\u002Ftd>\n\u003Ctd>deleted\u003C\u002Ftd>\n\u003Ctd>It goes back to its state at the last commit, without confirmation.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftbody>\u003C\u002Ftable>\u003C\u002Fdiv>\n\u003Cdiv class=\"callout warning\">\u003Cp class=\"callout-title\">Warning\u003C\u002Fp>\u003Cp>“Discard changes” and “Delete the file” don’t go through the trash: there is no way back.\u003C\u002Fp>\n\u003C\u002Fdiv>\n\u003Ch3 id=\"the-buttons-at-the-bottom\">The buttons at the bottom\u003C\u002Fh3>\n\u003Cul>\n\u003Cli>“Show diff” opens the \u003Ca href=\"#the-diff-viewer\">viewer\u003C\u002Fa> on all the files in the list (for “Whole project”, those of the project and of each worktree).\u003C\u002Fli>\n\u003Cli>“Commit…” (“This agent”) or “Commit all…” (“Whole project”) starts \u003Ca href=\"#committing\">a commit\u003C\u002Fa>. The buttons are greyed out when the list is empty.\u003C\u002Fli>\n\u003Cli>For an agent that has a worktree, “Merge escouade\u002Frefacto-auth → main…” merges its work into its base branch, and “Integrate main” brings the base into it: see \u003Ca href=\"\u002Fen\u002Fdocs\u002Fworktrees\u002F\">one worktree per agent\u003C\u002Fa> and \u003Ca href=\"\u002Fen\u002Fdocs\u002Fbranches\u002F\">branches\u003C\u002Fa>.\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Ch2 id=\"the-diff-viewer\">The diff viewer\u003C\u002Fh2>\n\u003Cp>The viewer is a large window. It opens with “Show diff”, by clicking a file in the list (classic layout), by clicking a commit in the history, or by comparing branches. Its title says what it shows (“Changes in refacto-auth”, “4f2a9c1 · feat: pagination”, “main ↔ feat\u002Flogin”) along with the number of files. With several files, the list is on the left, with each file’s state, its path, the agent it belongs to and its \u003Ccode class=\"key\">+\u003C\u002Fcode>\u002F\u003Ccode class=\"key\">−\u003C\u002Fcode> lines; the diff of the chosen file is on the right. \u003Ccode class=\"key\">Esc\u003C\u002Fcode> or the × closes it.\u003C\u002Fp>\n\u003Cp>Two presentations, chosen with the “Unified” and “Side by side” buttons:\u003C\u002Fp>\n\u003Cul>\n\u003Cli>“Unified”: a single column, with the old and new line numbers and a \u003Ccode class=\"key\">+\u003C\u002Fcode> or \u003Ccode class=\"key\">−\u003C\u002Fcode> sign in front of each changed line;\u003C\u002Fli>\n\u003Cli>“Side by side”: the old version on the left, the new one on the right, paired lines facing each other. Long lines wrap so that the two columns stay aligned.\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Cp>The choice is kept from one session to the next. It applies everywhere: the viewer, the diff of the chosen file in the panel, and the diffs the conversation shows under the agent’s edit tool calls.\u003C\u002Fp>\n\u003Cp>A few special cases:\u003C\u002Fp>\n\u003Cdiv class=\"table\">\u003Ctable>\n\u003Cthead>\n\u003Ctr>\n\u003Cth>What the viewer says\u003C\u002Fth>\n\u003Cth>Why\u003C\u002Fth>\n\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\u003Ctr>\n\u003Ctd>“No differences.”\u003C\u002Ftd>\n\u003Ctd>The file went back to its original state.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>“Binary file.”\u003C\u002Ftd>\n\u003Ctd>The file is binary: there is no diff to read.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>“This diff is too large to display.”\u003C\u002Ftd>\n\u003Ctd>This file’s diff is over about 4 MB.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>“Large diff (N lines)” and the “Show” button\u003C\u002Ftd>\n\u003Ctd>The diff has more than 1,500 lines. It stays folded until you ask for it.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftbody>\u003C\u002Ftable>\u003C\u002Fdiv>\n\u003Cp>An unfolded diff appears in slices of 500 lines: the “Show 500 more lines” button adds the next one.\u003C\u002Fp>\n\u003Ch2 id=\"committing\">Committing\u003C\u002Fh2>\n\u003Cp>The “Commit…” and “Commit all…” buttons of the panel follow the project’s “Commit” setting (Settings › Projects, “Git” group). It has two values: “Written by the agent”, the default, and “Direct, with a suggested message”. The full list of project settings is in \u003Ca href=\"\u002Fen\u002Fdocs\u002Fsettings-projects\u002F\">the project settings\u003C\u002Fa>.\u003C\u002Fp>\n\u003Ch3 id=\"asking-the-agent-to-commit\">Asking the agent to commit\u003C\u002Fh3>\n\u003Cp>This is the default behavior. “Commit…” sends the agent a message: it must commit the changes it made in the repository, with a clear message in Conventional Commits format, include only the files it changed, and make several commits if there are several distinct topics. A “Commit request sent to refacto-auth” message confirms it, and the rest happens in the conversation, as with any message: the agent may ask for permissions, for example to run \u003Ccode class=\"key\">git\u003C\u002Fcode>.\u003C\u002Fp>\n\u003Cp>“Commit all…” asks the selected agent to commit all the repository’s current changes, grouped into coherent commits. An agent must therefore be selected.\u003C\u002Fp>\n\u003Cp>The message is sent in the language set by “Language of texts written by Claude” (see \u003Ca href=\"\u002Fen\u002Fdocs\u002Fsettings-application\u002F\">the application settings\u003C\u002Fa>).\u003C\u002Fp>\n\u003Ch3 id=\"committing-yourself-with-a-suggested-message\">Committing yourself, with a suggested message\u003C\u002Fh3>\n\u003Cp>With “Direct, with a suggested message”, “Commit…” opens the “Commit” window. It says what is being committed (“Changes in refacto-auth”), lists the files in the commit and offers the “Message” field.\u003C\u002Fp>\n\u003Col>\n\u003Cli>Haiku reads the list of files and their diff, along with the repository’s latest commit subjects, and suggests a message in the same style (“Haiku is writing the message…”). It can take a few seconds, 90 at most.\u003C\u002Fli>\n\u003Cli>Read the message and edit it as you like. If you start typing before the suggestion arrives, it doesn’t replace your text. “Regenerate” asks for another one, which replaces the contents of the field.\u003C\u002Fli>\n\u003Cli>“Commit” creates the commit, closes the window and shows “Commit 4f2a9c1 created”.\u003C\u002Fli>\n\u003C\u002Fol>\n\u003Cp>What to know:\u003C\u002Fp>\n\u003Cul>\n\u003Cli>Nothing is committed unless you click “Commit”.\u003C\u002Fli>\n\u003Cli>The commit takes exactly the files in the list, new, modified and deleted, and nothing else: anything that was already staged elsewhere stays staged, out of the commit. The list has no checkboxes: the commit takes all the listed files.\u003C\u002Fli>\n\u003Cli>Git hooks run. If one refuses the commit, its message appears in the window, with your text intact.\u003C\u002Fli>\n\u003Cli>If Haiku suggests nothing, the window says “No suggestion: …” and you write the message.\u003C\u002Fli>\n\u003Cli>“This agent” commits the agent’s worktree, or the files it changed in the project folder. “Whole project” commits the project folder alone: an agent’s worktree is committed from “This agent”.\u003C\u002Fli>\n\u003Cli>The files the project copies into its worktrees (\u003Ccode class=\"key\">.env*\u003C\u002Fcode> by default) are never committed. The window says so (“Never committed: .env (copied into the worktrees).”) and their contents are not shown to Haiku.\u003C\u002Fli>\n\u003Cli>By default, the suggested message follows the language of the repository’s latest commits. If you set “Language of texts written by Claude”, that language is requested.\u003C\u002Fli>\n\u003Cli>Closing the window with a message you wrote or edited asks for confirmation (“Discard the message?”).\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Ch2 id=\"history-and-the-git-graph\">History and the git graph\u003C\u002Fh2>\n\u003Cp>The “History” tab draws the graph of the whole repository: the latest 300 commits of all branches, local and remote, and the tags, with lines showing where each branch starts and where it is merged. Each row gives the commit, its labels, its subject and its age; hovering a commit shows its short hash and its author.\u003C\u002Fp>\n\u003Cul>\n\u003Cli>The agent’s branch is highlighted: its commits are in full color, with a bigger dot, and the rest is dimmed. When first displayed, the list scrolls to it. Without an agent that has a worktree, the branch of the project folder is highlighted.\u003C\u002Fli>\n\u003Cli>The labels tell apart the current branch (in the accent color), agents’ branches (shown under the agent’s name), remote branches (outlined) and tags.\u003C\u002Fli>\n\u003Cli>Clicking a commit opens its diff in the \u003Ca href=\"#the-diff-viewer\">viewer\u003C\u002Fa>. For a merge commit, the diff is against the first parent.\u003C\u002Fli>\n\u003Cli>Right-clicking (or the Menu key, or \u003Ccode class=\"key\">Shift+F10\u003C\u002Fcode>) opens the commit’s menu.\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Cdiv class=\"table\">\u003Ctable>\n\u003Cthead>\n\u003Ctr>\n\u003Cth>Menu entry\u003C\u002Fth>\n\u003Cth>Effect\u003C\u002Fth>\n\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\u003Ctr>\n\u003Ctd>“Create a branch here…”\u003C\u002Ftd>\n\u003Ctd>Opens “New branch”, starting at this commit.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>“Switch to feat\u002Flogin”\u003C\u002Ftd>\n\u003Ctd>Switches the project folder to this local branch. One entry per local branch that points at the commit, except the project folder’s.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>“Compare with the current branch” (“Compare with HEAD” on a detached HEAD)\u003C\u002Ftd>\n\u003Ctd>Opens the viewer with what changes between the current branch and this commit, titled “main ↔ feat\u002Flogin”. The entry is absent on the commit the project folder is on.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>“Delete branch…”\u003C\u002Ftd>\n\u003Ctd>Deletes a local branch that points at the commit (not the project folder’s), after confirmation. With several branches on the commit, the entry names the one it deletes.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftbody>\u003C\u002Ftable>\u003C\u002Fdiv>\n\u003Cp>A branch held by an agent’s worktree can neither be switched to nor deleted: the entry is greyed out and says why. The questions these actions ask (uncommitted changes, a branch not merged yet) are described in \u003Ca href=\"\u002Fen\u002Fdocs\u002Fbranches\u002F\">branches\u003C\u002Fa>.\u003C\u002Fp>\n\u003Ch2 id=\"side-by-side-conversation-and-files\">Side by side: conversation and files\u003C\u002Fh2>\n\u003Cp>\u003Ccode class=\"key\">Ctrl+Shift+L\u003C\u002Fcode> (\u003Ccode class=\"key\">⇧⌘L\u003C\u002Fcode> on macOS), or the “Conversation and files side by side” button at the right of the conversation’s header, changes the layout. The button next to it, “Classic layout”, goes back. The choice is kept from one restart to the next.\u003C\u002Fp>\n\u003Cp>\u003Cimg src=\"\u002Fimages\u002Fen\u002Fgit.jpg\" alt=\"An agent’s conversation on the left, its changed files and the side-by-side diff of one file on the right\" width=\"1920\" height=\"960\" loading=\"lazy\" decoding=\"async\">\u003C\u002Fp>\n\u003Cp>In this layout, the conversation takes the left half and the panel, always shown, the right half. The list of files is at the top (about a third of the height at most), and the diff of the chosen file is below it, across the whole available width. Clicking a row changes the file; the first one is chosen at the start, and the chosen file stays displayed when the list changes. List and diff refresh while the agent works: you read its changes as they come.\u003C\u002Fp>\n\u003Cp>Since the panel is always there, \u003Ccode class=\"key\">Ctrl+Shift+B\u003C\u002Fcode> no longer has any effect and “Files” becomes a plain counter in the header. The “Uncommitted” and “History” tabs, the buttons at the bottom and the viewer (“Show diff”) are the same.\u003C\u002Fp>\n\u003Ch2 id=\"project-changes-at-a-glance\">Project changes at a glance\u003C\u002Fh2>\n\u003Cul>\n\u003Cli>Each project’s tab shows “Δ 7” when the project has uncommitted files (the tooltip says “Uncommitted git changes”). The number counts the files modified, added or deleted in the project folder and in its agents’ worktrees. It disappears at zero.\u003C\u002Fli>\n\u003Cli>In the sidebar, each agent card shows its number of files (“6 files”), and the foot of the sidebar details the project’s totals (“~2 modified”, “+1 added”, “−0 deleted”).\u003C\u002Fli>\n\u003Cli>The branch of the project folder, with how far ahead of or behind the remote it is, is in the status bar: it is the button that opens \u003Ca href=\"\u002Fen\u002Fdocs\u002Fbranches\u002F\">the branch picker\u003C\u002Fa>.\u003C\u002Fli>\n\u003C\u002Ful>\n",[8,12,16,19,22,25,28,31,34,37],{"id":9,"text":10,"depth":11},"the-uncommitted-files-panel","The uncommitted files panel",2,{"id":13,"text":14,"depth":15},"what-you-can-do-with-a-file","What you can do with a file",3,{"id":17,"text":18,"depth":15},"the-buttons-at-the-bottom","The buttons at the bottom",{"id":20,"text":21,"depth":11},"the-diff-viewer","The diff viewer",{"id":23,"text":24,"depth":11},"committing","Committing",{"id":26,"text":27,"depth":15},"asking-the-agent-to-commit","Asking the agent to commit",{"id":29,"text":30,"depth":15},"committing-yourself-with-a-suggested-message","Committing yourself, with a suggested message",{"id":32,"text":33,"depth":11},"history-and-the-git-graph","History and the git graph",{"id":35,"text":36,"depth":11},"side-by-side-conversation-and-files","Side by side: conversation and files",{"id":38,"text":39,"depth":11},"project-changes-at-a-glance","Project changes at a glance",1791926756243]