bespex

Tutorial

Start and follow an AI session

Purpose: You start an AI session, tell from its card what it is doing right now, and answer it when it asks you something.

Now the actual round of work begins. In this chapter you start an AI session, give it a task and follow what it does in the Sessions column. When it asks you something, you answer it. Finally you get to know the prompts you can write down beforehand, which are then Ready to start.

What an AI session is

An AI session is a conversation with your coding agent in a particular project. You write in the session’s chat what you would like, and the AI then works in your project folder: it reads files, changes them and runs commands. The session runs in a terminal or in your coding agent’s desktop app, not in CodeDeck. CodeDeck shows you what it does and takes you to it with one click.

Several sessions can run in one project at the same time, for example one for a new feature and one for the documentation. In CodeDeck each one gets its own sign: a colour and a one-letter short name. It keeps this sign everywhere: in the sessions column, on the files it changed and on its snapshots in the Changes tab. You can learn more about sessions on the page AI sessions.

Starting a session

There are two ways to start a session. Both lead to the same result: the session appears in the sessions column as soon as it reports its first step.

The sessions column: at the top the name and folder of the project and the button "New session" with the account "Work", below it four AI sessions as cards, one is working, two are asking something, one is finished, plus a line "Starting…" with "may be asking", below that "Earlier" and "Ready to start", at the very bottom the usage of the accounts

In CodeDeck you start a session with the button New session at the top of the column. Next to the words is the account the session starts with. An account is a configuration of your coding agent, as you connected it in chapter 1, for example “Work” for your job and “Private” for your own projects. CodeDeck takes the account you chose last in this project. If its quota is almost used up, it suggests another connected account, and the tooltip on the button tells you so.

The small arrow to the right of the button opens the start field. There you choose the account, and with it the coding agent the session runs with. Below that you can write a first prompt right away or choose a prepared prompt. If you leave the field empty, the session waits for your prompt in the chat. With the check box Only reading you start a session that may read your project but not change any files. That is handy for questions, plans and reviews. Start session or the Enter key starts the session; in the text field you use Ctrl+Enter for that.

The open start field below "New session": at the top the accounts Work with 38 %, Private "not connected" and codex with 12 %, below them "Set up accounts…", the field "First prompt (optional)" with the choice "Prepared prompt…", the check box "Only reading" and the buttons "Cancel" and "Start session"

CodeDeck starts the session in tmux, a program that keeps terminal sessions running in the background. This has two advantages: the session keeps running even if you close CodeDeck or a terminal window, and you can open it in a terminal at any time. With Claude Code, CodeDeck also starts the session so that you can reach it from the desktop app, in the browser or from your phone.

Right after the click, the line Starting… appears in the list. It stays until the session reports its first step. When you start a new session in a folder where the coding agent has never worked before, it often first asks whether you trust the folder. Until that question is answered it does not report anything, which is why the line says may be asking. Open the session with the Terminal button then and answer the question. After that you can simply close the terminal window: the session keeps running in tmux, only the window looking at it is gone. If you prefer the keyboard, you leave tmux with Ctrl+B followed by D.

By hand you start a session as usual: you open a terminal in the project folder and start your coding agent there. This session also shows up in CodeDeck as soon as it takes its first step, provided your coding agent is connected to CodeDeck. Sessions that were already running before CodeDeck are found in the coding agent’s logs, and CodeDeck shows them under Earlier.

Now give your session a task, unless you already gave it a first prompt. To do this, write in the session’s chat, that is, in the terminal or in the desktop app, what the AI should do, for example “Add a section on installation to the README”.

Reading a session’s card

Each session is shown in the list as a card. The cards are in the order in which the sessions were started, and they keep their place. That way nothing jumps around when a session asks something or finishes.

At the top of the card are the sign and the title of the session and, on the right, its state. In the middle is what matters right now, and below it which account and which model the session runs with.

Three session cards side by side: on the left "working" with the current step "Edit tests/rate_limit.rs" and the button "Desktop", in the middle "asks" with the permission question, the command "Bash cargo test" and the button "Answer", on the right "finished" with the session's last words and the buttons "Turn" and "Second opinion"

These are the most important states:

  • working means that the session is working on your task right now. Below it is the step it is on, for example the file it is editing.
  • asks means that the session is waiting for an answer from you, and the time at the bottom right says since when. Its question is shown below. When it asks for permission for a command or a file, the command or file is shown right there, so you can decide without a detour.
  • finished means that the session has finished its turn and is waiting for your next instruction. Below it are its last words, usually a short summary of what it did.
  • idle means that the session is still running but has not done anything for a while.
  • ended means that the session’s program is no longer running. The conversation is not lost, though: you can continue it.

Sessions that are waiting for you, because they are asking or have a finished turn you have not looked at yet, are highlighted: their card is raised and has a coloured border. The number next to the heading “Sessions” counts them. A finished turn stays highlighted until you have looked at it or put it aside.

A click on the title renames the session. The small arrow after the title unfolds its details: which files the session wrote, how it runs, which folder it works in, its last step and what it was started with. Under Kind you see, for example, that it runs in tmux. A blue radio symbol shows that it is reachable from anywhere right now, that is, from another device or in the browser as well.

