Conversation
…sion-prompt hook (3.3.0) `mx work open` / `mx work -n <name> open` / `-o` (and `mx work new -o`) are now session-aware. They follow a per-work naming convention — one Claude Code session named exactly <name> — and do the right thing: - 0 sessions named <name> -> create `claude -n <name>`, seeded with an initial prompt when one is resolved - exactly 1 -> resume it (`claude --resume <id>`) - 2 or more -> MULTIPLE_SESSIONS error; resume manually The name match is exact, so numbered parallel sessions (<name>-2, <name>-3) are ignored and stay manual. Sessions are located by scanning the work's own Claude project dir (~/.claude/projects/<work-path>/, keyed off the work folder's realpath) and reading each transcript's custom title — the same field /rename and `claude -n` write. Initial prompt for a new session is dynamic via a new central `session-prompt` hook: `mx work open --prompt <text>` wins, else the hook's stdout is used (cwd = work folder; MX_WORK / MX_WORK_PATH / MX_SESSION_NAME), so it can be global or varied per repo/work. Empty output -> clean session. Fires only on create. - core: new claudeSessions.ts (claudeProjectDirName, readSessionTitle, findSessionsByName, ClaudeSession); session-prompt added to HOOK_EVENTS + a stamped no-op template - cli: runHookCapture (stdout-capturing hook runner); openWorkLayout takes a launch command; --prompt flag; resume-or-create wiring in commands/work.ts - tests: 6 new core cases; docs (commands, runtime-model, history, both READMEs, runtime CLAUDE.md template); version 3.2.0 -> 3.3.0 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…and base (3.4.0) Positional args after the work name are pristine repos to create worktrees for as part of `mx work new`, instead of a separate `mx work worktree add` per repo. Each token is <repo>[:<branch>[:<base>]] (git refs can't contain ':', so the split is unambiguous): mx work new feat app api # app + api on branch "feat" mx work new feat app:hotfix api # app on "hotfix", api on "feat" mx work new feat muze-ai:feat:app_ib_dev scaligent:feat:migration-to-mt-service-from-cf mx work new feat app::develop # default branch, forked from develop Resolved per repo: branch = :<branch> -> --branch (a default for every repo without its own) -> the work name; base (fork point) = :<base> -> --base -> the pristine clone's HEAD. An empty branch segment (app::develop) means "use the default branch". Repos are validated up front (unknown or duplicate repo fails before anything is created, so no half-built work); each worktree fires the pre/post-worktree-create hooks; combines with -o. - core: parseInitWorktreeSpec + InitWorktreeSpec (repo/branch/base) - cli: shared createWorktreeFiringHooks helper (used by `worktree add` and `work new`); new-handler parses/validates specs and creates worktrees with per-repo branch + base - tests: 6 new parse cases (104 total); docs (commands, history, both READMEs, root CLAUDE.md, help); version 3.3.0 -> 3.4.0 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two changes, released together as 3.4.0.
mx work open (and mx work new -o) is now session-aware: it resumes the work's Claude session (one named after the work) when exactly one exists, creates a new named session when none exist, and errors when two or more share the name. A new session can be seeded with an initial prompt, taken from --prompt or a new session-prompt hook whose stdout becomes the prompt.
mx work new can also create initial worktrees: positional repos after the name, each repo:branch:base (branch and base optional). Per repo the branch falls back to --branch then the work name, and the base to --base then the pristine HEAD. Repos are validated up front, so a bad or duplicate repo fails before any work is created.
Runtime stays v3, no migration. typecheck, lint, tests (104), and build all pass.