Skip to content

jk manual

Inspect results and recover

Find executed commands, inspect repository operations, and undo or redo with context.

Command History records the commands jk ran during this session and keeps their results in memory. Operation Log records changes to repository state and persists across sessions.

Inspect a command’s result

After a mutation or failure, press C.

  1. Select the command record with j/k or the arrows.
  2. Press Enter to inspect its argv, output, exit status, duration, and operation metadata.
  3. Return with Backspace. Press y in the history list to copy the recorded command line.
  4. Press o on the record to inspect its resulting operation. If no operation ID was captured, this opens Operation Log instead.

From a record’s details, Backspace returns to the history list; press it again to return to the view that opened history. Esc in the details quits jk. Esc in the history list returns instead.

A failed command’s stderr often explains an immutable revision, invalid revset, missing path, workspace collision, remote error, or unavailable executable. Read that diagnostic before retrying. A nonzero exit or spawn failure is not a successful mutation. Some commands can perform partial external work before failing, so inspect the affected filesystem or remote when relevant.

History includes inspection and refresh commands as well as mutations. Select the command that caused the result you are investigating. History redacts recognized secret patterns in argv and output; it is not a persistent transcript. Keep the relevant diagnostic separately if you need it after quitting jk.

Inspect repository operations

Press o from the log to open Operation Log. Move to the operation you want to inspect. Enter opens jj op show; d opens its operation diff. Search, paging, refresh, and Backspace work as in other rendered views.

An operation can rewrite several changes or update bookmarks and workspace metadata. Inspect that whole result before deciding to reverse it. A description edit may rewrite descendants, and a rebase with insertion can affect another workspace’s changes.

Operation show and diff are native inspection forms. Operation restore, integrate, and specialized operation display flags have no native chooser; use explicit captured jj commands when needed.

Undo the last operation

Inspect the most recent operation in Operation Log before undoing it.

  1. Return to the log.
  2. Press a u to run jj undo immediately.
  3. Inspect the refreshed graph and the affected file content, bookmark, or workspace entry.
  4. Open C to inspect the undo command and its resulting operation.

Undo reverses the last operation under jj’s undo semantics, regardless of the log cursor. Cancel the action menu with Esc before selecting Undo if you need to inspect the operation first. There is no separate native confirmation.

If undo fails, inspect the history record and the current operation log. Do not repeat the action without checking what jj reports. Unrelated operations or concurrent work can change the appropriate recovery choice.

Redo an undo

Press a U from the log to run jj redo immediately. It redoes the most recently undone operation when jj can do so. Verify the same affected objects again and inspect the command record. If the repository has moved beyond a redoable state, retain the diagnostic and choose an explicit recovery from the operation history.

Undo and redo act on repository state. They do not reverse a remote push, delete newly created workspace directories, or reverse arbitrary side effects of an external command.

Inspect or restore a particular historical state

Copy an operation ID from the operation log. In command mode, replace OPERATION below with that specific ID:

:--at-operation OPERATION log

This inspects the repository at that operation and ignores the current working-copy files. Compare that output with the current graph before deciding whether you want to restore it.

:op restore OPERATION

Operation restore creates a new operation that brings repository state back to the selected earlier state, effectively reversing later operations. It has broader scope than undoing a recent mistake. Command mode executes on Enter without a native restoration confirmation. Cancel its input with Esc if the operation ID or intended scope is uncertain. After success, return to the log, refresh, and verify the graph, bookmarks, working copy, and any affected workspaces.

If you have the ID of an operation that was created without integration, inspect it first with --at-operation. :op integrate OPERATION makes that operation part of the operation log. This is a separate action from restoring the entire repository to its state. Run Options does not offer detached operations or a native integrate workflow.

Recover without losing the failure context

Native rebase, squash, and restore retain failures in Command History. After a failed refresh, the log or bookmark list still shows the last successful query; it may omit later repository changes.

Resolve the reported cause, refresh, and reselect operands before a new mutation. When an external tool changed files, inspect status and diff after returning. When a command changed a remote or the filesystem, verify those objects directly in addition to checking jj’s operation history.

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 (4)

