namegen

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 14, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package namegen replicates the worktree name generator used by Claude Code (claude --worktree). The logic and vocabulary are extracted verbatim from the bundled JavaScript in the claude binary (v2.1.139, module `ruH`).

The original JS:

function Zk1(H){ return crypto.randomBytes(4).readUInt32BE(0) % H }
function $5_(H){ return H[Zk1(H.length)] }
function ll_(){
  let H=$5_(X09), _=$5_(Gk1), q=$5_(P09);
  return `${H}-${_}-${q}`;
}
function iuH(){ return `${$5_(X09)}-${$5_(P09)}` }

Index

Constants

This section is empty.

Variables

View Source
var Adjectives = []string{}/* 219 elements not displayed */

Adjectives is the X09 array from the claude binary.

View Source
var Nouns = []string{}/* 409 elements not displayed */

Nouns is the P09 array from the claude binary (nature, animals, objects, and computer scientists' surnames).

View Source
var Verbs = []string{}/* 109 elements not displayed */

Verbs is the Gk1 array from the claude binary (gerunds).

Functions

func Generate

func Generate() string

Generate returns a three-word name in the form "adjective-verb-noun", e.g. "dreamy-foraging-hickey". Equivalent to claude's `ll_()`.

func GenerateShort

func GenerateShort() string

GenerateShort returns a two-word name in the form "adjective-noun". Equivalent to claude's `iuH()`.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL