Skip to content

jk manual

Work across workspace directories

Inspect, add, rename, update, and forget jj workspaces.

Press W, or start with jk workspaces, to list the repository’s jj workspaces. A workspace is a working directory with its own working-copy change. Workspaces share repository history; rewriting an ancestor can affect changes used by other workspaces.

Start from a working directory or specify one explicitly. With this source version and jj 0.45.1, automatic startup from a repository container without a working copy fails to select its child workspace. From a container whose working directory is default, use jk -R default workspaces. Replace default with the actual directory and verify the selected workspace’s path. See the container-startup defect.

Inspect another workspace without changing directories

Begin with two workspace entries and select the one you want to inspect.

  • Press l for its log.
  • Press Enter or s for its status.
  • Press d for its working-copy diff.
  • Press Backspace to return to the workspace list, and r to refresh that list.

These views are scoped to the selected workspace’s root. Its log is a rendered inspection view, not the main navigable revision log; use explicit :show scratch@ or :evolog -r scratch@ commands for further inspection, replacing scratch with that workspace’s name. Check the path in the title before acting on what you see. Opening another workspace’s status does not switch the shell’s current directory or the repository used by : and !. For a command that must operate on that directory, specify -R explicitly in a jj command or reopen jk with that workspace as its startup scope. The command prompt does not show this scope. If its directory is missing, jk reports the error and keeps the list open; restore the directory or choose whether its metadata should be forgotten.

Press a in the workspace list to open lifecycle actions for the selected workspace.

Add a workspace for separate work

Choose a workspace to use as the path context. Press a a, then enter a destination path such as ../review-copy. A relative destination is resolved against the selected workspace’s root. The final path component supplies the new workspace name.

  1. Read the selected workspace and root in the input form.
  2. Enter the destination and press Enter to prepare the command.
  3. Check the resolved destination, name, and exact jj workspace add command.
  4. Press Enter to execute, or Esc to cancel.
  5. Verify the new list row, inspect its status, and check that the directory exists.

The native form supplies the destination and name. Creation revisions, a creation message, or sparse patterns require an explicit noninteractive jj command. If you undo an addition, check whether its directory remains before removing any files.

An existing destination, name collision, invalid path, or permissions problem can make add fail. Read the retained diagnostic and reopen Add to enter a corrected destination. A failed action loses its input draft. Check whether it created a directory before reusing its path.

Rename a workspace

Select it, press a r, and enter the new workspace name. Enter prepares the command; another Enter executes it after review. Esc cancels either stage.

Rename changes jj’s workspace name; its directory path stays the same. Verify the new name in the list and the same root path in its inspection view. A duplicate name is rejected by jj; the error remains available in Command History. Reopen Rename and enter a corrected name; a failed rename does not retain the input draft. To reverse an unwanted successful rename, rename it back or inspect the operation before selecting recovery.

Update a stale workspace

After a graph rewrite from another workspace, a working directory can be stale relative to the repository’s current operation. Select that workspace and press u, or use a u.

Read the preview’s workspace name and path. Enter runs jj workspace update-stale with that workspace as its repository scope; Esc cancels. The command can update that directory’s files to match its working-copy state.

After success, open its status and diff and verify that the stale warning is gone and its content is correct. If jj reports a missing directory, concurrent change, or another failure, retain the message from C, resolve the cause, and refresh before retrying. Inspect the operation history before reversing a successful update.

Forget workspace metadata while keeping files

Use Forget when jj should stop tracking a workspace entry. Select it and press a f.

The preview names the workspace and explains the metadata scope. Press Enter to confirm or Esc to cancel. The entry disappears from the refreshed list. Its directory and files remain on disk. This action is separate from abandoning the working-copy change or deleting a directory.

Verify both results: the workspace row is gone, and any files you intended to keep still exist. Keep the directory until you have checked the outcome. If you forgot the wrong entry, inspect the operation in C and use jj operation recovery as appropriate before doing further cleanup.

Workspace confirmations also accept y to run and n to cancel. Their arrow and Page Up/Down keys scroll long command text. If the terminal is too small to display a decision, enlarge it before confirming. Run Options does not apply to workspace commands.

Check failure and recovery in context

Open C after a lifecycle action to read its exact repository argument, command, output, and status. Use o on the record for the captured resulting operation; if none is available, jk opens Operation Log. Inspect both the shared graph and the affected directory when recovering. Undoing repository metadata cannot be assumed to undo unrelated file edits or remove a directory created by add.

