Skip to content

Solution Commands

Solution Commands

Solutions are conjectures proposed to solve problems. They go through a lifecycle: proposed, submitted, approved, or withdrawn. Solutions can have jj changes attached, be critiqued, and have reviewers assigned whose sign-offs gate acceptance.

jjj solution new

Create a new solution.

jjj solution new <title> [OPTIONS]
FlagTypeRequiredDescription
--bodystringThe approach: how the conjecture works. Use - to read stdin, so long text survives shell quoting
--problemstringnoProblem this solution addresses (prompts interactively if not provided)
--supersedesstringnoSolution this supersedes (title or UUID prefix)
--reviewerstring (repeatable)noAssign reviewers at creation (e.g., @alice)
--tagsstringnoComma-separated tags (e.g., refactor,backend,size:L)
--force, -fflagnoCreate even if a similar solution already exists

When --problem is not provided, lists open problems and prompts you to select one interactively. After creation, automatically creates a jj change and attaches it to the solution. The solution stays in proposed status until you explicitly run solution submit.

jjj init
jjj problem new "Login is too slow"
jjj solution new "Add connection pooling" --problem "Login is too slow"
jjj solution new "Use async auth" --problem "Login is too slow" --supersedes "Add connection"
jjj solution list

Assign reviewers at creation:

Terminal window
jjj solution new "Add caching" --problem "Login is too slow" --reviewer @alice --reviewer @bob

When reviewers are assigned, the solution requires all of them to sign off before it can be approved. Sign-offs are recorded via review-type critiques. Review is not required by default — it is enabled per-solution by assigning reviewers.

jjj solution list

List all solutions.

jjj solution list [OPTIONS]
FlagTypeDescription
--problemstringFilter by problem
--statusstringFilter by status (proposed, submitted, withdrawn, approved)
--searchstringSearch solutions by title text
--tagstringFilter by tag (case-insensitive exact match)
--jsonboolOutput in JSON format
jjj solution list --problem "Login is too slow"
jjj solution list --status submitted
jjj solution list --json

jjj solution show

Show solution details.

jjj solution show <solution_id> [OPTIONS]
FlagTypeDescription
--jsonboolOutput in JSON format
jjj solution show "Add connection"
jjj solution show "Add connection" --json

jjj solution edit

Edit solution details.

jjj solution edit <solution_id> [OPTIONS]
FlagTypeDescription
--titlestringNew title
--statusstringNew status
--add-tagstringAdd a tag
--remove-tagstringRemove a tag
Terminal window
jjj solution edit "Add connection" --title "Add connection pooling with retry"

jjj solution attach

Attach the current jj change to a solution.

jjj solution attach <solution_id>
Terminal window
jjj solution attach "Add connection"

jjj solution detach

Detach a change from a solution.

jjj solution detach <solution_id> [change_id]

If no change ID is given, detaches the current change.

Terminal window
jjj solution detach "Add connection"
jjj solution detach "Add connection" abc123

jjj solution submit

Submit a solution for review — opens it for critique.

Submitting also publishes the attached change as a review-s-<solution_id> branch, so a reviewer in another clone can read the diff. Attaching records a change id; it does not share the code, and a reviewer who cannot see the diff can only guess. Publishing is best-effort: a solution with no attached change, or a repo with no remote, still submits.

jjj solution submit <solution_id>
Terminal window
jjj solution submit "Add connection"
# In another clone, to review the actual code:
git fetch origin review-s-<solution_id>
git diff main...FETCH_HEAD

jjj solution approve

Approve a solution. Requires no open critiques (including critique-based review). Auto-solves the problem if this is the only active solution.

jjj solution approve <solution_id> [OPTIONS]
FlagTypeDescription
--forceboolForce approve even with open critiques (sets force_approved flag)
--rationalestringReason for approving
--no-rationaleflagSkip the rationale prompt

The approval gate checks that all critiques are resolved (addressed, dismissed, or validated). This includes:

  1. Regular critiques — issues raised about the solution’s approach
  2. Review critiques — review requests (critiques with --reviewer flag) that must be addressed by the assigned reviewer

Using --force bypasses the check and sets the force_approved flag on the solution.

Terminal window
jjj solution approve "Add connection"
jjj solution approve "Add connection" --force

jjj solution withdraw

Withdraw a solution (criticism showed it will not work).

jjj solution withdraw <solution_id> [OPTIONS]
FlagTypeDescription
--rationalestringReason for withdrawing
--no-rationaleflagSkip the rationale prompt
Terminal window
jjj solution withdraw "Add connection"

jjj solution assign

Assign a solution to a person.

jjj solution assign <solution_id> [OPTIONS]
FlagTypeDescription
--tostringAssignee name (defaults to self)
Terminal window
jjj solution assign "Add connection" --to bob

jjj solution resume

Resume working on an existing solution. Switches to the solution’s most recent jj change, or creates a new change if none exists.

jjj solution resume <solution_id>
Terminal window
jjj solution resume "Add connection"

jjj solution diff

Show the jj diff output for all change IDs attached to a solution.

jjj solution diff <solution_id>

Prints === Change: <id> === before each diff. If a change is not present in the local repo, a note is shown and the next change is tried. If no change IDs are attached, prints an informative message.

Terminal window
jjj solution diff "Add connection"

jjj solution lgtm

Sign off on a solution as a reviewer. This addresses your open review critique for the solution, recording your approval.

Signing off is not approving. By default lgtm records the review and then reports whether anything still blocks — leaving the solution in submitted until someone runs solution approve. That is right when several reviewers sign off in turn, and a trap in an automated loop: a fleet once produced eight reviewed solutions and merged none of them. Pass --approve to finish the job in one step; it still refuses while any critique is open.

jjj solution lgtm <solution_id> [OPTIONS]
FlagTypeDescription
--rationalestringRecord why you signed off — the evidence behind the approval
--approveboolApprove too, if nothing is left blocking
--jsonboolPrint the updated solution as JSON (suppresses the prose)
Terminal window
jjj solution lgtm "Add connection"
jjj solution lgtm "Add connection" --approve --rationale "ran the benchmark: 2.8x -> 2.1x"

jjj solution comment

Leave a reply on a critique attached to a solution.

jjj solution comment <solution_id> --critique <critique_id> <body>
FlagTypeRequiredDescription
--critiquestringyesThe critique to reply to (title or UUID prefix)
Terminal window
jjj solution comment "Add connection" --critique "Missing error" "Fixed in latest change"