Skip to main content

Minimal CLI wrapper that launches Claude Code in isolated jj workspaces

Project description

Kekkai

A minimal CLI that launches Claude Code in isolated jj workspaces.

Usage

# Launch Claude in a new workspace
kekkai feature-auth

# List existing workspaces
kekkai list

When you run kekkai <name>:

  1. Creates an isolated jj workspace as a sibling directory (<repo>-<name>/)
  2. Launches Claude Code with full terminal experience
  3. On exit, warns about uncommitted changes if any
  4. Prompts whether to keep or delete the workspace

Requirements

  • Python 3.10+
  • Claude Code installed and in PATH
  • Jujutsu (jj) installed and in PATH
  • Must be run from inside a jj repository
  • Watchman (highly recommended) - enables automatic snapshotting across workspaces

Watchman Setup

Without Watchman: Snapshotting becomes a manual step. jj only captures file changes when you explicitly run a jj command (like jj status). Changes made by Claude in agent workspaces remain invisible until you manually trigger a snapshot. With multiple agents working in parallel, this makes it impossible to monitor their progress in real-time.

With Watchman: Snapshotting is automatic. jj captures every file change instantly. You can monitor all agent workspaces from your main workspace via jj log and see their work as it happens.

  1. Install Watchman
  2. Enable in jj config (~/.config/jj/config.toml):
    [fsmonitor]
    backend = "watchman"
    watchman.register-snapshot-trigger = true
    
  3. Verify: jj debug watchman status

Installation

# Using uvx (recommended)
uvx kekkai

# Or install with pip
pip install kekkai

For development:

git clone https://github.com/yum0e/kekkai
cd kekkai
uv run kekkai --help

How It Works

Workspace Location

Agent workspaces are created as siblings to your repository:

/Users/dev/
├── myproject/               <- Your repository
└── myproject-feature-auth/  <- Agent workspace

This structure enables:

  • Full copy: Agent workspaces get a complete copy of the repository including .claude/
  • Better visibility: Workspaces are easily accessible, not hidden in .jj/
  • Clean jj status: Kekkai markers are auto-ignored by jj

Workspace Isolation

Each agent runs in its own jj workspace with:

  • Separate revision: Changes don't affect your main workspace
  • Git shim: Blocks git commands, forcing jj usage
  • Scoped root: Claude sees only the workspace as project root
  • Marker file: .jj/kekkai-agent identifies agent workspaces (auto-ignored)

Multi-Agent Workflow

Run multiple agents by opening multiple terminals:

# Terminal 1
kekkai feature-auth

# Terminal 2
kekkai bugfix-login

# Terminal 3
kekkai refactor-api

You can even run kekkai from inside an agent workspace - it will create a new sibling to the original root.

Version Control

Use jj directly in your default workspace to manage agent changes:

# See what agents have changed
jj log

# Squash an agent's changes
jj squash --from <agent-revision>

# Rebase agents on latest
jj rebase -s <agent-revision> -d @

Development

# Run tests
uv run --with pytest pytest tests/ -v

# Run the CLI
uv run kekkai --help

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kekkai-0.1.0.tar.gz (20.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kekkai-0.1.0-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

Details for the file kekkai-0.1.0.tar.gz.

File metadata

  • Download URL: kekkai-0.1.0.tar.gz
  • Upload date:
  • Size: 20.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for kekkai-0.1.0.tar.gz
Algorithm Hash digest
SHA256 48b3553dcc84a9b6bc46c630c8266fcaa459ceb03f714db9a2f08c199d956813
MD5 18b078a6c0fb597404bcbba477b63aee
BLAKE2b-256 948107baed943ef2b11b12eba9df3d6728e8d895742feb1f20ae823e5dec3e47

See more details on using hashes here.

File details

Details for the file kekkai-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: kekkai-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for kekkai-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b1b105cdc7c78237614ce0f882f41446dffee33e46cd440285a8aaf9f501c316
MD5 586e110e66d71eabaa60e39934f9b4fd
BLAKE2b-256 d754357438c36b6203be95861865745289c4e55236e65e4357a819ceb6fbc306

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page