Inspect uncommitted changes and send line or range comments to your agent
Open Changes from the Code session panel to review the workspace’s current uncommitted changes. Review includes changes made by you, the agent, and other tools, including untracked files.For one turn’s patch, open its change card instead.
Changed files appear as ordered, collapsible diffs. Search the file list by current or renamed path to jump to a file.Choose unified or split layout. Additions, removals, renamed files, and new files remain visible in their file context.You can expand Review for more space and keep a floating chat beside the diff.
Click the line’s comment control and write feedback. For several lines, drag + from the first line to the last, or click a line number and Shift-click another.Pending comments appear as context in the composer. Choose the chat you want to send them to, add your message, and send.
Address these review comments and explain how you verified the changes.
The saved prompt retains the comments and code they referred to. If the diff changes before you send, the comment keeps its original context instead of moving silently to another line.
Unsent comments are local drafts and disappear on reload. Send them when you want them recorded in the conversation.
The Git actions panel can discard a file or all working-tree changes. Read its confirmation: reverting an untracked file deletes it.Discarding the workspace diff differs from Undo for one turn. It can remove changes from other turns or from your own edits.
Use Git actions after reviewing. Creating a PR needs a GitHub remote and authenticated GitHub CLI.Review comments sent to your agent stay in the local conversation. To publish comments on a GitHub PR, use the separate pull request view.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Mains","description":"Code, Work, and Chat with AI agents in Mains, with Atlas and connected task context","colors":{"primary":"#878580","light":"#fff","dark":"#0C0C0C"},"logo":{"light":"https://mintcdn.com/truelaurel/5xCc2j6h7zMlnmQQ/images/docs.png?fit=max\u0026auto=format\u0026n=5xCc2j6h7zMlnmQQ\u0026q=85\u0026s=586a97bae16dc9d71532c86534535906","dark":"https://mintcdn.com/truelaurel/5xCc2j6h7zMlnmQQ/images/docs.png?fit=max\u0026auto=format\u0026n=5xCc2j6h7zMlnmQQ\u0026q=85\u0026s=586a97bae16dc9d71532c86534535906"},"favicon":"https://mintcdn.com/truelaurel/b8FimJWSWgesRQSk/favicon.svg?fit=max\u0026auto=format\u0026n=b8FimJWSWgesRQSk\u0026q=85\u0026s=03d7b53377c5ffeb60b5c440bf3ba4a6","appearance":{"default":"system"},"background":{"color":{"dark":"#0C0C0C"}},"navbar":{"links":[{"href":"https://mains.dev","label":"Website"},{"href":"mailto:team@mains.dev","label":"Support"}],"primary":{"type":"button","label":"Download","href":"https://github.com/mainsdotdev/mains/releases/latest"}},"footer":{"socials":{"github":"https://github.com/mainsdotdev/mains"}},"fonts":{"family":"Geist"},"contextual":{"options":["copy","view","chatgpt","claude","perplexity","mcp","cursor","vscode"],"display":"header"},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"truelaurel","hasAudioNarration":false,"actualSubdomain":"truelaurel","customDomains":["docs.mains.dev"],"gitSource":{"type":"github","owner":"mainsdotdev","repo":"docs","deployBranch":"master","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6ae03dfe87a96311da527476","collectionId":"67508890-d3aa-47a1-b62f-29d92008dcd0","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ae03dfe87a96311da527476"},"entitlements":{},"buildId":"6ae03dfe87a96311da527476","clientVersion":"0.0.4067","searchFilterCounts":[{"language":"default","tag":"Guides","count":46},{"language":"default","tag":"Integrations","count":13},{"language":"default","tag":"Agents","count":11},{"language":"default","tag":"Code workflow","count":10},{"language":"default","tag":"Connections","count":8},{"language":"default","tag":"Core concepts","count":7},{"language":"default","tag":"Working with agents","count":6},{"language":"default","tag":"Mains Connect","count":6},{"language":"default","tag":"Codex","count":5},{"language":"default","tag":"Extend your agents","count":5}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[],"googleFontsInlined":true},"customCss":[],"page":{"pagePath":"diff-viewer","slug":"/diff-viewer","pageMetadata":{"title":"Review changes","description":"Inspect uncommitted changes and send line or range comments to your agent","icon":"code-compare","href":"/diff-viewer"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Inspect uncommitted changes and send line or range comments to your agent\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,..._provideComponents(),...props.components},{CodeBlock,Heading,Note}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`Open `,_jsx(_components.strong,{children:`Changes`}),` from the Code session panel to review the workspace’s current uncommitted changes. Review includes changes made by you, the agent, and other tools, including untracked files.`]}),`\n`,_jsxs(_components.p,{children:[`For one turn’s patch, open its `,_jsx(_components.a,{href:`/turn-changes`,children:`change card`}),` instead.`]}),`\n`,_jsx(Heading,{level:`2`,id:`read-the-diff`,children:`Read the diff`}),`\n`,_jsx(_components.p,{children:`Changed files appear as ordered, collapsible diffs. Search the file list by current or renamed path to jump to a file.`}),`\n`,_jsx(_components.p,{children:`Choose unified or split layout. Additions, removals, renamed files, and new files remain visible in their file context.`}),`\n`,_jsx(_components.p,{children:`You can expand Review for more space and keep a floating chat beside the diff.`}),`\n`,_jsx(Heading,{level:`2`,id:`comment-on-a-line-or-range`,children:`Comment on a line or range`}),`\n`,_jsxs(_components.p,{children:[`Click the line’s comment control and write feedback. For several lines, drag `,_jsx(_components.strong,{children:`+`}),` from the first line to the last, or click a line number and Shift-click another.`]}),`\n`,_jsx(_components.p,{children:`Pending comments appear as context in the composer. Choose the chat you want to send them to, add your message, and send.`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Address these review comments and explain how you verified the changes.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(_components.p,{children:`The saved prompt retains the comments and code they referred to. If the diff changes before you send, the comment keeps its original context instead of moving silently to another line.`}),`\n`,_jsx(Note,{children:_jsx(_components.p,{children:`Unsent comments are local drafts and disappear on reload. Send them when you want them recorded in the conversation.`})}),`\n`,_jsx(Heading,{level:`2`,id:`discard-changes`,children:`Discard changes`}),`\n`,_jsx(_components.p,{children:`The Git actions panel can discard a file or all working-tree changes. Read its confirmation: reverting an untracked file deletes it.`}),`\n`,_jsxs(_components.p,{children:[`Discarding the workspace diff differs from `,_jsx(_components.a,{href:`/turn-changes`,children:`Undo for one turn`}),`. It can remove changes from other turns or from your own edits.`]}),`\n`,_jsx(Heading,{level:`2`,id:`commit-and-pull-requests`,children:`Commit and pull requests`}),`\n`,_jsxs(_components.p,{children:[`Use `,_jsx(_components.a,{href:`/git-actions`,children:`Git actions`}),` after reviewing. Creating a PR needs a GitHub remote and authenticated GitHub CLI.`]}),`\n`,_jsxs(_components.p,{children:[`Review comments sent to your agent stay in the local conversation. To publish comments on a GitHub PR, use the separate `,_jsx(_components.a,{href:`/pull-requests`,children:`pull request view`}),`.`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Review changes","description":"Inspect uncommitted changes and send line or range comments to your agent","icon":"code-compare","href":"/diff-viewer"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Read the diff","slug":"read-the-diff","depth":2,"children":[]},{"title":"Comment on a line or range","slug":"comment-on-a-line-or-range","depth":2,"children":[]},{"title":"Discard changes","slug":"discard-changes","depth":2,"children":[]},{"title":"Commit and pull requests","slug":"commit-and-pull-requests","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"truelaurel","siteName":"Mains","title":"Review changes - Mains","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-11T23:54:06.938Z","originalFileLocation":"diff-viewer.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Inspect uncommitted changes and send line or range comments to your agent\">\u003cmeta data-mint-head name=\"application-name\" content=\"Mains\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/truelaurel/NVSVhGTCMe3yQpu6/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/truelaurel/NVSVhGTCMe3yQpu6/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/truelaurel/NVSVhGTCMe3yQpu6/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/truelaurel/NVSVhGTCMe3yQpu6/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/truelaurel/NVSVhGTCMe3yQpu6/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/truelaurel/NVSVhGTCMe3yQpu6/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/truelaurel/NVSVhGTCMe3yQpu6/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/truelaurel/NVSVhGTCMe3yQpu6/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/truelaurel/NVSVhGTCMe3yQpu6/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Review changes - Mains\">\u003cmeta data-mint-head property=\"og:description\" content=\"Inspect uncommitted changes and send line or range comments to your agent\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Mains\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.mains.dev/diff-viewer\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://truelaurel.mintlify.app/_mintlify/api/og/v2?division=Code+workflow\u0026amp;title=Review+changes\u0026amp;description=Inspect+uncommitted+changes+and+send+line+or+range+comments+to+your+agent\u0026amp;theme=bc054ea503af9c21eb79f93d\u0026amp;signature=5a3fd86c26cac1cdd33019507f23cfb844a811e1131e650cb683b1567161c4b2\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Review changes - Mains\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Inspect uncommitted changes and send line or range comments to your agent\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://truelaurel.mintlify.app/_mintlify/api/og/v2?division=Code+workflow\u0026amp;title=Review+changes\u0026amp;description=Inspect+uncommitted+changes+and+send+line+or+range+comments+to+your+agent\u0026amp;theme=bc054ea503af9c21eb79f93d\u0026amp;signature=5a3fd86c26cac1cdd33019507f23cfb844a811e1131e650cb683b1567161c4b2\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/truelaurel/NVSVhGTCMe3yQpu6/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Mains\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#878580\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.mains.dev/diff-viewer\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/diff-viewer.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.mains.dev/#organization\",\"name\":\"Mains\",\"url\":\"https://docs.mains.dev\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/truelaurel/5xCc2j6h7zMlnmQQ/images/docs.png?fit=max\u0026auto=format\u0026n=5xCc2j6h7zMlnmQQ\u0026q=85\u0026s=586a97bae16dc9d71532c86534535906\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.mains.dev#website\",\"name\":\"Mains\",\"url\":\"https://docs.mains.dev\",\"publisher\":{\"@id\":\"https://docs.mains.dev/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.mains.dev/diff-viewer#webpage\",\"url\":\"https://docs.mains.dev/diff-viewer\",\"name\":\"Review changes\",\"description\":\"Inspect uncommitted changes and send line or range comments to your agent\",\"dateModified\":\"2026-10-11T23:54:06.938Z\",\"isPartOf\":{\"@id\":\"https://docs.mains.dev#website\"},\"breadcrumb\":{\"@id\":\"https://docs.mains.dev/diff-viewer#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.mains.dev/diff-viewer#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Code workflow\",\"item\":\"https://docs.mains.dev/workflow\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Review changes\",\"item\":\"https://docs.mains.dev/diff-viewer\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.mains.dev/diff-viewer#article\",\"headline\":\"Review changes\",\"name\":\"Review changes\",\"description\":\"Inspect uncommitted changes and send line or range comments to your agent\",\"url\":\"https://docs.mains.dev/diff-viewer\",\"mainEntityOfPage\":{\"@id\":\"https://docs.mains.dev/diff-viewer#webpage\"},\"dateModified\":\"2026-10-11T23:54:06.938Z\",\"publisher\":{\"@id\":\"https://docs.mains.dev/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.mains.dev#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Mains\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Mains","nav":{"global":null,"tabs":[{"tab":"Guides","groups":[{"group":"Getting started","pages":[{"title":"Introduction","icon":"house","href":"/introduction"},{"title":"Install Mains","icon":"download","href":"/install"},{"title":"Quickstart","icon":"bolt","href":"/quickstart"}]},{"group":"Core concepts","pages":[{"title":"Spaces","icon":"layer-group","href":"/spaces"},{"title":"Code, Work, and Chat","icon":"sliders","href":"/modes"},{"title":"Projects","icon":"diagram-project","href":"/projects"},{"title":"Workspaces","icon":"folder-open","href":"/workspaces"},{"title":"Collections and sources","icon":"folder-open","href":"/collections"},{"title":"Runs and conversations","icon":"wave-pulse","href":"/runs"},{"title":"Multiple sessions","icon":"comments","href":"/multi-session"}]},{"group":"Atlas","pages":[{"title":"Atlas","icon":"book-open","href":"/atlas"},{"title":"Atlas Pages","icon":"file-lines","href":"/pages"},{"title":"Documents and deliverables","icon":"file","href":"/documents"}]},{"group":"Working with agents","pages":[{"title":"Context and attachments","icon":"paperclip","href":"/context-injection"},{"title":"Approvals and questions","icon":"hand","href":"/approvals"},{"title":"Voice conversations","icon":"microphone","href":"/voice"},{"title":"In-app browser","icon":"globe","href":"/browser"},{"title":"Lens","icon":"camera","href":"/lens"},{"title":"Search","icon":"magnifying-glass","href":"/search"}]},{"group":"Code workflow","pages":[{"title":"Code workflow","icon":"route","href":"/workflow"},{"title":"Files and editor","description":"Search your workspace, edit files, preview images, and attach code selections","icon":"folder-tree","href":"/file-explorer"},{"title":"Review changes","icon":"code-compare","href":"/diff-viewer"},{"title":"Turn changes and Undo","description":"Review what one turn changed and reverse it when the patch can be applied safely","icon":"rotate-left","href":"/turn-changes"},{"title":"Git actions","icon":"code-branch","href":"/git-actions"},{"title":"Linked tasks","icon":"link","href":"/linked-tasks"},{"title":"Tasks","icon":"list-check","href":"/tasks"},{"title":"Pull request review","icon":"code-pull-request","href":"/pull-requests"},{"title":"Agent code reviews","icon":"comment-dots","href":"/reviews"},{"title":"Terminal","icon":"terminal","href":"/terminal"}]},{"group":"Scheduling","pages":[{"title":"Pulse","icon":"clock","href":"/pulse"},{"title":"Connection auto sync","icon":"arrows-rotate","href":"/automations"}]},{"group":"Mains Connect","pages":[{"title":"Mains Connect","icon":"tower-broadcast","href":"/relay/overview"},{"title":"Share this machine","icon":"desktop","href":"/relay/share-this-machine"},{"title":"SSH tunnel","icon":"terminal","href":"/relay/ssh-tunnel"},{"title":"Direct connection","icon":"network-wired","href":"/relay/direct-connection"},{"title":"Mains Server","icon":"server","href":"/server"},{"title":"iPhone companion","icon":"mobile-screen","href":"/mobile"}]},{"group":"Bridge","pages":[{"title":"Bridge","icon":"arrows-rotate","href":"/bridge/overview"},{"title":"Get started with Bridge","icon":"right-to-bracket","href":"/bridge/get-started"},{"title":"Work across devices","icon":"laptop","href":"/bridge/work-across-devices"},{"title":"Bridge privacy and security","icon":"lock","href":"/bridge/security"}]},{"group":"Preferences","pages":[{"title":"Settings","icon":"gear","href":"/settings"},{"title":"Keyboard shortcuts","icon":"keyboard","href":"/keyboard-shortcuts"},{"title":"Usage dashboard","icon":"chart-column","href":"/stats"},{"title":"Privacy and data","icon":"shield","href":"/privacy"},{"title":"FAQ and troubleshooting","icon":"circle-question","href":"/faq"}]}]},{"tab":"Agents","pages":[{"title":"Agents","href":"/claude/configuration"}]},{"tab":"Integrations","pages":[{"title":"Integrations","href":"/connections"}]}]},"basePath":"","title":"Review changes - Mains","buildId":"dpl_9VVk5y1P8k1ATeJguVngy9Q3cmbD","deploymentId":"dpl_9VVk5y1P8k1ATeJguVngy9Q3cmbD","dynamics":[],"chunks":[]}