npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

aifork

v0.1.1

Published

Fan out a single prompt to multiple AI agent CLIs in parallel, isolated git worktrees

Downloads

123

Readme

aifork

AI Agent Multiplexer — fan out a single prompt to multiple AI coding agents in parallel, each working in an isolated git worktree.

What it does

aifork takes a prompt and runs it against multiple AI agent CLIs simultaneously (Claude Code, Codex, Gemini, Kiro). Each agent works in its own isolated git worktree so they don't interfere with each other. When complete, aifork generates patch files from each agent's changes for review and selective application.

Interactive mode (default): opens a tmux session with one pane per agent so you can watch and interact with each one live.

Non-interactive mode (--p): sends the prompt directly to each agent and runs them as background processes, collecting patch output when done.

Requirements

  • Git (required)
  • tmux (required for interactive mode)
  • One or more AI agent CLIs installed: claude, codex, gemini, kiro-cli
    • Missing agents are skipped automatically

Installation

npm install -g aifork

Usage

aifork [prompt] [options]

Or using npx:

npx aifork [prompt] [options]

Examples

# Interactive mode — opens tmux with all available agents
aifork "Add input validation to the login form"

# Non-interactive — run agents headlessly, collect patches
aifork --print "Fix the null pointer exception in main.js"

# Specific agents only
aifork --agents claude,gemini "Refactor the auth module"

# Load prompt from file
aifork --print --prompt-file prompt.txt

# Non-interactive without tmux (background processes)
aifork --print --no-tmux "Add unit tests for the API layer"

# Keep worktrees after completion for manual inspection
aifork --keep-worktrees "Implement the caching layer"

# Custom patch output directory
aifork --print --output-dir ./patches "Add TypeScript types"

Flags

| Flag | Description | |------|-------------| | --agents <ids> | Comma-separated list of agent IDs to run (e.g. claude,codex). Defaults to all available agents. | | --prompt-file <file> | Load prompt from a file instead of the command line argument. | | -p, --print | Non-interactive mode — pass the prompt directly to each agent and collect output. Required when using --no-tmux. | | --no-tmux | Run agents as background processes instead of tmux panes. Only valid with --print. | | --keep-worktrees | Keep worktrees and branches after completion instead of cleaning up. Useful for debugging. | | --output-dir <dir> | Directory for patch output files. Default: .aifork-output |

Supported Agents

| ID | Name | CLI Command | |----|------|-------------| | claude | Claude Code | claude | | codex | Codex | codex | | gemini | Gemini | gemini | | kiro | Kiro | kiro-cli |

Configuration

aifork loads config from (in order, later values override earlier):

  1. Defaults
  2. ~/.aifork.json / ~/.aifork.yaml — global config
  3. ./.aifork.json / ./.aifork.yaml — repo-local config
  4. CLI flags

Config Schema

{
  "agents": {
    "claude": {
      "enabled": true,
      "extraFlags": []
    },
    "codex": {
      "enabled": true,
      "extraFlags": []
    },
    "gemini": {
      "enabled": true,
      "extraFlags": []
    },
    "kiro": {
      "enabled": true,
      "extraFlags": []
    }
  },
  "keepWorktrees": false,
  "tmux": {
    "layout": "tiled",
    "sessionPrefix": "aifork"
  },
  "patchOutputDir": ".aifork-output"
}

Config Options

| Option | Type | Default | Description | |--------|------|---------|-------------| | agents.<id>.enabled | boolean | true | Enable or disable a specific agent | | agents.<id>.extraFlags | string[] | [] | Extra CLI flags to pass to the agent | | keepWorktrees | boolean | false | Keep worktrees after completion | | tmux.layout | string | "tiled" | tmux pane layout: tiled, even-horizontal, even-vertical, main-horizontal, main-vertical | | tmux.sessionPrefix | string | "aifork" | Prefix for tmux session names | | patchOutputDir | string | ".aifork-output" | Output directory for .patch files |

Example: disable an agent globally

~/.aifork.json:

{
  "agents": {
    "kiro": { "enabled": false }
  }
}

Example: pass extra flags to Claude

.aifork.json:

{
  "agents": {
    "claude": {
      "extraFlags": ["--model", "claude-opus-4-6"]
    }
  }
}

Output

Patch files are written to .aifork-output/ (or --output-dir):

.aifork-output/
  aifork-claude.patch
  aifork-codex.patch
  aifork-gemini.patch

Apply a patch:

git apply .aifork-output/aifork-claude.patch

How it works

  1. Validates the current git repository
  2. Creates an isolated git worktree per agent (siblings to the repo root)
  3. Runs each agent with the prompt in its worktree
  4. Waits for all agents to complete
  5. Generates a .patch file from each worktree's changes
  6. Cleans up worktrees and branches (unless --keep-worktrees)