{"id":644,"date":"2026-08-13T22:39:22","date_gmt":"2026-08-13T19:39:22","guid":{"rendered":"https:\/\/ahaddad-wp.duckdns.org\/my\/mylogbook\/?post_type=doc_article&#038;p=644"},"modified":"2026-08-13T23:48:41","modified_gmt":"2026-08-13T20:48:41","slug":"claude-in-powershell-and-tmux","status":"publish","type":"doc_article","link":"https:\/\/ahaddad-wp.duckdns.org\/my\/mylogbook\/docs\/claude-in-powershell-and-tmux\/","title":{"rendered":"Claude in Powershell and tmux"},"content":{"rendered":"\n<ol class=\"wp-block-list\">\n<li>Open PowerShell (or WSL) and SSH in the same way as always:<br>ssh ahmad@100.111.255.36<\/li>\n\n\n\n<li>Once connected, resume this exact conversation:<br>claude &#8211;continue<\/li>\n\n\n\n<li>That picks up the most recent conversation automatically \u2014 including all the context from this whole session. If for some reason it doesn&#8217;t grab the right one, claude &#8211;resume (no argument) shows a picker of recent sessions to choose from.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">Worth mentioning for later, not right now: since this session isn&#8217;t in tmux, any future SSH hiccup (not just this lid test) would kill it the same way \u2014 running long Claude Code sessions inside tmux makes them survive disconnects entirely, so you could reconnect without even needing &#8211;continue. I won&#8217;t set that up mid-session since it&#8217;d mean restarting this one, but it&#8217;s worth doing next time you start a fresh session.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">tmux<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The concept: normally, when you SSH in and run a command, that command lives inside your SSH connection \u2014 close the connection, and the command dies with it. tmux creates a persistent &#8220;terminal session&#8221; that lives on the server itself, independent of any SSH connection. You can &#8220;detach&#8221; from it (leave it running, disconnect), then &#8220;reattach&#8221; later from anywhere \u2014 even a different device \u2014 and it&#8217;s exactly as you left it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Starting a fresh session (do this instead of just typing claude directly next time):<br>tmux new -s claude<br>-s claude names it &#8220;claude&#8221; so it&#8217;s easy to find later. You&#8217;re now inside a normal-looking terminal \u2014 run claude here as usual.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Detaching (leave it running, safe to close your laptop\/lose connection):<br>Press Ctrl+b, release, then press d. You&#8217;ll drop back to your regular shell, and the session keeps running in the background on the server.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Reattaching later (from any device, any time):<br>tmux attach -t claude<br>You&#8217;re back exactly where you left off \u2014 full scrollback, Claude Code mid-conversation, everything intact.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Other useful commands:<br>tmux ls # list all running sessions<br>tmux kill-session -t claude # end it permanently when you&#8217;re really done<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">That&#8217;s genuinely most of what you need day-to-day. The one habit to build: whenever you&#8217;re about to start something long-running (a Claude Code session, a big transfer), do it inside tmux new -s first, so a dropped connection never costs you the session.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Installing tmux<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">aThere wasn&#8217;t a separate &#8220;setup&#8221; step beyond what&#8217;s already true \u2014 tmux was already installed on the server (we added it earlier during the media transfer). The &#8220;setup&#8221; is really just the workflow itself. Here&#8217;s the clean version for your notes:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Check it&#8217;s installed (already is, on this server):<br>which tmux<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Start a new named session (do this instead of running claude directly):<br>tmux new -s claude<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Detach (leaves it running, safe to disconnect): press Ctrl+b, release, then d<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Reattach later (from any device, any time):<br>tmux attach -t claude<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">List running sessions:<br>tmux ls<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">End a session permanently:<br>tmux kill-session -t claude<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">That&#8217;s the complete setup \u2014 no config file, no service, nothing else to install. The one habit worth documenting: start any long-running SSH work (a Claude Code session, a big file transfer) inside tmux new -s first, so a dropped connection never costs you the session.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Worth mentioning for later, not right now: since this session isn&#8217;t in tmux, any future SSH hiccup (not just this lid test) would kill it the same way \u2014 running long Claude Code sessions inside tmux makes them survive disconnects entirely, so you could reconnect without even needing &#8211;continue. I won&#8217;t set that up mid-session [&hellip;]<\/p>\n","protected":false},"featured_media":646,"template":"","project_category":[123,152],"class_list":["post-644","doc_article","type-doc_article","status-publish","has-post-thumbnail","hentry","project_category-docs","project_category-guides"],"_links":{"self":[{"href":"https:\/\/ahaddad-wp.duckdns.org\/my\/mylogbook\/wp-json\/wp\/v2\/doc_article\/644","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ahaddad-wp.duckdns.org\/my\/mylogbook\/wp-json\/wp\/v2\/doc_article"}],"about":[{"href":"https:\/\/ahaddad-wp.duckdns.org\/my\/mylogbook\/wp-json\/wp\/v2\/types\/doc_article"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ahaddad-wp.duckdns.org\/my\/mylogbook\/wp-json\/wp\/v2\/media\/646"}],"wp:attachment":[{"href":"https:\/\/ahaddad-wp.duckdns.org\/my\/mylogbook\/wp-json\/wp\/v2\/media?parent=644"}],"wp:term":[{"taxonomy":"project_category","embeddable":true,"href":"https:\/\/ahaddad-wp.duckdns.org\/my\/mylogbook\/wp-json\/wp\/v2\/project_category?post=644"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}