Watch the workflow

Check which workspace a command will change

Check which workspace a command will change · 0:31 · MP4
Screenshots and terminal evidence
Check which workspace a command will change: audit scope context bookmarks
audit scope context bookmarks · Terminal state and styles (JSON)
Read the terminal text
jk jj bookmark list
›  audit-context: 5416e289bcca (local)
   audit-context@git: 5416e289bcca (tracked, synced)







































Enter inspect  c create  m move  x delete  F fetch  P dry-run  ? help  Esc back
Check which workspace a command will change: audit scope context hidden help
audit scope context hidden help · Terminal state and styles (JSON)
Read the terminal text
jk jj bookmark list
›  audit-context: 5416e289bcca (local)
   audit-context@git: 5416e289bcca (tracked, synced)







































Enter inspect  c create  m move  x delete  F fetch  P dry-run  ? help  Esc back
Check which workspace a command will change: audit scope context input
audit scope context input · Terminal state and styles (JSON)
Read the terminal text
jk jj -R /home/runner/work/jk/jk/target/manual-fixtures/workspaces.MvkFJr/workflows.8HgG9l/workspa
Working copy changes:
A ../scratch/KEEP-ME.txt
Working copy  (@) : tlznmvqv 6ada6fb2 (no description set)
Parent commit (@-): qnyvzuou b2e6655a Add workspace demo files














                     jj command

                     : describe -m 'Scope audit changed startup workspace' @

                     enter run   Ctrl-u clear   backspace edit   esc cancel
Check which workspace a command will change: audit scope context result
audit scope context result · Terminal state and styles (JSON)
Read the terminal text
jk jj --no-pager --color always --repository /home/runner/work/jk/jk/target/manual-fixtures/worksp
Command: jj --no-pager --color always --repository /home/runner/work/jk/jk/target/manual-fixtures/
Status: success

Stdout:
<empty>

Stderr:
Working copy  (@) now at: qmquxmry 38b1b40c audit-context | (empty) Scope audit changed startup wo
Parent commit (@-)      : qnyvzuou b2e6655a Add workspace demo files

Actions: e edit/retry command   : run another jj command






























? help  V options  r refresh  j/k line  space page  q quit
Check which workspace a command will change: audit scope context recovered
audit scope context recovered · Terminal state and styles (JSON)
Read the terminal text
jk jj
›  @  qmquxmry [email protected] 2026-01-01 12:00:00 audit-context default@ 5416e289
·  │  (empty) Workspace lifecycle demo
   │ ○  tlznmvqv [email protected] 2026-01-01 12:00:00 scratch@ 6ada6fb2
   ├─╯  (no description set)
   ○  qnyvzuou [email protected] 2026-01-01 12:00:00 b2e6655a
   │  Add workspace demo files
   ◆  zzzzzzzz root() 00000000


































? help  H home  L log  r refresh  enter open  d diff  v evolog  s status  space mark  ...  q quit

Binary, tool versions, and file hashes · Accepted pixel, text/style, and video review · action-diagnostics/bin/dependencies.log · action-diagnostics/tape-1.log · Outcome assertions 1 · Outcome assertions 2

All retained evidence (50 files)

Includes source tapes, original helper scripts, fixture details, terminal states, and logs.

Other recorded forms and recovery paths (3)

Inspect another workspace without switching scope

Inspect another workspace without switching scope · 0:29 · MP4
Screenshots and terminal evidence
Inspect another workspace without switching scope: workspaces inspect status
workspaces inspect status · Terminal state and styles (JSON)
Read the terminal text
jk jj -R /home/runner/work/jk/jk/target/manual-fixtures/workspaces.CSSzGn/workflows.RLxDb7/workspa
Working copy changes:
A ../scratch/KEEP-ME.txt
Working copy  (@) : psukwknu c0b49187 (no description set)
Parent commit (@-): zrqnkqsw 9f6af6b1 Add workspace demo files





































? help  V options  r refresh  j/k line  space page  q quit
Inspect another workspace without switching scope: workspaces inspect diff
workspaces inspect diff · Terminal state and styles (JSON)
Read the terminal text
jk jj -R /home/runner/work/jk/jk/target/manual-fixtures/workspaces.CSSzGn/workflows.RLxDb7/workspa
Added regular file ../scratch/KEEP-ME.txt:
        1: workspace files remain after metadata changes







































