[{"data":1,"prerenderedAt":196},["ShallowReactive",2],{"docs-\u002Fdocs\u002Fbasics\u002Fsessions-and-modes":3},{"id":4,"title":5,"body":6,"description":189,"extension":190,"meta":191,"navigation":57,"path":192,"seo":193,"stem":194,"__hash__":195},"docs\u002Fdocs\u002Fbasics\u002Fsessions-and-modes.md","Sessions & Modes",{"type":7,"value":8,"toc":183},"minimark",[9,13,18,27,74,77,81,84,135,140,153,164,174,179],[10,11,5],"h1",{"id":12},"sessions-modes",[14,15,17],"h2",{"id":16},"start-a-session","Start a session",[19,20,21,22,26],"p",{},"Run ",[23,24,25],"code",{},"ai"," inside a repository to start an interactive chat session:",[28,29,34],"pre",{"className":30,"code":31,"language":32,"meta":33,"style":33},"language-bash shiki shiki-themes github-dark","# start an interactive session in the current repo\nai\n\n# start with your first request already typed\nai \"add validation to the signup handler\"\n","bash","",[23,35,36,45,52,59,65],{"__ignoreMap":33},[37,38,41],"span",{"class":39,"line":40},"line",1,[37,42,44],{"class":43},"sAwPA","# start an interactive session in the current repo\n",[37,46,48],{"class":39,"line":47},2,[37,49,51],{"class":50},"svObZ","ai\n",[37,53,55],{"class":39,"line":54},3,[37,56,58],{"emptyLinePlaceholder":57},true,"\n",[37,60,62],{"class":39,"line":61},4,[37,63,64],{"class":43},"# start with your first request already typed\n",[37,66,68,70],{"class":39,"line":67},5,[37,69,25],{"class":50},[37,71,73],{"class":72},"sU2Wk"," \"add validation to the signup handler\"\n",[19,75,76],{},"The agent works against the repo in your current directory and keeps the full\nconversation in the live session as you go.",[14,78,80],{"id":79},"modes","Modes",[19,82,83],{},"A session runs in one of three modes. The mode controls how the agent asks for\napproval and which tools it can use.",[85,86,87,100],"table",{},[88,89,90],"thead",{},[91,92,93,97],"tr",{},[94,95,96],"th",{},"Mode",[94,98,99],{},"Behavior",[101,102,103,115,125],"tbody",{},[91,104,105,112],{},[106,107,108],"td",{},[109,110,111],"strong",{},"Default",[106,113,114],{},"Asks before running shell commands and applying file edits.",[91,116,117,122],{},[106,118,119],{},[109,120,121],{},"Auto-Accept",[106,123,124],{},"Approves shell commands and file edits for the session.",[91,126,127,132],{},[106,128,129],{},[109,130,131],{},"Plan",[106,133,134],{},"Read-only. The agent can inspect, ask typed questions, and plan, with file-reading shell commands only. It will not edit files or run tests, builds, diagnostics, package managers, project code, or network probes.",[136,137,139],"h3",{"id":138},"start-in-auto-accept-mode","Start in Auto-Accept mode",[28,141,143],{"className":30,"code":142,"language":32,"meta":33,"style":33},"ai -y\n",[23,144,145],{"__ignoreMap":33},[37,146,147,149],{"class":39,"line":40},[37,148,25],{"class":50},[37,150,152],{"class":151},"sDLfK"," -y\n",[19,154,155,156,159,160,163],{},"The ",[23,157,158],{},"-y"," \u002F ",[23,161,162],{},"--yes"," flag starts the session in Auto-Accept mode, approving every\nshell command and file edit for the whole session.",[165,166,167],"tip",{},[19,168,169,170,173],{},"Inside the session, press ",[109,171,172],{},"Shift+Tab"," to cycle between Default, Auto-Accept,\nand Plan mode at any time. Mode is session-local and resumes in Default mode.",[165,175,176],{},[19,177,178],{},"Use Plan mode when you want the agent to investigate and propose an approach\nwithout touching anything. Switch to Default or Auto-Accept when you're ready\nto let it make changes.",[180,181,182],"style",{},"html pre.shiki code .sAwPA, html code.shiki .sAwPA{--shiki-default:#6A737D}html pre.shiki code .svObZ, html code.shiki .svObZ{--shiki-default:#B392F0}html pre.shiki code .sU2Wk, html code.shiki .sU2Wk{--shiki-default:#9ECBFF}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html pre.shiki code .sDLfK, html code.shiki .sDLfK{--shiki-default:#79B8FF}",{"title":33,"searchDepth":47,"depth":47,"links":184},[185,186],{"id":16,"depth":47,"text":17},{"id":79,"depth":47,"text":80,"children":187},[188],{"id":138,"depth":54,"text":139},"Start an interactive session and choose between Default, Auto-Accept, and Plan mode.","md",{},"\u002Fdocs\u002Fbasics\u002Fsessions-and-modes",{"title":5,"description":189},"docs\u002Fbasics\u002Fsessions-and-modes","uobF3CQk8yQJqWj5ncbRlAObIXxnEgQSNSU3TMvJZig",1781261134721]