Describe work and start the next change

Describe work and start the next change · 0:56 · MP4
Screenshots and terminal evidence
Describe work and start the next change: change lifecycle cancel
change lifecycle cancel · Terminal state and styles (JSON)
Read the terminal text
jk jj
›  @  nqlpxyqm [email protected] 2026-01-01 12:00:00 16640ceb
·  │  Experiment with forecast caching
   ○  rsmxpoux [email protected] 2026-01-01 12:00:00 f3feb0fe
   │  Configure request timeouts
   ○  uvvtqqqv [email protected] 2026-01-01 12:00:00 67f04040
   │  Add the forecast endpoint
   ○  ornxyotn [email protected] 2026-01-01 12:00:00 4072393a
   │  Document the forecast service
   ◆  zzzzzzzz root() 00000000





             Describe revision
             Revision: nqlpxyqm

             Discard this draft


             Enter save · Esc cancel · Ctrl-j newline · Ctrl-u clear · arrows move
Describe work and start the next change: change lifecycle multiline
change lifecycle multiline · Terminal state and styles (JSON)
Read the terminal text
jk jj
›  @  nqlpxyqm [email protected] 2026-01-01 12:00:00 16640ceb
·  │  Experiment with forecast caching
   ○  rsmxpoux [email protected] 2026-01-01 12:00:00 f3feb0fe
   │  Configure request timeouts
   ○  uvvtqqqv [email protected] 2026-01-01 12:00:00 67f04040
   │  Add the forecast endpoint
   ○  ornxyotn [email protected] 2026-01-01 12:00:00 4072393a
   │  Document the forecast service
   ◆  zzzzzzzz root() 00000000





             Describe revision
             Revision: nqlpxyqm

             Tune forecast cache lifetime

             Keep cached forecasts fresh.

             Enter save · Esc cancel · Ctrl-j newline · Ctrl-u clear · arrows move
Describe work and start the next change: change lifecycle new
change lifecycle new · Terminal state and styles (JSON)
Read the terminal text
jk jj
›  @  kktmzuom [email protected] 2026-01-01 12:00:00 d181e409
·  │  (empty) (no description set)
   ○  nqlpxyqm [email protected] 2026-01-01 12:00:00 5c37b73c
   │  Tune forecast cache lifetime
   ○  rsmxpoux [email protected] 2026-01-01 12:00:00 f3feb0fe
   │  Configure request timeouts
   ○  uvvtqqqv [email protected] 2026-01-01 12:00:00 67f04040
   │  Add the forecast endpoint
   ○  ornxyotn [email protected] 2026-01-01 12:00:00 4072393a
   │  Document the forecast service
   ◆  zzzzzzzz root() 00000000


























? help  H home  L log  r refresh  enter open  d diff  v evolog  s status  space mark  o ops  ...  q quit
Describe work and start the next change: change lifecycle recovered
change lifecycle recovered · Terminal state and styles (JSON)
Read the terminal text
jk jj
›  @  nqlpxyqm [email protected] 2026-01-01 12:00:00 5c37b73c
·  │  Tune forecast cache lifetime
   ○  rsmxpoux [email protected] 2026-01-01 12:00:00 f3feb0fe
   │  Configure request timeouts
   ○  uvvtqqqv [email protected] 2026-01-01 12:00:00 67f04040
   │  Add the forecast endpoint
   ○  ornxyotn [email protected] 2026-01-01 12:00:00 4072393a
   │  Document the forecast service
   ◆  zzzzzzzz root() 00000000




























? help  H home  L log  r refresh  enter open  d diff  v evolog  s status  space mark  o ops  ...  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 · Outcome assertions 3

All retained evidence (48 files)

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

Correct command input and inspect failures

