What each exit code means, and which stream carries machine output.
Code
Meaning
0
The command finished. A query that finds no threads or no work still succeeds.
1
A runtime failure: a provider error, a missing repository, an unreadable store, or a failed turn.
2
A usage error: an unknown flag, a missing argument, or a missing exec prompt.
130
Interrupted. A cancelled orchestration exits 130. A process killed by SIGINT reports signal 2, which shells show as 130.
Machine output stays on stdout and progress stays on stderr, so a pipeline can parse --json without filtering log lines.The TUI does not use exit codes for turns. Ctrl+C interrupts a turn, and a second idle Ctrl+C exits.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Baton","description":"Run coding agents from one terminal.","colors":{"primary":"#B45309","light":"#FEF3C7","dark":"#92400E"},"appearance":{"default":"light","strict":true},"navbar":{"links":[{"href":"https://github.com/billy-enrizky/baton","label":"GitHub"},{"href":"/start/install","label":"Install"}]},"footer":{"socials":{"github":"https://github.com/billy-enrizky/baton"}},"fonts":{"family":"Geist"},"icons":{"library":"fontawesome"},"integrations":{"telemetry":{"enabled":false}},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"hasAudioNarration":false,"customDomains":[],"gitSource":{"type":"github","owner":"local","repo":"local","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":"local","isBase":true},"buildId":"local","clientVersion":"0.0.4338"},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[],"googleFontsInlined":true,"isLoggedInCli":false,"mintExport":{}},"customCss":[]}
{"page":{"pagePath":"reference/exit-codes","slug":"/reference/exit-codes","pageMetadata":{"title":"Exit codes","description":"What each exit code means, and which stream carries machine output.","icon":"arrow-right-from-bracket","href":"/reference/exit-codes"},"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: \"What each exit code means, and which stream carries machine output.\"\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={code:`code`,p:`p`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,..._provideComponents(),...props.components},{Table}=_components;if(!Table)_missingMdxReference(`Table`,true);return _jsxs(_Fragment,{children:[_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Code`}),_jsx(_components.th,{children:`Meaning`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`0`})}),_jsx(_components.td,{children:`The command finished. A query that finds no threads or no work still succeeds.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`1`})}),_jsx(_components.td,{children:`A runtime failure: a provider error, a missing repository, an unreadable store, or a failed turn.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`2`})}),_jsxs(_components.td,{children:[`A usage error: an unknown flag, a missing argument, or a missing `,_jsx(_components.code,{children:`exec`}),` prompt.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`130`})}),_jsx(_components.td,{children:`Interrupted. A cancelled orchestration exits 130. A process killed by SIGINT reports signal 2, which shells show as 130.`})]})]})]}),`\n`,_jsxs(_components.p,{children:[`Machine output stays on stdout and progress stays on stderr, so a pipeline can parse `,_jsx(_components.code,{children:`--json`}),` without filtering log lines.`]}),`\n`,_jsx(_components.p,{children:`The TUI does not use exit codes for turns. Ctrl+C interrupts a turn, and a second idle Ctrl+C exits.`})]})}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":"Exit codes","description":"What each exit code means, and which stream carries machine output.","icon":"arrow-right-from-bracket","href":"/reference/exit-codes"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"subdomain":"localhost","siteName":"Baton","title":"Exit codes - Baton","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"originalFileLocation":"reference/exit-codes.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=\"light\";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=\"light\"}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=\"What each exit code means, and which stream carries machine output.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Baton\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"https://mintlify.s3.us-west-1.amazonaws.com/local/_generated/favicon/apple-touch-icon.png?v=3\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"https://mintlify.s3.us-west-1.amazonaws.com/local/_generated/favicon/favicon-32x32.png?v=3\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"https://mintlify.s3.us-west-1.amazonaws.com/local/_generated/favicon/favicon-16x16.png?v=3\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"https://mintlify.s3.us-west-1.amazonaws.com/local/_generated/favicon/favicon.ico?v=3\">\u003cmeta data-mint-head property=\"og:title\" content=\"Exit codes - Baton\">\u003cmeta data-mint-head property=\"og:description\" content=\"What each exit code means, and which stream carries machine output.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Baton\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://local./docs/reference/exit-codes\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Exit codes - Baton\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"What each exit code means, and which stream carries machine output.\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"https://mintlify.s3.us-west-1.amazonaws.com/local/_generated/favicon/browserconfig.xml?v=3\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Baton\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#B45309\">\u003clink data-mint-head rel=\"canonical\" href=\"https://local./docs/reference/exit-codes\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/docs/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/docs/reference/exit-codes.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Baton\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Baton\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/docs/reference/exit-codes.md","siteName":"Baton","nav":{"tabs":[{"tab":"Docs","groups":[{"group":"Start here","pages":[{"title":"What is Baton?","icon":"terminal","href":""},{"title":"Install Baton","icon":"download","href":"/start/install"},{"title":"Quickstart","icon":"rocket","href":"/start/quickstart"},{"title":"Your first session","icon":"play","href":"/start/first-session"}]},{"group":"Concepts","pages":[{"title":"Harnesses","icon":"plug","href":"/concepts/harness"},{"title":"Threads and turns","icon":"comments","href":"/concepts/threads-and-turns"},{"title":"Modes","icon":"split","href":"/concepts/modes"},{"title":"Roles and orchestration","icon":"users","href":"/concepts/roles-and-orchestration"},{"title":"Worktrees and checkpoints","icon":"code-branch","href":"/concepts/worktrees-and-checkpoints"}]},{"group":"Guides","pages":[{"title":"Harnesses and auth","icon":"key","href":"/guides/harnesses-and-auth"},{"title":"Context and memory","icon":"brain","href":"/guides/context-and-memory"},{"title":"Review a change","icon":"magnifying-glass","href":"/guides/review-a-change"},{"title":"Ship from the terminal","icon":"code-branch","href":"/guides/ship-from-the-terminal"},{"title":"Recover work","icon":"rotate-left","href":"/guides/recover-work"}]},{"group":"Reference","pages":[{"title":"Slash commands","icon":"command","href":"/reference/slash-commands"},{"title":"CLI","icon":"terminal","href":"/reference/cli"},{"title":"Configuration","icon":"gear","href":"/reference/configuration"},{"title":"Keyboard","description":"Send, steer, interrupt, select, and scroll without leaving the composer.","icon":"keyboard","href":"/reference/keyboard"},{"title":"Exit codes","icon":"arrow-right-from-bracket","href":"/reference/exit-codes"}]},{"group":"Help","pages":[{"title":"Troubleshooting","description":"Fix the common failures: no harness, no key, a stale turn, a refused restart.","icon":"wrench","href":"/help/troubleshooting"},{"title":"Data and privacy","icon":"shield","href":"/help/data-and-privacy"}]}]}]},"basePath":"/docs","title":"Exit codes - Baton","buildId":"815f1a3055e5","dynamics":[],"chunks":[]}