SKILL.md--- name: sesh description: Use when starting work in a terminal session — opening a project or directory, connecting to a session by name, cloning a repo to work in, or running a command or coding agent somewhere other than the current shell. Sesh resolves names and directories to sessions across tmux, zoxide, config, and tmuxinator. Use instead of `tmux new-session`, `tmux new-window`, `tmux attach`, or `tmux send-keys`. --- # Starting work with sesh When work needs to start somewhere other than the shell you're in, call `sesh`, not `tmux`. Reaching for `tmux new-session -s <name>` or `tmux new-window -t <session>` throws away what the user set sesh up to do: resolve a rough name or a directory to the right session, start it from its configured root with its startup commands, reuse what's already running instead of duplicating it, and decide whether to move the user or leave them where they are. If `sesh` is not on `PATH`, fall back to raw tmux. Otherwise use the commands below. ## Session or window? This is the first decision, and the one most worth getting right. **A session per unit of work.** That's the model — a project, a repo, a directory. If the work has its own directory, it wants its own session: ```bash sesh connect ~/c/sesh sesh connect sesh # a name works too; sesh resolves it ``` **A window when it belongs inside a context that already exists.** Reach for a window when the work is *part of* a session that's already running rather than a thing of its own: ```bash sesh window connect claude -t 'second brain' -c 'claude "<prompt>"' ``` Good reasons to add a window instead of a session: - The user named a session to put it in ("in my dotfiles session", "next to what I'm working on") - The work is a second track in the same project — tests, logs, an agent, a dev server — and the session for that project is already open - You're already inside the right session and just need another place to run something If neither applies, use a session. Don't create a window in an unrelated session just because that session happens to be attached. Either way, both commands **select-or-create**: they reuse what's there and only create on a miss, so it's safe to run them without checking first. ## Sessions ```bash sesh connect <name|directory> ``` Connects to the session, creating it if it isn't running. The argument can be a path, a session name, a zoxide result, a configured session, or a tmuxinator config — sesh resolves across all of them, which is the main reason to call it instead of tmux. ```bash sesh connect ~/c/sesh # by path sesh connect sesh # by rough name sesh connect 'second brain' -s # names with spaces need quoting sesh connect ~/c/api -c 'npm run dev' ``` | Flag | Meaning | |---|---| | `-s`, `--switch` | Switch the client rather than attach. Use when triggering sesh from outside the terminal — a hotkey, a script, another app. | | `-c`, `