? help  V options  r refresh  j/k line  space page  q quit
Inspect another workspace without switching scope: workspaces inspect show
workspaces inspect show · Terminal state and styles (JSON)
Read the terminal text
jk jj --no-pager --color always --repository /home/runner/work/jk/jk/target/manual-fixtures/worksp
Command: jj --no-pager --color always --repository /home/runner/work/jk/jk/target/manual-fixtures/
Status: success

Stdout:
Commit ID: c0b49187b780fcb257a9de838ca57114b9e59454
Change ID: psukwknupoqyrlkywwkwxqmqqpxlsokx
Author   :<redacted> Author <[email protected]> (2026-01-01 12:00:00)
Committer: Alex Developer <[email protected]> (2026-01-01 12:00:00)

    (no description set)

Added regular file KEEP-ME.txt:
        1: workspace files remain after metadata changes

Stderr:
<empty>

Actions: e edit/retry command   : run another jj command























? help  V options  r refresh  j/k line  space page  q quit
Inspect another workspace without switching scope: workspaces inspect evolog
workspaces inspect evolog · Terminal state and styles (JSON)
Read the terminal text
jk jj --no-pager --color always --repository /home/runner/work/jk/jk/target/manual-fixtures/worksp
Command: jj --no-pager --color always --repository /home/runner/work/jk/jk/target/manual-fixtures/
Status: success

Stdout:
○  psukwknu [email protected] 2026-01-01 12:00:00 scratch@ c0b49187
│  (no description set)
│  -- operation c7dc37b64b56 snapshot working copy
○  psukwknu/1 [email protected] 2026-01-01 12:00:00 986385ef (hidden)
   (empty) (no description set)
   -- operation 88af11740632 create initial working-copy commit in workspace scratch

Stderr:
<empty>

Actions: e edit/retry command   : run another jj command


























? help  V options  r refresh  j/k line  space page  q quit

Binary, tool versions, and file hashes · Accepted pixel, text/style, and video review · action-diagnostics/bin/dependencies.log · action-diagnostics/tape-1.log · Outcome assertions 1

All retained evidence (46 files)

Includes source tapes, original helper scripts, fixture details, terminal states, and logs.

Add, rename and forget a workspace

Add, rename and forget a workspace · 0:51 · MP4
Screenshots and terminal evidence
Add, rename and forget a workspace: workspaces lifecycle cancel
workspaces lifecycle cancel · Terminal state and styles (JSON)
Read the terminal text
jk jj workspace list
   * default  /home/runner/work/jk/jk/target/manual-fixtures/workspaces.zmNul7/workflows.4NDboK/wo
›    scratch  /home/runner/work/jk/jk/target/manual-fixtures/workspaces.zmNul7/workflows.4NDboK/wo








            Forget workspace metadata?


            Workspace  scratch
            Path
            /home/runner/work/jk/jk/target/manual-fixtures/workspaces.zmNul7/workflows
            .4NDboK/workspaces/scratch

            Files are not deleted. Only jj workspace metadata is forgotten.

            Exact command
            jj --no-pager --color always --repository /home/runner/work/jk/jk/target/m
            anual-fixtures/workspaces.zmNul7/workflows.4NDboK/workspaces/repo workspac
            e forget scratch





              ↑/↓ Review    Enter / y Confirm    Esc / n Cancel
Add, rename and forget a workspace: workspaces lifecycle add
workspaces lifecycle add · Terminal state and styles (JSON)
Read the terminal text
jk jj workspace list
   * default  /home/runner/work/jk/jk/target/manual-fixtures/workspaces.zmNul7/workflows.4NDboK/wo
›    scratch  /home/runner/work/jk/jk/target/manual-fixtures/workspaces.zmNul7/workflows.4NDboK/wo








            Add workspace


            Workspace  scratch
            Path
            /home/runner/work/jk/jk/target/manual-fixtures/workspaces.zmNul7/workflows
            .4NDboK/workspaces/scratch

            Destination
            /home/runner/work/jk/jk/target/manual-fixtures/workspaces.zmNul7/workflows
            .4NDboK/workspaces/manual-added
            Name        manual-added

            Exact command
            jj --no-pager --color always --repository /home/runner/work/jk/jk/target/m
            anual-fixtures/workspaces.zmNul7/workflows.4NDboK/workspaces/repo workspac
            e add /home/runner/work/jk/jk/target/manual-fixtures/workspaces.zmNul7/wor
            kflows.4NDboK/workspaces/manual-added --name manual-added

              ↑/↓ Review    Enter / y Confirm    Esc / n Cancel
