{"id":50834868,"url":"https://github.com/jclem/work-old-2","last_synced_at":"2026-06-14T02:31:24.670Z","repository":{"id":339098982,"uuid":"1159484383","full_name":"jclem/work-old-2","owner":"jclem","description":"Instant, isolated git worktrees for every task","archived":false,"fork":false,"pushed_at":"2026-02-20T22:34:05.000Z","size":272,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-25T08:39:55.879Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jclem.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-02-16T19:34:06.000Z","updated_at":"2026-02-22T15:00:38.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/jclem/work-old-2","commit_stats":null,"previous_names":["jclem/work"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/jclem/work-old-2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jclem%2Fwork-old-2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jclem%2Fwork-old-2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jclem%2Fwork-old-2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jclem%2Fwork-old-2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jclem","download_url":"https://codeload.github.com/jclem/work-old-2/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jclem%2Fwork-old-2/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34307683,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-14T02:00:07.365Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-14T02:31:24.546Z","updated_at":"2026-06-14T02:31:24.663Z","avatar_url":"https://github.com/jclem.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# work\n\nDelegate coding tasks to AI agents, each in its own isolated git worktree. No\nstashing, no branch juggling, no waiting.\n\n`work` manages git worktrees and AI agent sessions so you can describe what you\nwant and let agents solve it in parallel.\n\n```\n$ work new \"fix the off-by-one error in the pagination logic\"\n✓ Started session 42 (attempt 1) on branch 2026-02-19-bold-lark\n```\n\n## Highlights\n\n- **Session-based workflow** -- describe an issue and spawn parallel agent sessions\n- **Isolated worktrees** -- every session and task gets its own directory and branch\n- **Parallel agents** -- start multiple attempts on the same issue with `--agents N`\n- **Interactive TUI** -- monitor all sessions, view logs, and manage projects from a dashboard\n- **Pre-warmed pool** -- large repos stay fast because worktrees are created in the background\n- **Post-creation hooks** -- run setup scripts (`npm install`, etc.) automatically after creating a worktree\n- **Custom branch naming** -- use any script (including LLMs) to generate worktree/branch names\n- **Resource-aware** -- pool pre-warming backs off when CPU or memory is under pressure\n\n## Install\n\n**With [mise](https://mise.jdx.dev):**\n\n```bash\nmise use -g github:jclem/work\n```\n\n**From source:**\n\n```bash\ncargo install --path .\n```\n\n## Quick start\n\n```bash\n# Initialize your shell (add to your shell config)\neval \"$(work init zsh)\"   # or bash, fish\n\n# Start the daemon\nwork daemon start --detach\n\n# On macOS, install as a Launch Agent for auto-start:\nwork daemon install\n\n# Register a project\ncd ~/src/my-project\nwork projects create\n\n# Start your first session\nwork new \"add input validation to the signup form\"\n```\n\n## Recommended workflow\n\nThe fastest way to use `work` day-to-day:\n\n### 1. Keep the TUI open\n\nBind `work tui` to a hotkey in your terminal or window manager so you always\nhave a dashboard one keypress away. The TUI auto-refreshes and shows every\nsession across all projects.\n\n```bash\nwork tui          # launch the TUI dashboard\nwork ui           # alias\n```\n\n### 2. Start sessions with `work new`\n\nDescribe what you want done. The agent handles branching, coding, and opening a\ndraft PR.\n\n```bash\nwork new \"fix the login redirect after password reset\"\nwork new \"fix the login redirect after password reset\" --name hotfix-login-redirect\n```\n\nFor hard problems, run multiple agents in parallel and let them race:\n\n```bash\nwork new \"refactor the query builder to support joins\" --agents 3\n```\n\nIf you omit the issue text, `work new` opens your `$EDITOR` so you can write a\nlonger description. You can also pipe from stdin:\n\n```bash\ngh issue view 42 --json body -q .body | work new\n```\n\n### 3. Monitor progress in the TUI\n\nSwitch to the TUI to watch sessions as they work. Key actions:\n\n| Key | Action |\n|-----|--------|\n| `Enter` | View session details and report |\n| `Ctrl+L` | View live session logs |\n| `Ctrl+P` | Open the session's PR in a browser |\n| `x` | Stop a running session |\n| `s` | Start a new session |\n\n### 4. Clean up\n\n```bash\nwork delete 43     # remove a session and its worktree\n```\n\n## Concepts\n\n### Projects\n\nA **project** is a registered git repository. Register one with\n`work projects create` from inside the repo (or pass a path). All worktrees and\nsessions for that project are tracked together.\n\n### Tasks\n\nA **task** is a plain git worktree for manual development -- no agent attached.\nCreate one with `work task new` when you want to work on something yourself.\nEach task gets an auto-generated name like `2026-02-19-bold-lark` (or you can\nchoose your own) and a dedicated branch.\n\n### Sessions\n\nA **session** is an AI agent attempt at solving an issue. Sessions are the core\nunit of `work`. Each session:\n\n- Gets its own worktree and branch\n- Runs an agent that writes code and opens a draft PR\n- Produces a report summarizing what was done\n- Has a status: `planned` → `running` → `reported`\n\nMultiple sessions can target the same issue (parallel attempts). Review them\nin the TUI.\n\n### Issues\n\nAn **issue** is freeform text describing what you want done. It can be a\nsentence, a paragraph, or a GitHub issue body piped from `gh`. Issues are\nstored with their sessions, not as standalone entities.\n\n## Shell setup\n\n`work` needs a shell wrapper to `cd` into new worktrees. Add one of these to\nyour shell config:\n\n**fish** (in `~/.config/fish/config.fish`):\n```fish\nwork init fish | source\n```\n\n**zsh** (in `~/.zshrc`):\n```zsh\neval \"$(work init zsh)\"\n```\n\n**bash** (in `~/.bashrc`):\n```bash\neval \"$(work init bash)\"\n```\n\nFor completions:\n\n```bash\neval \"$(work completions zsh)\"    # or bash, fish\n```\n\n## Usage\n\n### Sessions\n\n```bash\n# Start sessions\nwork new \"fix the bug\"            # Start a session (aliases: start, create)\nwork new                          # Opens $EDITOR for the issue description\nwork new --agents 3               # Start 3 parallel sessions\nwork new \"fix the bug\" --name hotfix-login   # Set the task/branch name (requires --agents 1)\nwork new --project my-project     # Target a specific project\n\n# List and inspect\nwork list                         # List sessions in the current project\nwork list --all                   # List sessions across all projects\nwork list --json                  # JSON output\nwork ls                           # Alias for list\nwork show 42                      # Show session details and report\nwork tree                         # Show a tree of all projects, tasks, and sessions\n\n# Monitor\nwork logs 42                      # View session output\nwork logs 42 --follow             # Tail output in real time (like tail -f)\n\n# Act on results\nwork stop 42                      # Stop a running session\nwork pr 42                        # Open the session's PR in a browser\nwork open 42                      # cd into the session's worktree\n\n# Clean up\nwork delete 42                    # Delete session and its worktree\n```\n\n### Tasks\n\nTasks are worktrees for manual work, not agent sessions.\n\n```bash\nwork task new                     # Create a task (auto-named)\nwork task new fix-login           # Create a named task\nwork task new -b existing-branch  # Use an existing branch\nwork task new --no-cd             # Create without cd-ing into it\n\nwork task list                    # List tasks in the current project\nwork task list --all              # List tasks across all projects\n\nwork task delete fix-login        # Delete a task\nwork task rm fix-login --force    # Force delete with uncommitted changes\n\nwork cd my-task                   # cd to a task's worktree\nwork cd                           # cd to the project root\n```\n\n### Projects\n\n```bash\nwork projects create              # Register current directory\nwork projects create /path/to/repo --name my-project\n\nwork projects list                # List all registered projects\nwork projects ls --json           # JSON output\n\nwork projects delete my-project   # Delete project and its worktrees\n```\n\n### TUI dashboard\n\n```bash\nwork tui                          # Launch the TUI (alias: work ui)\nwork tui --interval 10            # Custom refresh interval (seconds)\n```\n\nThe TUI has three tabs:\n\n**Sessions** -- View and manage all agent sessions.\n\n| Key | Action |\n|-----|--------|\n| `s` | Start a new session |\n| `Enter` | View session details |\n| `Ctrl+L` | View session logs |\n| `Ctrl+P` | Open PR in browser |\n| `x` | Stop session |\n| `d` | Delete session |\n| `` ` `` | Toggle tree/flat view |\n| `e` | Toggle empty projects |\n\n**Tasks** -- View and manage worktrees.\n\n| Key | Action |\n|-----|--------|\n| `n` / `c` | Create new task |\n| `d` / `Delete` | Delete task |\n| `N` | Nuke all tasks |\n| `P` | Clear pool worktrees |\n\n**Daemon** -- View daemon status and control it.\n\n| Key | Action |\n|-----|--------|\n| `s` | Start daemon |\n| `x` | Stop daemon |\n| `R` | Restart daemon |\n\n**Global keys:**\n\n| Key | Action |\n|-----|--------|\n| `?` | Toggle help overlay |\n| `Tab` / `]` / `[` | Switch tabs |\n| `1` / `2` / `3` | Jump to tab |\n| `↑` `↓` / `k` `j` | Navigate |\n| `F5` | Refresh |\n| `q` / `Esc` | Quit |\n\n### Daemon\n\n```bash\nwork daemon start                 # Start (foreground by default)\nwork daemon start --detach        # Run in the background\nwork daemon start --force         # Replace an already-running daemon\nwork daemon stop                  # Stop\nwork daemon restart               # Restart\nwork daemon logs                  # Print daemon logs\nwork daemon logs --follow         # Follow daemon logs (tail -f)\nwork daemon logs path             # Print daemon log path\nwork daemon pid                   # Print PID\nwork daemon socket-path           # Print socket path\nwork daemon install               # Install as a Launch Agent (macOS)\nwork daemon uninstall             # Uninstall the Launch Agent\n```\n\n### Diagnostics\n\n```bash\nwork doctor                       # Check system health (database, daemon, projects, sessions)\nwork tree                         # Show a tree of all projects, tasks, and sessions\n```\n\n## Configuration\n\nGlobal config lives at `~/.config/work/config.toml`. Per-project config lives\nat `.work/config.toml` in the project root (takes priority).\n\n```toml\n# ~/.config/work/config.toml\n\n# Default branch for new worktrees (default: \"main\")\ndefault-branch = \"main\"\n\n# Per-project settings\n[projects.my-large-repo]\ndefault-branch = \"develop\"\npool-size = 2                     # Pre-warm 2 worktrees (default: 0, disabled)\n\n[projects.my-large-repo.hooks]\nnew-after = \"\"\"\n#!/bin/bash\nnpm install\n\"\"\"\n\n# Custom branch name generator (uses any interpreter via shebang)\n# task-name-command = \"\"\"\n# #!/bin/sh\n# echo \"$WORK_ISSUE\" | llm -s 'Output a short kebab-case branch name.'\n# \"\"\"\n\n# Daemon resource thresholds\n[daemon]\npool-max-load = 0.7              # Back off when load \u003e 70% of CPU count\npool-min-memory-pct = 10         # Back off when available memory \u003c 10%\npool-poll-interval = 300         # Seconds between pool checks (default: 5 min)\n```\n\nPer-project `.work/config.toml` uses the same keys without the\n`[projects.\u003cname\u003e]` wrapper:\n\n```toml\n# my-project/.work/config.toml\ndefault-branch = \"develop\"\npool-size = 3\n\n[hooks]\nnew-after = \"\"\"\n#!/bin/bash\nnpm install\n\"\"\"\n```\n\nOpen the config in your editor:\n\n```bash\nwork config edit\n```\n\nSee [docs/CONFIGURATION.md](docs/CONFIGURATION.md) for the full configuration\nreference, including all daemon, orchestrator, TUI, and environment variable\nsettings.\n\n## How it works\n\n### Session lifecycle\n\nWhen you run `work new \"fix the bug\"`:\n\n1. The issue text is captured (from the argument, `$EDITOR`, or stdin)\n2. A session record is created in the database with status `planned`\n3. The daemon picks up the session, creates a worktree and branch, and spawns an agent\n4. The agent works in the worktree: reads code, makes changes, opens a draft PR\n5. When the agent finishes, the session moves to `reported` with a summary\n6. You review the result and manage the session as needed\n\nSession statuses:\n\n| Status | Meaning |\n|--------|---------|\n| `planned` | Created, waiting to start |\n| `running` | Agent is actively working |\n| `reported` | Agent finished with a report |\n| `stopped` | You stopped the agent |\n| `failed` | The agent encountered an error |\n\n### Worktrees\n\nWorktrees live at `$XDG_DATA_HOME/work/\u003cproject\u003e/worktrees/\u003ctask\u003e/`\n(default: `~/.local/share/work/...`). Each session and task gets a worktree\nwith its own branch, completely isolated from your main checkout.\n\n### Pre-warm pool\n\nIn large repos, `git worktree add` is slow. The pool system pre-creates\nworktrees in the background so they're ready when you need them. Pre-warming is\nopt-in: set `pool-size` in your config to enable it.\n\nThe daemon fills the pool:\n- On startup\n- After a session or task claims a pool entry\n- Every `pool-poll-interval` seconds (default: 5 min)\n\nPool worktrees use temporary `__pool-*` branch names. When claimed, the branch\nis renamed and the directory is moved -- no extra `git worktree add` needed.\n\nSee [docs/POOL.md](docs/POOL.md) for full details.\n\n### Daemon\n\nThe daemon is an HTTP server over a Unix domain socket. It runs background\nworkers for:\n\n- **Session management** -- spawning and monitoring agent processes\n- **Deletion** -- processing `work delete` requests asynchronously\n- **Pool maintenance** -- keeping pre-warmed worktrees filled, respecting CPU and memory thresholds\n\nSocket location:\n- `$XDG_RUNTIME_DIR/work/workd.sock` (when `XDG_RUNTIME_DIR` is set)\n- `/tmp/work/workd.sock` (fallback)\n\nOverride with `work daemon start --socket /path/to/workd.sock` or the\n`WORKD_SOCKET_PATH` environment variable.\n\n## File locations\n\n| File | Default path |\n|------|-------------|\n| Database | `~/.local/share/work/database.sqlite` |\n| Global config | `~/.config/work/config.toml` |\n| Daemon socket | `$XDG_RUNTIME_DIR/work/workd.sock` (or system temp dir fallback) |\n| Daemon PID | `$XDG_RUNTIME_DIR/work/workd.pid` (or system temp dir fallback) |\n| Daemon log | `$XDG_RUNTIME_DIR/work/workd.log` (or system temp dir fallback) |\n| Worktrees | `~/.local/share/work/\u003cproject\u003e/worktrees/\u003ctask\u003e/` |\n\nAll paths respect `XDG_DATA_HOME`, `XDG_CONFIG_HOME`, and `XDG_RUNTIME_DIR`.\n\n## Output conventions\n\n- Machine-readable values (e.g. `daemon socket-path`) print to **stdout**\n- Status messages, warnings, and errors print to **stderr**\n- Use `--json` for structured output, `--plain` for tab-separated values\n\n## Development\n\n```bash\ncargo build                       # Build\ncargo test                        # Run tests\ncargo fmt --check                 # Check formatting\ncargo clippy --all-targets --all-features -- -D warnings  # Lint\n```\n\nOr with [mise](https://mise.jdx.dev):\n\n```bash\nmise run check                    # Run all checks (fmt + clippy)\nmise run test                     # Run tests\nmise run dev                      # Start the daemon in dev mode\nmise run fix                      # Auto-fix formatting and lint issues\nmise run release:local            # Build release binary and install to /usr/local/bin\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjclem%2Fwork-old-2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjclem%2Fwork-old-2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjclem%2Fwork-old-2/lists"}