You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Start and get back to named sessions from a terminal: codeman tui <name> and --new#833
I run Codeman on each of my machines and drive it from my phone, but a lot of my work starts in a
terminal: I ssh into a box, cd into a project, and want an agent there. Later, from another
SSH login or another folder, I want to get back into that session. Before Codeman I did this with
plain tmux and a tiny wrapper: sess docs in a project folder started a session named docs
there; sess docs from anywhere later attached to it.
With Codeman I'd like the same, so the session also shows up on the phone with approvals and push.
What Codeman has today
codeman tui is great for the terminal side: the list, F1 to leave, Alt+1..9 to switch.
codeman tui <n> attaches by list number, but the number moves as sessions change state, so it
is not something to remember or put in a script.
codeman tui → n starts a session from an existing case, named w<N>-<case>.
codeman agent spawn -n <name> starts in the current folder with a name, but it is (rightly)
locked to agents running inside a Codeman session (CODEMAN_MUX=1).
So from a plain SSH shell there's no way to say "start a session named docs here", and no stable
way to say "take me back to docs".
Proposal
Two small additions to codeman tui, both clients of existing server APIs:
codeman tui <name>: attach to the live session whose name is exactly <name>.
Digits only keep meaning a list number, as today.
Exact, case-sensitive match on the session name only (never a prefix, folder or prompt).
Names aren't unique in Codeman, so two live matches refuse and print their numbers instead of
guessing. A name only a RECENT row carries says the session has finished.
With the server down it works from the degraded tmux + state.json view, like <n> does.
codeman tui <name> --new [-m, --mode <id>] [-d, --dir <folder>]: attach if a live
session has that name, otherwise start one in the current folder (or --dir) with that name
and attach.
Defaults to Claude Code; --mode takes any installed run mode, as the Run menu names them.
Refuses a bare home folder (same rule as agent spawn), digit-only names (they'd read as a
number), and starting a second live session with the same name.
Starts the way a directory agent spawn does (POST /api/sessions with workingDir + interactive|shell), so nothing about the agent guard changes.
I built this too, on the preferences below, so there is something concrete to look at:
branch kkalisz/Codeman:feat/tui-new-session (on top of feat(tui): attach by session name, codeman tui <name> #834; tests, docs, changeset). I'll
reshape it to whatever you prefer before opening a PR.
Questions on part 2
Case or plain folder? My preference, and what the branch does, is a plain session in that
folder (no case linked or created, like a directory agent spawn). Or would you rather it links
the folder as a case (or reuses the folder's existing case), so it shows in case pickers and the
phone's case sheet?
--new on a live name: attach (my preference: the same line works the first time and every
time after) or refuse?
Is codeman tui the right home for this, or would you prefer a separate command?
A natural follow-up would be resuming a finished session by name (codeman tui <name> on a
RECENT row). Out of scope for now; mentioning it in case it changes the shape.
Thanks for Codeman. The TUI already made SSH a first-class way in for me.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
The workflow
I run Codeman on each of my machines and drive it from my phone, but a lot of my work starts in a
terminal: I
sshinto a box,cdinto a project, and want an agent there. Later, from anotherSSH login or another folder, I want to get back into that session. Before Codeman I did this with
plain tmux and a tiny wrapper:
sess docsin a project folder started a session nameddocsthere;
sess docsfrom anywhere later attached to it.With Codeman I'd like the same, so the session also shows up on the phone with approvals and push.
What Codeman has today
codeman tuiis great for the terminal side: the list, F1 to leave, Alt+1..9 to switch.codeman tui <n>attaches by list number, but the number moves as sessions change state, so itis not something to remember or put in a script.
codeman tui→nstarts a session from an existing case, namedw<N>-<case>.codeman agent spawn -n <name>starts in the current folder with a name, but it is (rightly)locked to agents running inside a Codeman session (
CODEMAN_MUX=1).So from a plain SSH shell there's no way to say "start a session named
docshere", and no stableway to say "take me back to
docs".Proposal
Two small additions to
codeman tui, both clients of existing server APIs:codeman tui <name>: attach to the live session whose name is exactly<name>.guessing. A name only a RECENT row carries says the session has finished.
state.jsonview, like<n>does.I have this ready as a draft PR: feat(tui): attach by session name,
codeman tui <name>#834 (tests,docs/tui.md, changeset).codeman tui <name> --new [-m, --mode <id>] [-d, --dir <folder>]: attach if a livesession has that name, otherwise start one in the current folder (or
--dir) with that nameand attach.
--modetakes any installed run mode, as the Run menu names them.agent spawn), digit-only names (they'd read as anumber), and starting a second live session with the same name.
agent spawndoes (POST /api/sessionswithworkingDir+interactive|shell), so nothing about the agent guard changes.I built this too, on the preferences below, so there is something concrete to look at:
branch
kkalisz/Codeman:feat/tui-new-session(on top of feat(tui): attach by session name,codeman tui <name>#834; tests, docs, changeset). I'llreshape it to whatever you prefer before opening a PR.
Questions on part 2
folder (no case linked or created, like a directory
agent spawn). Or would you rather it linksthe folder as a case (or reuses the folder's existing case), so it shows in case pickers and the
phone's case sheet?
--newon a live name: attach (my preference: the same line works the first time and everytime after) or refuse?
codeman tuithe right home for this, or would you prefer a separate command?codeman tui <name>on aRECENT row). Out of scope for now; mentioning it in case it changes the shape.
Thanks for Codeman. The TUI already made SSH a first-class way in for me.
Drafted with Claude Code on behalf of @kkalisz.
All reactions