explaingit

whoamihappyhacking/di

11GoAudience · developerComplexity · 2/5ActiveSetup · easy

TLDR

Small Go command line tool that runs detachable terminal sessions over a Unix socket, with an fzf picker for rejoining sessions later on Linux and macOS.

Mindmap

mindmap
  root((di))
    Inputs
      Shell commands
      Working directory
      Detach key
    Outputs
      Persistent sessions
      Session list
      Reattached terminal
    Use Cases
      Detach long jobs
      Resume agent CLIs
      Pick sessions with fzf
    Tech Stack
      Go
      Unix sockets
      fzf

Things people build with this

USE CASE 1

Run a long agent like codex --yolo in a detachable terminal session

USE CASE 2

Resume a session from another terminal using the fzf picker

USE CASE 3

Detach a client remotely with d --detach and a session name

USE CASE 4

Keep separate sessions in the same directory by running the command twice

Tech stack

Gofzf

Getting it running

Difficulty · easy Time to first run · 5min

Needs fzf on PATH for the session picker, and ~/.local/bin on PATH after running ./di install.

In plain English

di is a small command-line tool, written in Go, for running terminal sessions that you can disconnect from and rejoin later. The repository description calls it a tiny wrapper around dtach, but the README clarifies that it does not actually depend on dtach. Instead, di manages the pseudo-terminal and a Unix socket on its own using only Go code. The tool ships as two command names that point to the same binary. The d command starts and controls sessions, while the di name opens a picker for existing sessions. The picker uses fzf, so the README asks you to install fzf and make sure it is on your PATH. Starting a new session or listing sessions does not need fzf. Installation is direct. You clone the repository, run go build to produce the di binary, and then run ./di install. That step places d under ~/.local/bin and creates a di symlink next to it, so you need to have ~/.local/bin on your PATH. Daily use is a short set of commands. You start a session by running d followed by the command you want to run inside it, for example d codex --yolo. Pressing Ctrl-] detaches the front-end while the back-end command keeps running. The mouse wheel is not forwarded to the back-end program so that you can scroll the terminal's own history buffer. Running di on its own shows a list of running sessions, including the directory and command each was started from, and lets you pick one to rejoin. Running the same command twice in the same directory creates a fresh session each time rather than sharing one. You can also detach a client from another terminal with d --detach and a session name, or change the detach key for one run by setting the D_DETACH environment variable. The README is honest about what di does not do. It builds on Linux and macOS, including Apple Silicon and Intel builds. It only solves the problem of leaving and rejoining a terminal session. It is not a checkpoint tool, and it does not save process memory, file system snapshots, or network connection state.

Copy-paste prompts

Prompt 1
Walk me through cloning di, running go build, and installing it under ~/.local/bin
Prompt 2
Show me how to start a detachable codex --yolo session with d and rejoin it later via di
Prompt 3
Explain how di manages pseudo-terminals and Unix sockets without depending on dtach
Prompt 4
Help me change the detach key for one run using the D_DETACH environment variable
Open on GitHub → Explain another repo

Generated 2026-05-22 · Model: sonnet-4-6 · Verify against the repo before relying on details.