Add, rename and forget a workspace: workspaces lifecycle collision
workspaces lifecycle collision · Terminal state and styles (JSON)
Read the terminal text
jk jj workspace list
   * default  /home/runner/work/jk/jk/target/manual-fixtures/workspaces.zmNul7/workflows.4NDboK/wo
›    manual-renamed  /home/runner/work/jk/jk/target/manual-fixtures/workspaces.zmNul7/workflows.4N
     scratch  /home/runner/work/jk/jk/target/manual-fixtures/workspaces.zmNul7/workflows.4NDboK/wo






































Rename workspace failed: Error: Failed to rename a workspace
Add, rename and forget a workspace: workspaces lifecycle finished
workspaces lifecycle finished · Terminal state and styles (JSON)
Read the terminal text
jk jj workspace list
›  * default  /home/runner/work/jk/jk/target/manual-fixtures/workspaces.zmNul7/workflows.4NDboK/wo
     scratch  /home/runner/work/jk/jk/target/manual-fixtures/workspaces.zmNul7/workflows.4NDboK/wo







































Forget workspace metadata succeeded · C history · o operations

Binary, tool versions, and file hashes · Accepted pixel, text/style, and video review · action-diagnostics/bin/dependencies.log · action-diagnostics/tape-1.log · Outcome assertions 1

All retained evidence (46 files)

Includes source tapes, original helper scripts, fixture details, terminal states, and logs.

Bring a stale workspace up to date

Bring a stale workspace up to date · 0:23 · MP4
Screenshots and terminal evidence
Bring a stale workspace up to date: workspaces stale preview
workspaces stale preview · Terminal state and styles (JSON)
Read the terminal text
jk jj workspace list
   * default  /home/runner/work/jk/jk/target/manual-fixtures/workspaces-stale.SYq8aL/workflows.vbU
›    scratch  /home/runner/work/jk/jk/target/manual-fixtures/workspaces-stale.SYq8aL/workflows.vbU








            Update stale workspace?


            Workspace  scratch
            Path
            /home/runner/work/jk/jk/target/manual-fixtures/workspaces-stale.SYq8aL/wor
            kflows.vbUrW6/workspaces/scratch

            Exact command
            jj --no-pager --color never --repository /home/runner/work/jk/jk/target/ma
            nual-fixtures/workspaces-stale.SYq8aL/workflows.vbUrW6/workspaces/scratch
            workspace update-stale







              ↑/↓ Review    Enter / y Confirm    Esc / n Cancel
Bring a stale workspace up to date: workspaces stale updated
workspaces stale updated · Terminal state and styles (JSON)
Read the terminal text
jk jj workspace list
   * default  /home/runner/work/jk/jk/target/manual-fixtures/workspaces-stale.SYq8aL/workflows.vbU
›    scratch  /home/runner/work/jk/jk/target/manual-fixtures/workspaces-stale.SYq8aL/workflows.vbU







































updated scratch via workspace update-stale: Working copy  (@) now at: lkpsvqkm 4b6fda98 Refresh sc
Bring a stale workspace up to date: workspaces stale status
workspaces stale status · Terminal state and styles (JSON)
Read the terminal text
jk jj -R /home/runner/work/jk/jk/target/manual-fixtures/workspaces-stale.SYq8aL/workflows.vbUrW6/w
Working copy changes:
A ../scratch/KEEP-ME.txt
D ../scratch/README.md
Working copy  (@) : lkpsvqkm 4b6fda98 Refresh scratch description
Parent commit (@-): lypuszsr 575ac4b4 Add workspace demo files




































? help  V options  r refresh  j/k line  space page  q quit
Bring a stale workspace up to date: workspaces stale current
workspaces stale current · Terminal state and styles (JSON)
Read the terminal text
jk jj workspace list
   * default  /home/runner/work/jk/jk/target/manual-fixtures/workspaces-stale.SYq8aL/workflows.vbU
›    scratch  /home/runner/work/jk/jk/target/manual-fixtures/workspaces-stale.SYq8aL/workflows.vbU







































updated scratch via workspace update-stale: Attempted recovery, but the working copy is not stale.

Binary, tool versions, and file hashes · Accepted pixel, text/style, and video review · action-diagnostics/bin/dependencies.log · action-diagnostics/tape-1.log · Outcome assertions 1

All retained evidence (46 files)

Includes source tapes, original helper scripts, fixture details, terminal states, and logs.