@benkoppe/claude-tree 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +73 -2
- package/bin/claude-tree.cjs +41 -0
- package/package.json +27 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Ben Koppe
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,74 @@
|
|
|
1
|
-
#
|
|
1
|
+
# claude-tree
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
`/tree` (from `pi` agent) for Claude Code and other agents.
|
|
4
|
+
|
|
5
|
+
`claude-tree` frees you from a linear history & turns a project's agent conversations into a navigable message tree. Every leaf corresponds to a distinct session:
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<img src="https://raw.githubusercontent.com/benkoppe/claude-tree/main/docs/images/conversation-tree.png"
|
|
9
|
+
alt="claude-tree showing branching conversations with live sessions and new updates"
|
|
10
|
+
width="600">
|
|
11
|
+
</p>
|
|
12
|
+
|
|
13
|
+
Claude Code is used by default. To use Codex, pass `--codex`. Optionally, you can pass the project directory:
|
|
14
|
+
|
|
15
|
+
```sh
|
|
16
|
+
claude-tree /path/to/project
|
|
17
|
+
claude-tree --codex /path/to/project
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Quick Start
|
|
21
|
+
|
|
22
|
+
`claude-tree` is project-scoped. Run it inside your project folder.
|
|
23
|
+
|
|
24
|
+
### npm (recommended)
|
|
25
|
+
|
|
26
|
+
Requires Linux or macOS, Node.js 20+, Claude Code or Codex installed on `$PATH`, and a truecolor terminal using a Nerd Font.
|
|
27
|
+
|
|
28
|
+
```sh
|
|
29
|
+
npm install -g @benkoppe/claude-tree
|
|
30
|
+
|
|
31
|
+
cd /path/to/project
|
|
32
|
+
claude-tree
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Run the install command again to update.
|
|
36
|
+
|
|
37
|
+
### Bun (from source)
|
|
38
|
+
|
|
39
|
+
With Bun 1.3.13+ installed, you can install the current `main` branch instead of a release:
|
|
40
|
+
|
|
41
|
+
```sh
|
|
42
|
+
bun add --global github:benkoppe/claude-tree
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Run that command again to update. If the command is not found, add `$BUN_INSTALL/bin` (normally `$HOME/.bun/bin`) to `$PATH`.
|
|
46
|
+
|
|
47
|
+
On musl Linux, please set `OPENTUI_LIBC=musl`.
|
|
48
|
+
|
|
49
|
+
### Nix
|
|
50
|
+
|
|
51
|
+
```sh
|
|
52
|
+
nix run github:benkoppe/claude-tree
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
This command also installs separate Claude/Codex agents. To use your own system-installed agents, use `#unwrapped`:
|
|
56
|
+
|
|
57
|
+
```sh
|
|
58
|
+
nix run github:benkoppe/claude-tree#unwrapped
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Development
|
|
62
|
+
|
|
63
|
+
The development shell includes Bun and the validated provider CLIs available for the platform:
|
|
64
|
+
|
|
65
|
+
```sh
|
|
66
|
+
nix develop
|
|
67
|
+
bun install --frozen-lockfile
|
|
68
|
+
bun run check # or nix flake check
|
|
69
|
+
bun run start
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Without Nix, install Bun and at least one supported provider CLI before running the last three commands.
|
|
73
|
+
|
|
74
|
+
After changing `bun.lock`, regenerate the Nix dependency set with `nix develop -c bun2nix -o bun.nix`.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
const { spawn } = require("node:child_process");
|
|
5
|
+
const { dirname, join } = require("node:path");
|
|
6
|
+
const { name } = require("../package.json");
|
|
7
|
+
|
|
8
|
+
const platform = process.platform;
|
|
9
|
+
const arch = process.arch;
|
|
10
|
+
if (!["linux", "darwin"].includes(platform) || !["x64", "arm64"].includes(arch)) {
|
|
11
|
+
console.error(`claude-tree: unsupported platform ${platform}/${arch}`);
|
|
12
|
+
process.exit(1);
|
|
13
|
+
}
|
|
14
|
+
let libc;
|
|
15
|
+
if (platform === "linux") {
|
|
16
|
+
const report = process.report?.getReport();
|
|
17
|
+
libc = report?.header?.glibcVersionRuntime ? "glibc" : "musl";
|
|
18
|
+
}
|
|
19
|
+
const suffix = `${platform}-${arch}${libc ? `-${libc}` : ""}`;
|
|
20
|
+
const platformPackage = `${name}-${suffix}`;
|
|
21
|
+
let executable;
|
|
22
|
+
try {
|
|
23
|
+
executable = join(dirname(require.resolve(`${platformPackage}/package.json`)), "claude-tree");
|
|
24
|
+
} catch {
|
|
25
|
+
console.error(`claude-tree: missing platform package ${platformPackage}. Reinstall with optional dependencies enabled.`);
|
|
26
|
+
process.exit(1);
|
|
27
|
+
}
|
|
28
|
+
// Only the launcher receives foreground process-group signals; forward each once.
|
|
29
|
+
const child = spawn(executable, process.argv.slice(2), { detached: true, stdio: "inherit", env: { ...process.env, ...(libc ? { OPENTUI_LIBC: libc } : {}) } });
|
|
30
|
+
const handlers = new Map();
|
|
31
|
+
for (const signal of ["SIGINT", "SIGTERM", "SIGHUP", "SIGQUIT"]) {
|
|
32
|
+
const handler = () => { if (child.exitCode === null && child.signalCode === null) child.kill(signal); };
|
|
33
|
+
handlers.set(signal, handler);
|
|
34
|
+
process.on(signal, handler);
|
|
35
|
+
}
|
|
36
|
+
child.on("error", (error) => { console.error(`claude-tree: ${error.message}`); process.exitCode = 1; });
|
|
37
|
+
child.on("exit", (code, signal) => {
|
|
38
|
+
for (const [name, handler] of handlers) process.removeListener(name, handler);
|
|
39
|
+
if (signal) process.kill(process.pid, signal);
|
|
40
|
+
else process.exitCode = code ?? 1;
|
|
41
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,29 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@benkoppe/claude-tree",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Explore and run coding-agent conversations as a tree",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/benkoppe/claude-tree.git"
|
|
9
|
+
},
|
|
10
|
+
"homepage": "https://github.com/benkoppe/claude-tree#readme",
|
|
11
|
+
"bin": {
|
|
12
|
+
"claude-tree": "bin/claude-tree.cjs"
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"bin",
|
|
16
|
+
"LICENSE",
|
|
17
|
+
"README.md"
|
|
18
|
+
],
|
|
19
|
+
"engines": {
|
|
20
|
+
"node": ">=20"
|
|
21
|
+
},
|
|
22
|
+
"optionalDependencies": {
|
|
23
|
+
"@benkoppe/claude-tree-linux-x64-glibc": "0.1.0",
|
|
24
|
+
"@benkoppe/claude-tree-linux-arm64-glibc": "0.1.0",
|
|
25
|
+
"@benkoppe/claude-tree-linux-x64-musl": "0.1.0",
|
|
26
|
+
"@benkoppe/claude-tree-linux-arm64-musl": "0.1.0",
|
|
27
|
+
"@benkoppe/claude-tree-darwin-arm64": "0.1.0"
|
|
28
|
+
}
|
|
29
|
+
}
|