Correct command input and inspect failures · 0:29 · MP4
Screenshots and terminal evidence
Correct command input and inspect failures: manual command mode parse error
manual command mode parse error · Terminal state and styles (JSON)
Read the terminal text
jk jj
›  @  smqluxkn [email protected] 2026-01-01 12:00:00 45990678
·  │  Experiment with forecast caching
   ○  kvosxvnu [email protected] 2026-01-01 12:00:00 3835991c
   │  Configure request timeouts
   ○  nytvmxtw [email protected] 2026-01-01 12:00:00 1ebd9136
   │  Add the forecast endpoint
   ○  lkurnryx [email protected] 2026-01-01 12:00:00 27c2afb2
   │  Document the forecast service
   ◆  zzzzzzzz root() 00000000






                         jj command

                         : status '
                         error: unterminated single quote

                         enter run   Ctrl-u clear   backspace edit   esc cancel
Correct command input and inspect failures: manual command mode jj success
manual command mode jj success · Terminal state and styles (JSON)
Read the terminal text
jk jj --no-pager --color always --repository /home/runner/work/jk/jk/target/forecast-demo.CDlVkR status
Command: jj --no-pager --color always --repository /home/runner/work/jk/jk/target/forecast-demo.CDlVkR s
Status: success

Stdout:
Working copy changes:
A src/cache.js
Working copy  (@) : smqluxkn 45990678 Experiment with forecast caching
Parent commit (@-): kvosxvnu 3835991c Configure request timeouts

Stderr:
<empty>

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
























? help  V options  r refresh  j/k line  space page  q quit
Correct command input and inspect failures: manual command mode failure
manual command mode failure · Terminal state and styles (JSON)
Read the terminal text
jk sh -c 'printf "cache check failed\n" >&2; exit 7'
Command: sh -c 'printf "cache check failed\n" >&2; exit 7'
Status: exit 7

Stdout:
<empty>

Stderr:
cache check failed

Actions: e edit/retry command   ! run another external command



























? help  V options  r refresh  j/k line  space page  q quit
Correct command input and inspect failures: manual command mode history
manual command mode history · Terminal state and styles (JSON)
Read the terminal text
jk Command History
›  fail external command mode external command sh -c 'printf "cache check failed\n" >&2; exit 7'  exit 7
   ok   external command mode external command printf '%s\n' 'Cache verification complete'  Cache verifi
   ok   command mode command   : jj status  Working copy changes:
   ok   log load               jj  stderr: Hint: Use `jj -h` for a list of available commands.
   ok   log load               jj  stderr: Hint: Use `jj -h` for a list of available commands.
































? help  enter details  j/k move  space page  r refresh  o operation  y copy  Esc back  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.

Compare versions of a change

Compare versions of a change · 0:19 · MP4
Screenshots and terminal evidence
Compare versions of a change: inspect history evolog
inspect history evolog · Terminal state and styles (JSON)
Read the terminal text
jk jj evolog -r nlswzynm
@  nlswzynm [email protected] 2026-01-01 12:00:00 candidate 068eab96
│  Experiment with forecast caching
│  -- operation 5216441925dc describe commit a813809c0659d1c90d76cd7b9826228c21e467c3
○  nlswzynm/1 [email protected] 2026-01-01 12:00:00 a813809c (hidden)
│  Try a longer cache window
│  -- operation cfd7f6a7c3a4 snapshot working copy
○  nlswzynm/2 [email protected] 2026-01-01 12:00:00 85246d38 (hidden)
   (empty) Try a longer cache window
   -- operation 166a01bbf3f9 new empty commit

























? help  V options  r refresh  j/k line  space page  q quit
Compare versions of a change: inspect history failure
inspect history failure · Terminal state and styles (JSON)
Read the terminal text
jk jj --no-pager --color always --repository /home/runner/work/jk/jk/target/manual-fixtures/inspection.b
Command: jj --no-pager --color always --repository /home/runner/work/jk/jk/target/manual-fixtures/inspec
Status: exit 1

Stdout:
<empty>

Stderr:
Error: Revision `missing-review` doesn't exist

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
























? help  V options  r refresh  j/k line  space page  q quit
Compare versions of a change: inspect history interdiff
inspect history interdiff · Terminal state and styles (JSON)
Read the terminal text
jk jj --no-pager --color always --repository /home/runner/work/jk/jk/target/manual-fixtures/inspection.b
Command: jj --no-pager --color always --repository /home/runner/work/jk/jk/target/manual-fixtures/inspec
Status: success

