[{"data":1,"prerenderedAt":554},["ShallowReactive",2],{"navigation":3,"/reference/sessions":94,"/reference/sessions-surround":549},[4,22,39,68,81],{"title":5,"path":6,"stem":7,"children":8,"page":21},"Getting Started","/getting-started","1.getting-started",[9,13,17],{"title":10,"path":11,"stem":12},"Introduction","/getting-started/introduction","1.getting-started/1.introduction",{"title":14,"path":15,"stem":16},"Installation","/getting-started/installation","1.getting-started/2.installation",{"title":18,"path":19,"stem":20},"Workspace","/getting-started/workspace","1.getting-started/3.workspace",false,{"title":23,"path":24,"stem":25,"children":26,"page":21},"Configuration","/configuration","2.configuration",[27,31,35],{"title":28,"path":29,"stem":30},"Overview","/configuration/overview","2.configuration/1.overview",{"title":32,"path":33,"stem":34},"AI Providers","/configuration/ai-providers","2.configuration/2.ai-providers",{"title":36,"path":37,"stem":38},"Configuration Reference","/configuration/reference","2.configuration/3.reference",{"title":40,"path":41,"stem":42,"children":43,"page":21},"Features","/features","3.features",[44,48,52,56,60,64],{"title":45,"path":46,"stem":47},"Telegram","/features/telegram","3.features/1.telegram",{"title":49,"path":50,"stem":51},"Tools","/features/tools","3.features/2.tools",{"title":53,"path":54,"stem":55},"Scheduling","/features/scheduling","3.features/3.scheduling",{"title":57,"path":58,"stem":59},"Heartbeat","/features/heartbeat","3.features/4.heartbeat",{"title":61,"path":62,"stem":63},"Memory","/features/memory","3.features/5.memory",{"title":65,"path":66,"stem":67},"Skills","/features/skills","3.features/6.skills",{"title":69,"path":70,"stem":71,"children":72,"page":21},"Cli","/cli","4.cli",[73,77],{"title":74,"path":75,"stem":76},"CLI Commands","/cli/commands","4.cli/1.commands",{"title":78,"path":79,"stem":80},"Running as a Service","/cli/service-management","4.cli/2.service-management",{"title":82,"path":83,"stem":84,"children":85,"page":21},"Reference","/reference","5.reference",[86,90],{"title":87,"path":88,"stem":89},"Sessions","/reference/sessions","5.reference/1.sessions",{"title":91,"path":92,"stem":93},"Troubleshooting","/reference/troubleshooting","5.reference/3.troubleshooting",{"id":95,"title":87,"body":96,"description":542,"extension":543,"links":544,"meta":545,"navigation":546,"path":88,"seo":547,"stem":89,"__hash__":548},"docs/5.reference/1.sessions.md",{"type":97,"value":98,"toc":528},"minimark",[99,103,107,112,115,143,146,150,157,180,183,187,190,195,198,202,213,286,290,293,299,306,312,323,327,330,333,424,427,431,524],[100,101,87],"h1",{"id":102},"sessions",[104,105,106],"p",{},"A session is a conversation context. Each session has its own message history, working memory, and title. The agent maintains separate sessions for different chats, so conversations don't mix.",[108,109,111],"h2",{"id":110},"session-identity","Session identity",[104,113,114],{},"Each session is identified by a combination of:",[116,117,118,131,137],"ul",{},[119,120,121,125,126,130],"li",{},[122,123,124],"strong",{},"Platform"," -- always ",[127,128,129],"code",{},"telegram"," for now",[119,132,133,136],{},[122,134,135],{},"Chat ID"," -- the Telegram chat (DM, group, etc.)",[119,138,139,142],{},[122,140,141],{},"Thread ID"," -- the topic/thread within a forum-style group (if applicable)",[104,144,145],{},"This means each Telegram chat gets its own session automatically. In forum groups with topics, each topic gets its own session.",[108,147,149],{"id":148},"main-session","Main session",[104,151,152,153,156],{},"The first chat you message the bot from becomes the ",[122,154,155],{},"main session",". It's special in a few ways:",[116,158,159,170,173],{},[119,160,161,162,165,166,169],{},"Messaging tools (",[127,163,164],{},"send_message",", ",[127,167,168],{},"list_known_chats",") are only available here",[119,171,172],{},"Long-term memory extraction only runs after main session conversations",[119,174,175,176,179],{},"The agent reads ",[127,177,178],{},"MEMORY.md"," at the start of main sessions",[104,181,182],{},"This keeps personal context isolated from other chats.",[108,184,186],{"id":185},"reply-chain-mode","Reply chain mode",[104,188,189],{},"BabyClaw supports two modes for session scoping:",[191,192,194],"h3",{"id":193},"default-mode","Default mode",[104,196,197],{},"Sessions are scoped by chat (and thread, if in a forum group). All messages in a chat share the same session.",[191,199,201],{"id":200},"reply-chain-mode-1","Reply-chain mode",[104,203,204,205,208,209,212],{},"When ",[127,206,207],{},"session.replyChainMode"," is ",[127,210,211],{},"\"reply-chain\"",", replying to a specific bot message continues that session's context. This is useful in groups where you might have multiple unrelated conversations.",[214,215,220],"pre",{"className":216,"code":217,"language":218,"meta":219,"style":219},"language-json shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","{\n  \"session\": {\n    \"replyChainMode\": \"reply-chain\"\n  }\n}\n","json","",[127,221,222,231,250,274,280],{"__ignoreMap":219},[223,224,227],"span",{"class":225,"line":226},"line",1,[223,228,230],{"class":229},"sMK4o","{\n",[223,232,234,237,241,244,247],{"class":225,"line":233},2,[223,235,236],{"class":229},"  \"",[223,238,240],{"class":239},"spNyl","session",[223,242,243],{"class":229},"\"",[223,245,246],{"class":229},":",[223,248,249],{"class":229}," {\n",[223,251,253,256,260,262,264,267,271],{"class":225,"line":252},3,[223,254,255],{"class":229},"    \"",[223,257,259],{"class":258},"sBMFI","replyChainMode",[223,261,243],{"class":229},[223,263,246],{"class":229},[223,265,266],{"class":229}," \"",[223,268,270],{"class":269},"sfazB","reply-chain",[223,272,273],{"class":229},"\"\n",[223,275,277],{"class":225,"line":276},4,[223,278,279],{"class":229},"  }\n",[223,281,283],{"class":225,"line":282},5,[223,284,285],{"class":229},"}\n",[108,287,289],{"id":288},"message-history","Message history",[104,291,292],{},"Two settings control how much history the agent works with:",[191,294,296],{"id":295},"sessionhistorylimit",[127,297,298],{},"session.historyLimit",[104,300,301,302,305],{},"How many recent messages are included in the agent's context for each turn. Default is ",[127,303,304],{},"40",". Lower values mean less context but fewer tokens per turn.",[191,307,309],{"id":308},"sessionmaxmessagespersession",[127,310,311],{},"session.maxMessagesPerSession",[104,313,314,315,318,319,322],{},"The maximum number of messages stored in a session before old ones are pruned. Default is ",[127,316,317],{},"120",". This is the total stored -- the agent only sees the most recent ",[127,320,321],{},"historyLimit"," messages.",[108,324,326],{"id":325},"title-generation","Title generation",[104,328,329],{},"BabyClaw auto-generates a title for new sessions based on the first message. This helps identify sessions in logs and status output.",[104,331,332],{},"You can customize the model and prompt used for title generation:",[214,334,336],{"className":216,"code":335,"language":218,"meta":219,"style":219},"{\n  \"session\": {\n    \"titleGeneration\": {\n      \"model\": \"anthropic:claude-haiku-3\",\n      \"prompt\": \"Generate a short title for this conversation\"\n    }\n  }\n}\n",[127,337,338,342,354,367,390,408,414,419],{"__ignoreMap":219},[223,339,340],{"class":225,"line":226},[223,341,230],{"class":229},[223,343,344,346,348,350,352],{"class":225,"line":233},[223,345,236],{"class":229},[223,347,240],{"class":239},[223,349,243],{"class":229},[223,351,246],{"class":229},[223,353,249],{"class":229},[223,355,356,358,361,363,365],{"class":225,"line":252},[223,357,255],{"class":229},[223,359,360],{"class":258},"titleGeneration",[223,362,243],{"class":229},[223,364,246],{"class":229},[223,366,249],{"class":229},[223,368,369,372,376,378,380,382,385,387],{"class":225,"line":276},[223,370,371],{"class":229},"      \"",[223,373,375],{"class":374},"sbssI","model",[223,377,243],{"class":229},[223,379,246],{"class":229},[223,381,266],{"class":229},[223,383,384],{"class":269},"anthropic:claude-haiku-3",[223,386,243],{"class":229},[223,388,389],{"class":229},",\n",[223,391,392,394,397,399,401,403,406],{"class":225,"line":282},[223,393,371],{"class":229},[223,395,396],{"class":374},"prompt",[223,398,243],{"class":229},[223,400,246],{"class":229},[223,402,266],{"class":229},[223,404,405],{"class":269},"Generate a short title for this conversation",[223,407,273],{"class":229},[223,409,411],{"class":225,"line":410},6,[223,412,413],{"class":229},"    }\n",[223,415,417],{"class":225,"line":416},7,[223,418,279],{"class":229},[223,420,422],{"class":225,"line":421},8,[223,423,285],{"class":229},[104,425,426],{},"Both fields are optional. If not set, the chat model and a default prompt are used.",[108,428,430],{"id":429},"session-configuration","Session configuration",[432,433,434,450],"table",{},[435,436,437],"thead",{},[438,439,440,444,447],"tr",{},[441,442,443],"th",{},"Field",[441,445,446],{},"Default",[441,448,449],{},"Description",[451,452,453,467,480,498,511],"tbody",{},[438,454,455,460,464],{},[456,457,458],"td",{},[127,459,311],{},[456,461,462],{},[127,463,317],{},[456,465,466],{},"Max messages stored per session",[438,468,469,473,477],{},[456,470,471],{},[127,472,298],{},[456,474,475],{},[127,476,304],{},[456,478,479],{},"Messages included in agent context",[438,481,482,486,491],{},[456,483,484],{},[127,485,207],{},[456,487,488],{},[127,489,490],{},"\"default\"",[456,492,493,495,496],{},[127,494,490],{}," or ",[127,497,211],{},[438,499,500,505,508],{},[456,501,502],{},[127,503,504],{},"session.titleGeneration.model",[456,506,507],{},"(chat model)",[456,509,510],{},"Model for title generation",[438,512,513,518,521],{},[456,514,515],{},[127,516,517],{},"session.titleGeneration.prompt",[456,519,520],{},"(default)",[456,522,523],{},"Prompt for title generation",[525,526,527],"style",{},"html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}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 .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}",{"title":219,"searchDepth":226,"depth":233,"links":529},[530,531,532,536,540,541],{"id":110,"depth":233,"text":111},{"id":148,"depth":233,"text":149},{"id":185,"depth":233,"text":186,"children":533},[534,535],{"id":193,"depth":252,"text":194},{"id":200,"depth":252,"text":201},{"id":288,"depth":233,"text":289,"children":537},[538,539],{"id":295,"depth":252,"text":298},{"id":308,"depth":252,"text":311},{"id":325,"depth":233,"text":326},{"id":429,"depth":233,"text":430},"How sessions work -- identity, history, reply chains, and configuration.","md",null,{},true,{"title":87,"description":542},"2g3XAoO01b2ZlHjOkks1Fuyc-AFXqrX2KKQhMSTR_vw",[550,552],{"title":78,"path":79,"stem":80,"description":551,"children":-1},"Install BabyClaw as a system service for always-on operation.",{"title":91,"path":92,"stem":93,"description":553,"children":-1},"Common issues and how to fix them.",1771846894211]