Claude Code With Zellij: Organize Persistent Terminal Sessions
Zellij keeps terminal panes alive after a disconnect. Here is what that means for Claude Code sessions, what actually persists, and how to record task state that survives beyond the terminal.
Updated 5 min read
Zellij is a terminal multiplexer that keeps named panes and layouts alive after you disconnect from a session. Pairing it with Claude Code means you can reconnect to a running process rather than starting a new terminal from scratch. Tools like fenbs record the task state that a terminal session alone cannot carry across session boundaries or hand to the next developer.
The key is understanding the difference between terminal persistence and Claude session context — they are not the same thing.
What Zellij does for your terminal
Zellij runs a persistent server in the background. When you disconnect — close a laptop, lose an SSH connection, or quit the terminal app — the session keeps running on that server. Reconnect later and the panes, their contents and any running processes are still there.
You can name sessions, save and load layouts, and split the screen into separate panes for different tools. For long-running tasks such as a test suite, a build or a large file operation, this prevents losing the output on a disconnect.
Zellij's documentation at zellij.dev (opens in a new tab) covers installation, layout files and session management in detail.
What survives a terminal disconnect
With Zellij running, a terminal disconnect leaves the Claude Code process alive. If Claude was reading files or running a shell command when the network dropped, the work continues on the server. Reconnect and the pane shows what happened while you were away.
This is most useful for tasks that take time: indexing a large codebase, running a long test suite, or making sequential edits on a slow remote connection. You can leave the task running and come back to it.
For managing parallel Claude Code tasks across branches, Claude Code worktrees and Claude Code checkpoints cover those patterns.
What does not persist when a Claude session ends
Zellij keeps the terminal process alive, but it does not save the context window of a Claude conversation. When Claude Code's session ends — whether you type /exit, the process stops, or a model connection error interrupts it — the conversation history is gone completely.
This distinction matters: the terminal is not the session.
The next Claude Code session starts fresh. It can re-read files, but it does not remember what was agreed, what was already tested, or where the last session stopped. This is the gap that Zellij cannot fill.
A developer switching to a different machine faces the same problem even if Zellij kept the pane alive on the original host. Someone else joining the work starts from zero.
Record what the terminal cannot remember
Before a Claude Code session ends, ask it to save progress in fenbs: what was completed, what was tested, and where to start next. The next session — on any machine, with any Claude model — reads that record and continues from where the last one stopped. Zellij keeps the process running; fenbs keeps the task alive.
Create a free accountFree for one person · No credit card · Works with Claude, ChatGPT, Cursor and more
How to name and organize sessions in Zellij
Give each Zellij session a name that matches the task or branch you are working on. A session called checkout-refactor is easier to find later than session-3. Use one pane for Claude Code and a second for running tests or inspecting files, so each pane has a clear, single role.
You can save a layout file that opens Claude Code in one pane and a shell in another. Load the layout at the start of a new task rather than setting up panes by hand each time. This reduces the steps before the first useful output.
Keep session names short and meaningful. Long names are harder to type when reconnecting over an interrupted connection. A rough match between the Zellij session name and the task reference in fenbs makes it easier to tell at a glance which terminal relates to which piece of work.
How to do this with fenbs
- Create a free account and add the project you are working on.
- Add a task for the current piece of work. Note the branch, the goal and any decisions already made.
- Connect Claude Code from Integrations. Ask it to read the project and task context before it starts work.
- Open a Zellij session named after the task. Run Claude Code in one pane and keep a shell in another.
- Before the Claude session ends, ask it to save Where we left off in fenbs: what was done, the next step, and anything waiting on a person.
If you reconnect to the Zellij session and Claude Code is still running, continue from where it stopped. If a new Claude session is needed, the fenbs record is the handoff. For more on Claude Code's setup, see what Claude Code is and how to install it.
The value of combining both tools
Zellij and fenbs solve different problems. Zellij keeps the process alive across network events. fenbs keeps the work alive across session boundaries, tool changes and people changes. Using both means fewer interruptions from connection drops and fewer wasted minutes re-explaining the task to the next session.
The combination also helps when you share a task with a colleague. They can reconnect to the Zellij session if the work is still running, or read the fenbs task record if a new session is needed. Either way, the context is available without asking you to summarize it again. A terminal that stays alive and a task record that stays current together cover the two main ways that useful context gets lost between working sessions.