Stdout:
Modified commit description:
   1     : Configure request timeouts
        1: Experiment with forecast caching
Modified regular file README.md:
    ...
   3    3: Reliable forecasts for every city.
   4    4:
   5    5: Requests time out after three seconds.
        6:
        7: Cache forecasts for two minutes.
Modified regular file config.json:
   1    1: {
   2    2:   "requestTimeoutMs": 3000,
   3    3:   "cacheTtlSeconds": 60120
   4    4: }
Modified regular file src/cache.js:
   1    1: export const cacheWindow1 = 1;
   2    2: export const cacheWindow2 = 2;
   3    3: export const cacheWindow3 = 3;
   4     : export const cacheWindow4 = 4;
        4: export const cacheTtlSeconds = 120; // Keep forecasts fresh.
   5    5: export const cacheWindow5 = 5;
   6    6: export const cacheWindow6 = 6;
   7    7: export const cacheWindow7 = 7;
    ...
  27   27: export const cacheWindow27 = 27;
  28   28: export const cacheWindow28 = 28;
  29   29: export const cacheWindow29 = 29;
  30     : export const cacheWindow30 = 30;
       30: export const cacheLimit = 256; // Bound memory usage.
? help  V options  r refresh  j/k line  space page  q quit
Compare versions of a change: inspect history history
inspect history history · Terminal state and styles (JSON)
Read the terminal text
jk Command History
›  ok   command mode command   : jj interdiff --from @- --to @  Modified commit description:
   fail command mode command   : jj interdiff --from missing-review --to @  exit 1: Error: Revision `mis
   ok   command mode command   : jj evolog -r @ --no-graph -n 3  nlswzynm [email protected] 2026-01-0
   ok   log evolog             jj evolog -r nlswzynm  @  nlswzynm [email protected] 2026-01-01 12:00:
   ok   log load               jj  stderr: Hint: Use `jj -h` for a list of available commands.
   ok   log load               jj  stderr: Hint: Use `jj -h` for a list of available commands.




























? help  enter details  j/k move  space page  r refresh  o operation  y copy  Esc back  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 (44 files)

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

Inspect an operation and its repository diff

Inspect an operation and its repository diff · 0:16 · MP4
Screenshots and terminal evidence
Inspect an operation and its repository diff: inspect operations log
inspect operations log · Terminal state and styles (JSON)
Read the terminal text
jk jj op log
›  @  9c2455ad07e9 runner@runnervmlun5p default@ 8 months ago, lasted less than a microsecond
   │  create bookmark candidate pointing to commit 9c809e2d630cc3a4c67ab8beefd04674f164132d
   │  args: jj -R /home/runner/work/jk/jk/target/manual-fixtures/inspection.wbQAkX/repo bookmark create
   ○  fbf8d8e74b18 runner@runnervmlun5p default@ 8 months ago, lasted less than a microsecond
   │  describe commit 9d3afcda1ec673e24631ff6183feb27641c663f7
   │  args: jj -R /home/runner/work/jk/jk/target/manual-fixtures/inspection.wbQAkX/repo describe -m 'Exp
   ○  fc2b27c8f27e runner@runnervmlun5p default@ 8 months ago, lasted less than a microsecond
   │  snapshot working copy
   │  args: jj -R /home/runner/work/jk/jk/target/manual-fixtures/inspection.wbQAkX/repo describe -m 'Exp
   ○  8d0eb6e4d796 runner@runnervmlun5p default@ 8 months ago, lasted less than a microsecond
   │  new empty commit
   │  args: jj -R /home/runner/work/jk/jk/target/manual-fixtures/inspection.wbQAkX/repo new -m 'Try a lo
   ○  15f891cca277 runner@runnervmlun5p default@ 8 months ago, lasted less than a microsecond
   │  snapshot working copy
   │  args: jj -R /home/runner/work/jk/jk/target/manual-fixtures/inspection.wbQAkX/repo new -m 'Try a lo
   ○  0b3cd8bc5624 runner@runnervmlun5p default@ 8 months ago, lasted less than a microsecond
   │  new empty commit
   │  args: jj -R /home/runner/work/jk/jk/target/manual-fixtures/inspection.wbQAkX/repo new -m 'Configur
   ○  adeb6f23b898 runner@runnervmlun5p default@ 8 months ago, lasted less than a microsecond
   │  snapshot working copy
   │  args: jj -R /home/runner/work/jk/jk/target/manual-fixtures/inspection.wbQAkX/repo new -m 'Configur
   ○  35f4c4d8140c runner@runnervmlun5p default@ 8 months ago, lasted less than a microsecond
   │  new empty commit
   │  args: jj -R /home/runner/work/jk/jk/target/manual-fixtures/inspection.wbQAkX/repo new -m 'Add the
   ○  4607e4ca36c9 runner@runnervmlun5p default@ 8 months ago, lasted less than a microsecond
   │  create bookmark main pointing to commit 83049e535082fe66ac4ca670b6ee82241e421c59
   │  args: jj -R /home/runner/work/jk/jk/target/manual-fixtures/inspection.wbQAkX/repo bookmark create
   ○  0434b34b2894 runner@runnervmlun5p default@ 8 months ago, lasted less than a microsecond
   │  describe commit 35baab96c5ac05526fe0ef3f8826503c58306c3a
   │  args: jj -R /home/runner/work/jk/jk/target/manual-fixtures/inspection.wbQAkX/repo describe -m 'Doc
   ○  0d37e1a946b2 runner@runnervmlun5p default@ 8 months ago, lasted less than a microsecond
   │  snapshot working copy
   │  args: jj -R /home/runner/work/jk/jk/target/manual-fixtures/inspection.wbQAkX/repo describe -m 'Doc
   ○  45f50c732e5b runner@runnervmlun5p 8 months ago, lasted less than a microsecond
? help  enter show  d diff  j/k move  space page  r refresh  Esc back  q quit
Inspect an operation and its repository diff: inspect operations show
inspect operations show · Terminal state and styles (JSON)
Read the terminal text
jk jj op show 9c2455ad07e9
9c2455ad07e9 runner@runnervmlun5p default@ 8 months ago, lasted less than a microsecond
create bookmark candidate pointing to commit 9c809e2d630cc3a4c67ab8beefd04674f164132d
args: jj -R /home/runner/work/jk/jk/target/manual-fixtures/inspection.wbQAkX/repo bookmark create candid

Changed local bookmarks:
candidate:
+ voqnmprv 9c809e2d candidate | Experiment with forecast caching
- (absent)


























? help  V options  r refresh  j/k line  space page  q quit
Inspect an operation and its repository diff: inspect operations diff
inspect operations diff · Terminal state and styles (JSON)
Read the terminal text
jk jj op diff --operation 9c2455ad07e9
From operation: fbf8d8e74b18 (2026-01-01 12:00:00) describe commit 9d3afcda1ec673e24631ff6183feb27641c66
  To operation: 9c2455ad07e9 (2026-01-01 12:00:00) create bookmark candidate pointing to commit 9c809e2d

Changed local bookmarks:
candidate:
+ voqnmprv 9c809e2d candidate | Experiment with forecast caching
- (absent)



























? help  V options  r refresh  j/k line  space page  q quit
Inspect an operation and its repository diff: inspect operations returned
inspect operations returned · Terminal state and styles (JSON)
Read the terminal text
jk jj
›  @  voqnmprv [email protected] 2026-01-01 12:00:00 candidate 9c809e2d
·  │  Experiment with forecast caching
   ○  zoprlnmt [email protected] 2026-01-01 12:00:00 6bf973b4
   │  Configure request timeouts
   ○  szyxlpms [email protected] 2026-01-01 12:00:00 821cf6d2
   │  Add the forecast endpoint
   ○  nnruqqkl [email protected] 2026-01-01 12:00:00 main 83049e53
   │  Document the forecast service
   ◆  zzzzzzzz root() 00000000

























? help  H home  L log  r refresh  enter open  d diff  v evolog  s status  space mark  o ops  ...  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 (44 files)

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