1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
# jeans

jeans uses the jj commit graph as the task tracker for a team of Claude Code
agents. Every task is a commit, and its subtasks are its parents, so the
graph is the work breakdown and there's nothing to keep in sync with it.

```text
◇    goal [blocked]
├─╮
│ ◇  B [claimed]
◇ │  A [blocked]
◇ │  A.1 [ready]
├─╯
◆  trunk
```

One session acts as the stakeholder. It owns the goal commit at the top,
claims ready tasks, and hands each one to a developer subagent, up to the
configured team size. A developer either finishes its task in one commit or
splits it into subtasks. Work moves from the leaves up to the goal, and
integration happens at every merge.

The state of each task comes from the graph, never from its description:

| State | Meaning |
|---|---|
| done | It's an ancestor of the goal's done node and has no conflicts |
| claimed | A jj workspace named `jeans-<change-id>` exists for it |
| blocked | A task feeding it isn't done |
| ready | None of the above |

A repository can hold several goals. A goal named NAME is bookmarked
`jeans/NAME/goal`. Its done node is an empty commit, bookmarked
`jeans/NAME/done`, whose parents are the heads of the goal's finished tasks.
`jeans init` makes the done node a parent of the integration node: the `mm`
megamerge when there is one, and otherwise the main workspace's `@`. Your
checkout always holds every goal's finished tasks merged together, and never
an unfinished one.

## Try it

1. Install the plugin:

   ```text
   /plugin marketplace add kejadlen/jeans
   /plugin install jeans@jeans
   ```

2. Make a scratch repository and start a session in it:

   ```bash
   mkdir ~/src/local/jeans-demo && cd ~/src/local/jeans-demo
   jj git init .
   claude
   ```

3. Ask the session to use `jeans:stakeholder` for a small goal with a team
   size of 2. A good first goal is big enough to split and small enough to
   finish in minutes, such as a Ruby CLI that converts temperatures, with
   tests.

Developers run as background subagents, so they stall on permission prompts
unless the session allows Bash commands and file edits in the repository and
its workspaces. Workspaces go in a sibling directory, `jeans-demo.jeans`.

To follow along from another terminal, run this in the repository:

```bash
/path/to/jeans/bin/jeans watch
```

`bin/jeans` is a [DotSlash](https://dotslash-cli.com) file that fetches a
prebuilt binary from a GitHub release. No release exists yet, so the file
is a placeholder and fails until the first one. In the meantime, build the
binary yourself with `cargo build`, or enter `nix develop`, and run
`target/debug/jeans`.

## Commands

`bin/jeans` with no arguments lists every command. Agents call the
following ones to change the graph:

- `init --goal NAME`, which creates the goal
- `add`, which inserts a task
- `claim`, which creates a task's workspace
- `done`, which finishes a task. It takes a commit message with `-m` and
  puts it above the task's spec, which stays under a `Task:` line, with the
  message's trailers moved to the end. Finishing the goal abandons the done
  node, so the goal takes its place under the integration node, and deletes
  both bookmarks, leaving an ordinary commit to review or open a PR for
- `release`, which gives a task back unfinished
- `describe`, which rewrites a task's description

Each one holds a file lock, because jj has no repository lock. Run from a
developer's workspace, `add` and `describe` reach only that developer's own task
and its subtasks, so the developer reports anything else to the stakeholder.
From outside, they refuse to change a claimed task.

Every command takes `--goal NAME`. Without it, a command uses the goal that
its TASK feeds, then the goal that the current workspace's task feeds, then
the repository's only goal. A task that feeds two goals needs `--goal`.

The following views are read-only. Each one can narrow to part of a large
graph:

- `jeans log [VIEW]` is `jj log` with each task's state. A VIEW is one of
  `ready`, `claimed`, `blocked`, `done`, `open`, `under TASK`, `path TASK`,
  or any revset.
- `jeans tree [TASK] [--depth N]` prints an outline from the goal, or from
  TASK, down to the leaves. Done subtrees collapse to a count.
- `jeans board [TASK]` prints one section per state, stacked vertically.
- `jeans watch [tree|board] [TASK]` redraws the tree, or the board, whenever
  the graph changes. It never snapshots the working copy, so it adds no
  operations of its own.

Views color task states and IDs when they print to a terminal. Pass
`--color always` or `--color never` to override that. Setting `NO_COLOR` turns
color off unless you pass `--color always`.

## Known rough edges

When two finished siblings edit the same lines, `jeans done` inserts a
resolution task under the done node for a developer to pick up. If the task those siblings
feed is integrated first, the same conflict gets resolved a second time
there, and `jeans` abandons the resolution task. When finished work conflicts
only with the integration node's other parents, `jeans done` warns and adds
no task. Every `jeans done` rewrites the integration node, so a workspace on
top of `mm` goes stale and needs `jj workspace update-stale`. The prompts haven't been through
many real runs yet, so expect a developer to occasionally run jj by hand when it
should go through `jeans`.

## Upgrading a goal from before named goals

jeans 2026.11.24+1429 and earlier bookmark the goal `jeans-goal` and use the
main workspace's `@` as its done node. Newer versions refuse to run while
that goal exists. To move it over, pick a NAME and run this from the main
workspace. INTEGRATION is `bookmarks(exact:"mm")` when the repository has a
megamerge, and `default@` otherwise:

```bash
jj bookmark rename jeans-goal jeans/NAME/goal
jj new --no-edit -m 'Finished tasks for: TITLE' -B 'INTEGRATION' \
  -A 'heads(::@ & (trunk()..bookmarks(exact:"jeans/NAME/goal")))'
jj bookmark create jeans/NAME/done -r <the new commit>
jj config set --repo jeans.integrate 'INTEGRATION'
jj config unset --repo jeans.workspace
```

With no finished tasks yet, pass `-A 'trunk()'` instead. If `@` no longer
sits on the finished tasks, pass one `-A` per finished head. When INTEGRATION is
the megamerge, the finished tasks are still parents of `@` too; rebase `@`
onto its other parents to drop them.

## Tests

Run these from a checkout of this repository, in `nix develop` or with the
Rust toolchain and [just](https://just.systems) installed:

```bash
just all
```

That formats the code, runs clippy, and runs the Rust tests under a coverage
gate. `just parity` builds the binary and runs the original Ruby suite
(`test/jeans_test.rb`) against it. The tests run real jj in temporary
repositories.