# 🧠 Close the laptop, keep the session — Claude Code lives in one LXC

**URL:** <https://onehack.st/t/close-the-laptop-keep-the-session-claude-code-lives-in-one-lxc/326483>\
**Category:** Tutorials & Methods\
**Tags:** learning, freebies, ai, self-hosted-tools\
**Created:** [October 15, 2026, 12:32pm UTC](https://onehack.st/t/close-the-laptop-keep-the-session-claude-code-lives-in-one-lxc/326483 "2026-10-15T12:32:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![BCBC](https://onehack.st/user_avatar/onehack.st/bcbc/32/174133_2.png) [@BCBC](https://onehack.st/u/BCBC)\
**Post date:** [October 15, 2026, 12:32pm UTC](https://onehack.st/t/close-the-laptop-keep-the-session-claude-code-lives-in-one-lxc/326483/1 "2026-10-15T12:32:57Z")

</div>

![Close the lid - the AI coding session keeps running on your own always-on box](https://onehack.st/uploads/default/original/3X/4/9/49283c0a61aa4b8635e70fb0aa3de77a99772aa3.jpeg)

### One box runs your AI coder. Your laptop is just a window into it.

digraph g { rankdir=TB; bgcolor="transparent"; nodesep=0.8; ranksep=0.6; node [shape=box style="rounded,filled" fillcolor="#ffffff" color="#0b1622" penwidth=2 margin="0.35,0.2" fontname="sans-serif" fontsize=14 fontcolor="#0b1622"]; edge [color="#2f7d52" penwidth=2 fontname="sans-serif" fontsize=12 fontcolor="#0b1622"]; laptop [label="💤 laptop - lid closed"]; host [label="🖥️ Proxmox VE host"]; lxc [label="📦 Debian 13 LXC"]; sess [label="♻️ tmux: forge"]; code [label="🧠 Claude Code"]; client [label="📱 any device"]; laptop -\> host [label="ssh"]; host -\> lxc; lxc -\> sess; sess -\> code; {rank=same; sess; client;} client -\> sess [style=dashed, label="attach", constraint=false]; }

- 💤 close the lid mid-thought **→** ♻ the session keeps running
- 🖥📱 desktop, laptop, phone on ssh **→** one live session
- 🚫 no Docker, no cloud account, no port-forwarding
- 🔌 your move **→** Proxmox Console, one pasted line, two minutes

✅ 8 checks passed · ⏳ 2 honest gaps - both lists inside the drawer

> **the whole build - 6 stages, every command, the trap that ate my first launch, and what I have not verified**
>
> **📦 ① prep the container** _(example id 260)_
> 
> ```auto
> pct exec 260 -- apt-get update
> pct exec 260 -- apt-get install -y tmux curl git ca-certificates
> 
> ```
> 
> → Node.js, Claude Code and the FCC wrapper need their own installers · the `/opt/fcc-…` path below is mine, not a default
> 
> **👤 ② its own user, and proof Claude Code runs**
> 
> ```auto
> pct exec 260 -- useradd -m -s /bin/bash claude # skip if it exists
> pct exec 260 -- /usr/local/bin/claude --version
> 
> ```
> 
> → this user owns the project, never root · a printed version = pass, a missing binary or permission error = fail · then log Claude Code in
> 
> **♻ ③ the session that survives disconnects** — tmux
> 
> ```auto
> pct exec 260 -- runuser -u claude -- tmux new-session -d -s forge -c /var/www/claude-site /bin/bash
> pct exec 260 -- runuser -u claude -- tmux list-sessions # → forge: 1 windows
> ssh -tt root@YOUR-PROXMOX-HOST 'pct exec 260 -- runuser -u claude -- tmux attach-session -t forge'
> printf 'TMUX=%s\n' "${TMUX:-NOT_ATTACHED}" # → a session id, or NOT_ATTACHED = you are outside tmux
> 
> ```
> 
> → leave it alive: `Ctrl+B` then `D` · never `/exit` inside Claude Code · re-check `list-sessions` after disconnecting · it beats a disconnect, not a reboot
> 
> **⚠ ④ the PATH trap, and the wrapper**
> 
> ```auto
> export PATH="/usr/local/bin:/opt/fcc-6.16.2/bin:$PATH"
> /opt/fcc-6.16.2/bin/fcc-claude
> 
> ```
> 
> → first try: `Could not find Claude Code command: claude`
> 
> ```auto
> printf 'PATH=%s\n' "$PATH" → PATH=/sbin:/bin:/usr/sbin:/usr/bin
> ls -l /usr/local/bin/claude → /usr/local/bin/claude -> /usr/local/lib/node_modules/@anthropic-ai/claude-code/bin/claude.exe
> 
> ```
> 
> → nothing was missing · `/usr/local/bin` was not on PATH · add it, retry, it opens · real output: `Claude Code v2.1.296 · Opus 5.5 · API Usage Billing · /var/www/claude-site` · check PATH before reinstalling anything
> 
> **🖥 ⑤ no workstation needed**
> 
> ```auto
> pct enter 260
> su - claude
> tmux attach-session -t forge
> 
> ```
> 
> → or a second Claude Code in another project directory · never edit one project from two sessions without a Git worktree or another isolation scheme
> 
> **🧱 how the pieces sit** _(his sketch, from the original)_
> 
> ```auto
> Linux workstation
> |
> | SSH
> |
> Proxmox VE host
> |
> +--- Debian 13 LXC
> |
> +--- Dedicated Linux user
> |
> +--- Project directory
> |
> +--- Claude Code
> |
> +--- FCC wrapper
> |
> +--- tmux
> |
> +--- Persistent session
> 
> ```
> 
> → his own one-line goal: _disconnect the client without intentionally terminating the interactive AI coding session_
> 
> **✅ verified** · Proxmox→LXC exec · SSH from a Linux workstation · tmux installed · dedicated account · `claude --version` · FCC wrapper launch · interactive Claude Code in tmux · project dir reachable
> 
> **⏳ not yet** · reconnect after client shutdown · LXC reboot recovery · Proxmox reboot recovery · all MCP integrations and auth paths
> 
> **🧠 ⑥ what this taught me**  
> → a clean install is not proof of a working environment  
> → a running background process is not proof the session is still reachable  
> → a missing command is not missing software  
> → tmux is not a backup - keep the project files backed up, credentials private  
> → install once · connect from authorized clients · detach safely · verify the running session

---

<div class="post-metadata">

**Author:** ![Suraj\_Pathak](https://onehack.st/user_avatar/onehack.st/suraj_pathak/32/177873_2.png) [@Suraj\_Pathak](https://onehack.st/u/Suraj_Pathak)\
**Post date:** [October 15, 2026, 6:26pm UTC](https://onehack.st/t/close-the-laptop-keep-the-session-claude-code-lives-in-one-lxc/326483/2 "2026-10-15T18:26:50Z")

</div>

This, my friend, is one of those things that people need but never create. This is gonna be a LIFESAVER.