Sessions you are not busy with right now are collected by CodeDeck, folded, under Earlier at the end of the list. These include ended sessions, sessions CodeDeck only knows from the logs, and sessions that have been idle for hours. Tidy up next to it takes all sessions off the list that are proven to be no longer running. Nothing is deleted in the process: the conversation stays with your coding agent, and a session that reports again reappears by itself.

Answering and switching to the session

At the bottom right of every card is the button that takes you to the session. Which one it is depends on where the session runs and what is needed right now:

  • Answer appears when the session asks you something. It takes you to where the session runs: to the desktop app if it can be reached there, otherwise to the terminal.
  • Desktop opens the session in your coding agent’s desktop app if it can be reached there.
  • Terminal opens the session in a terminal window. If it runs in tmux, the new window joins its tmux session. If you started it yourself in a terminal, CodeDeck brings that window to the front. This only works under X11, though; under Wayland you switch to it yourself.

A click with the middle mouse button on the session’s sign always opens it in the terminal.

There is one limitation you should know about: with Claude Code, permission questions currently do not always arrive in the desktop app, but they always show in the terminal. So if the desktop app shows no question although CodeDeck reports asks, open the session in the terminal. There is more on this under When something doesn’t work.

When a turn is finished, the card also shows the button Turn. It opens the Changes tab in the deck with exactly what the session changed in this turn. That is what chapter 5 is about. Next to it is Second opinion, with which you have another AI check the work, as described in chapter 7. For an ended session the button says Continue: with it you continue its conversation in a new session in tmux.

When you point at a card with the mouse, small tools appear as symbols at its top edge. What each symbol does is told by its tooltip when you point at it.

A session card with its tools shown at the top right, below it the open menu "More" with "Rename", "Copy reference for the AI", "Copy how it was started" and "Remove from list"

Depending on the session, these are Open in the desktop app and Open in a terminal, as well as Restart and Stop for sessions that CodeDeck started. Stop only halts the program: the conversation is kept and can be continued. A session you started by hand, on the other hand, is ended where it runs. For a finished turn you will also find the check mark Seen, which puts the card aside until the next turn.

The last symbol, ⋯, opens the More menu. You open the same menu with a right click on the card. In it you can rename the session, copy how it was started, or remove a session that is no longer running from the list. Copy reference for the AI puts a short pointer to this session’s changes on the clipboard: its title and the files it wrote. If you paste it in the chat of another session, that session knows which work you mean and can look at it. There is more about references in the next chapter.

Changing a session’s sign

CodeDeck chooses the colour and short name of a session itself. If you would rather have different ones, right-click the sign on the left of the card. Then you choose a colour and type in a short name of your own. Reset restores the sign CodeDeck gave it.

A session's sign being changed: above the card a row of colours for the letter B, below it the field "Short name" with "B" and "Reset"

Preparing prompts

Often you already know what comes next while a session is still working. Then you write the prompt down now. For this, the area Ready to start sits at the bottom of the sessions column. Prepare a prompt opens a small editor. The Enter key makes a new line there, nothing is sent, and CodeDeck saves the text by itself. The prompts are kept as Markdown files in the folder .scratch/prompts/ of your project. An AI session can also put a prompt there for later. It then carries the session’s sign and the label new.

The area "Ready to start" with two prepared prompts as dashed cards, each with a title, the beginning of the text and the button "Start it" with the account "Work", below them "Prepare a prompt" and the usage of the accounts

With a prepared prompt you have two options:

  • Start it begins a new session with this prompt. The arrow next to it opens the start field, in which you choose the account and can still change the text.
  • Dragging it onto a session gives the prompt to a session that is already running. CodeDeck puts it on the clipboard and opens the session. There you paste it yourself, because CodeDeck never types anything into a session.

A prompt you started or passed on disappears from the list and stays under Earlier in the area, in case you need it again. While a session is asking you something, CodeDeck folds the area so that the question comes first.

When an account runs low

At the very bottom of the column is the usage of your accounts, that is, how much of your quota with the provider has already been used. A click on it opens the look back in the Activity tab; more on this in chapter 8.

When an account reaches 90 percent of its limit, the card of a session running with it offers the button Relieve. With it, a new session with another account takes over the work. It gets your prompts, the last words of the previous session and whatever isn’t committed yet as its task. As soon as the first account has room again, you hand the work back on the card of the relief session with Give back.

Try it out

Start a session in your project with New session. If the line shows may be asking, open the session with Terminal, answer the question and close the terminal window again. Give the session a small task in the chat and watch its state change from working to finished. If it asks for permission along the way, answer it via Answer. Then unfold the details of its card and look at which files it wrote. Finally, prepare the next task with Prepare a prompt and drag it onto the card.

More on this

  • AI sessions: all states, ways into a session, sessions in the background and remote access in detail.
  • Accounts and usage: using several accounts and keeping an eye on usage.
  • Notifications: how CodeDeck lets you know when a session is waiting for you.
  • Programs: tmux and the terminal program.