### Installing and Running worktrunk-sync
Source: https://github.com/max-sixty/worktrunk/blob/main/docs/content/extending.md
Example of installing and running a custom subcommand 'worktrunk-sync' which rebases stacked worktree branches.
```bash
cargo install worktrunk-sync
wt sync
```
--------------------------------
### Quick Start Benchmark Commands
Source: https://github.com/max-sixty/worktrunk/blob/main/benches/CLAUDE.md
Examples of common commands to run benchmarks with Criterion. Use filters to select specific benchmark groups or scenarios.
```bash
cargo bench --bench list skeleton/warm
```
```bash
cargo bench --bench list full
```
```bash
cargo bench --bench list real_repo_many_branches
```
```bash
cargo bench --bench list
```
```bash
cargo bench --bench time_to_first_output
```
```bash
cargo bench --bench time_to_first_output remove
```
```bash
cargo bench --bench picker_preview
```
```bash
cargo bench --bench picker_preview warm
```
--------------------------------
### Install Task
Source: https://github.com/max-sixty/worktrunk/blob/main/tests/CLAUDE.md
Install the 'task' command-line tool. This is a prerequisite for running 'task setup-web'. The command downloads and installs the tool to ~/bin.
```bash
sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b ~/bin
```
--------------------------------
### Configure Project Hooks
Source: https://github.com/max-sixty/worktrunk/blob/main/skills/worktrunk/SKILL.md
Example TOML configuration for setting up various project hooks, including dependency installation, linting, type checking, and testing.
```toml
# Install dependencies when creating worktrees
pre-start = "npm install"
# Validate code quality before committing
[pre-commit]
lint = "npm run lint"
typecheck = "npm run typecheck"
# Run tests before merging
pre-merge = "npm test"
```
--------------------------------
### Project Configuration Example
Source: https://github.com/max-sixty/worktrunk/blob/main/docs/content/config.md
Example of a project configuration file (`.config/wt.toml`) defining pre-start and pre-merge hooks for build and test processes.
```toml
# .config/wt.toml
[pre-start]
deps = "npm ci"
[pre-merge]
test = "npm test"
```
--------------------------------
### Setting Environment Variable with Defaults
Source: https://github.com/max-sixty/worktrunk/blob/main/docs/content/hook.md
This example shows how to set an environment variable for starting a development server, utilizing default values for nested configuration variables. It uses the `default` filter to provide fallback values for `vars.env` and `vars.config.port` if they are not defined.
```toml
[post-start]
dev = "ENV={{ vars.env | default('development') }} npm start -- --port {{ vars.config.port | default('3000') }}"
```
--------------------------------
### User Configuration Example
Source: https://github.com/max-sixty/worktrunk/blob/main/docs/content/config.md
Example of a user configuration file (`~/.config/worktrunk/config.toml`) specifying the worktree path template and LLM commit generation settings.
```toml
# ~/.config/worktrunk/config.toml
worktree-path = ".worktrees/{{ branch | sanitize }}"
[commit.generation]
command = "MAX_THINKING_TOKENS=0 claude -p --no-session-persistence --model=haiku --tools='' --safe-mode --setting-sources='user' --system-prompt=''
```
--------------------------------
### Create Initial Worktrunk User Configuration
Source: https://github.com/max-sixty/worktrunk/blob/main/skills/worktrunk/SKILL.md
Run this command to set up the initial user configuration for Worktrunk, which includes LLM and commit setup. Refer to reference/llm-commits.md for detailed setup instructions.
```bash
# Create initial user config (LLM/commit setup: see reference/llm-commits.md)
wt config create
```
--------------------------------
### Markdown Example: Good Intro
Source: https://github.com/max-sixty/worktrunk/blob/main/src/commands/CLAUDE.md
Provides an example of a well-written documentation intro that clearly describes the command's behavior without assuming user intent. This serves as a model for effective command introductions.
```markdown
# Good — describes what it does
Show all worktrees with their status.
```
--------------------------------
### Markdown Example: Good Intro with Detail
Source: https://github.com/max-sixty/worktrunk/blob/main/src/commands/CLAUDE.md
An example of a good introductory paragraph for command documentation, detailing the command's functionality and key behavioral distinctions. It adheres to the principle of describing what the command does.
```markdown
Navigate between worktrees or create new ones. Switching to an existing
worktree is just a directory change. With `--create`, a new branch and
worktree are created, and hooks run.
```
--------------------------------
### Install Shell Integration
Source: https://github.com/max-sixty/worktrunk/blob/main/docs/static/config.md
Run this command to install shell integration, which is required for directory switching functionality.
```bash
$ wt config shell install
```
--------------------------------
### Example Correct Aliases
Source: https://github.com/max-sixty/worktrunk/blob/main/skills/worktrunk/reference/shell-integration.md
These examples show how to correctly configure aliases to use the Worktrunk shell function, ensuring shell integration works.
```bash
alias gwt="wt" # Good - uses the shell function
alias gwt="git-wt" # Good - uses the shell function
```
--------------------------------
### Manual Fish Installation
Source: https://github.com/max-sixty/worktrunk/blob/main/skills/worktrunk/reference/shell-integration.md
Pipe this command to source in your ~/.config/fish/config.fish for manual Fish integration.
```fish
wt config shell init fish | source
```
--------------------------------
### Install Worktrunk with Pixi
Source: https://github.com/max-sixty/worktrunk/blob/main/README.md
Install Worktrunk globally using Pixi, followed by shell integration.
```bash
pixi global install worktrunk && wt config shell install
```
--------------------------------
### Install OpenCode Worktrunk Plugin
Source: https://github.com/max-sixty/worktrunk/blob/main/docs/content/claude-code.md
Installs the Worktrunk activity-tracking plugin to OpenCode's global plugins directory using the wt CLI.
```bash
wt config plugins opencode install
```
--------------------------------
### Rendering Code Examples in Markdown
Source: https://github.com/max-sixty/worktrunk/blob/main/docs/CLAUDE.md
Shows how HTML comments and code blocks in Rust source are used to render command examples in different documentation outputs.
```rust
```console
wt list
```
```
--------------------------------
### Install ffmpeg with libass using Homebrew
Source: https://github.com/max-sixty/worktrunk/blob/main/docs/demos/CLAUDE.md
Installs ffmpeg from source using Homebrew, ensuring libass is included for keystroke overlay functionality. This is necessary because the default Homebrew formula omits libass.
```bash
HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source ffmpeg
```
--------------------------------
### Manual Zsh Installation
Source: https://github.com/max-sixty/worktrunk/blob/main/skills/worktrunk/reference/shell-integration.md
Add this command to your ~/.zshrc file for manual Zsh integration.
```zsh
eval "$(wt config shell init zsh)"
```
--------------------------------
### Testing CLAUDE with Cargo and Installed wt
Source: https://github.com/max-sixty/worktrunk/blob/main/src/commands/CLAUDE.md
Demonstrates how to test the CLAUDE command using `cargo run` for local development and with an installed `wt` binary, utilizing the `-C` flag to set the working directory.
```bash
# Testing with cargo run (already uses local source):
cargo run --quiet -- -C /path/to/repo switch
# Testing with installed wt:
wt --source -C /path/to/repo switch
```
--------------------------------
### Manual Bash Installation
Source: https://github.com/max-sixty/worktrunk/blob/main/skills/worktrunk/reference/shell-integration.md
Add this command to your ~/.bashrc file for manual Bash integration.
```bash
eval "$(wt config shell init bash)"
```
--------------------------------
### TOML Configuration for Hooks
Source: https://github.com/max-sixty/worktrunk/blob/main/docs/content/extending.md
Example TOML configuration defining pre- and post- hooks for lifecycle events. The `deps` hook runs before starting, `server` runs after starting with a templated port, and `test` runs before merging.
```toml
[pre-start]
deps = "npm ci"
[post-start]
server = "npm run dev -- --port {{ branch | hash_port }}"
[pre-merge]
test = "npm test"
```
--------------------------------
### Start Tmux Session by Branch Name
Source: https://github.com/max-sixty/worktrunk/blob/main/docs/content/switch.md
This template example demonstrates starting a new tmux session named after the current branch. The '{{ branch | sanitize }}' filter ensures the branch name is safe for use as a session name.
```bash
-x tmux -- new -s '{{ branch | sanitize }}'
```
--------------------------------
### Setup Test Environment
Source: https://github.com/max-sixty/worktrunk/blob/main/src/commands/CLAUDE.md
Creates a reproducible test repository for debugging interactive commands. This command should be run from the `wt-perf` directory.
```bash
cargo run -p wt-perf -- setup picker-test
```
--------------------------------
### Manual Nushell Installation
Source: https://github.com/max-sixty/worktrunk/blob/main/skills/worktrunk/reference/shell-integration.md
Save the output of this command to the specified file in your vendor autoload directory for experimental Nushell integration.
```nu
wt config shell init nu | save -f ($nu.vendor-autoload-dirs | last | path join wt.nu)
```
--------------------------------
### Example Usage of wt-switch-create
Source: https://github.com/max-sixty/worktrunk/blob/main/skills/wt-switch-create/SKILL.md
Demonstrates various ways to invoke the wt-switch-create command with different arguments for branch, repository, and task.
```bash
/wt-switch-create my-feature -- fix the parser bug
```
```bash
/wt-switch-create -- fix the parser bug
```
```bash
/wt-switch-create my-feature ~/workspace/other-repo -- fix the parser bug
```
```bash
/wt-switch-create my-feature
```
--------------------------------
### Set Up Project Configuration in Bare Repo
Source: https://github.com/max-sixty/worktrunk/blob/main/docs/content/tips-patterns.md
Create the project configuration file (.config/wt.toml) from within a worktree of a bare repository. This configuration is automatically applied to all worktrees.
```bash
cd myproject/main|||wt config create --project
```
--------------------------------
### Get Path to Specific Hook Log
Source: https://github.com/max-sixty/worktrunk/blob/main/docs/static/config.md
Retrieve the absolute path to a specific hook log file using JSON output and `jq` filtering. This example selects the `post-start` `server` hook for the current branch.
```bash
$ wt config state logs --format=json | jq -r '.hook_output[] | select(.source == "user" and .hook_type == "post-start" and (.name | startswith("server"))) | .path'
```
--------------------------------
### Analyze Critical Path Phase Durations
Source: https://github.com/max-sixty/worktrunk/blob/main/benches/CLAUDE.md
Measures the time between key milestones (e.g., 'Skeleton rendered', 'Parallel execution started', 'All results drained') to understand serial setup, parallel work, and finalization phases.
```bash
cat > /tmp/q.sql << 'EOF'
SELECT
name,
ROUND(ts/1e6, 1) as ms,
ROUND((ts - LAG(ts) OVER (ORDER BY ts))/1e6, 1) as phase_ms
FROM slice WHERE dur = 0
ORDER BY ts;
EOF
trace_processor trace.json -q /tmp/q.sql
```
--------------------------------
### Tmux Session per Worktree Configuration
Source: https://github.com/max-sixty/worktrunk/blob/main/docs/static/tips-patterns.md
Configure Worktrunk to create a dedicated tmux session for each worktree. This setup includes a multi-pane layout and starts predefined services in each pane. It requires the branch name and worktree path to be available as variables.
```toml
# .config/wt.toml
[pre-start]
tmux = """
S={{ branch | sanitize }}
W={{ worktree_path }}
tmux new-session -d -s "$S" -c "$W" -n dev
# Create 4-pane layout: shell | backend / claude | frontend
tmux split-window -h -t "$S:dev" -c "$W"
tmux split-window -v -t "$S:dev.0" -c "$W"
tmux split-window -v -t "$S:dev.2" -c "$W"
# Start services in each pane
tmux send-keys -t "$S:dev.1" 'npm run backend' Enter
tmux send-keys -t "$S:dev.2" 'claude' Enter
tmux send-keys -t "$S:dev.3" 'npm run frontend' Enter
tmux select-pane -t "$S:dev.0"
echo \"✓ Session '$S' — attach with: tmux attach -t $S\""
"
[pre-remove]
tmux = "tmux kill-session -t {{ branch | sanitize }} 2>/dev/null || true"
```
--------------------------------
### Set Up Benchmark Repository with wt-perf
Source: https://github.com/max-sixty/worktrunk/blob/main/benches/CLAUDE.md
Sets up a benchmark repository with a specified number of worktrees. The `--persist` flag ensures the repository remains after the command finishes. Available configurations include typical, branches, divergent, and mixed scenarios.
```bash
cargo run -p wt-perf -- setup typical-8 --persist
```
--------------------------------
### Cmux Workspace Management per Worktree
Source: https://github.com/max-sixty/worktrunk/blob/main/docs/content/tips-patterns.md
Configure worktrunk to manage cmux workspaces for each worktree. This includes creating a new workspace when a worktree starts, selecting the correct workspace when switching, and closing the workspace when a worktree is removed. Ensure jq is installed.
```toml
# ~/.config/worktrunk/config.toml
# cmux is the navigation primitive; don't also cd the invoking shell.
[switch]
cd = false
[pre-start]
cmux = "cmux new-workspace --name {{ repo | sanitize }}/{{ branch | sanitize }} --cwd {{ worktree_path }} --focus true"
[pre-switch]
cmux = """
WS=$(cmux --json list-workspaces 2>/dev/null \
| jq -r --arg t '{{ repo | sanitize }}/{{ branch | sanitize }}' \
'.workspaces[] | select(.title == $t) | .ref' | head -1)
[ -n \"$WS\" ] && cmux select-workspace --workspace \"$WS\" || true
"""
[pre-remove]
cmux = """
WS=$(cmux --json list-workspaces 2>/dev/null \
| jq -r --arg t '{{ repo | sanitize }}/{{ branch | sanitize }}' \
'.workspaces[] | select(.title == $t) | .ref' | head -1)
[ -n \"$WS\" ] && cmux close-workspace --workspace \"$WS\" || true
"""
```
--------------------------------
### Cmux Workspace per Worktree Configuration
Source: https://github.com/max-sixty/worktrunk/blob/main/docs/static/tips-patterns.md
Configure Worktrunk to manage cmux workspaces for each worktree. This setup ensures that switching worktrees also switches the active cmux workspace, and removing a worktree closes its corresponding workspace. Requires `jq` to be installed.
```toml
# ~/.config/worktrunk/config.toml
# cmux is the navigation primitive; don't also cd the invoking shell.
[switch]
cd = false
[pre-start]
cmux = "cmux new-workspace --name {{ repo | sanitize }}/{{ branch | sanitize }} --cwd {{ worktree_path }} --focus true"
[pre-switch]
cmux = """
WS=$(cmux --json list-workspaces 2>/dev/null \
| jq -r --arg t '{{ repo | sanitize }}/{{ branch | sanitize }}' \
'.workspaces[] | select(.title == $t) | .ref' | head -1)
[ -n "$WS" ] && cmux select-workspace --workspace "$WS" || true
"""
[pre-remove]
cmux = """
WS=$(cmux --json list-workspaces 2>/dev/null \
| jq -r --arg t '{{ repo | sanitize }}/{{ branch | sanitize }}' \
'.workspaces[] | select(.title == $t) | .ref' | head -1)
[ -n "$WS" ] && cmux close-workspace --workspace "$WS" || true
"""
```
--------------------------------
### Run `wt` with TestRepo Fixture
Source: https://github.com/max-sixty/worktrunk/blob/main/tests/CLAUDE.md
Use `repo.wt_command()` to get a pre-configured Command object for running `wt` commands within a `TestRepo` fixture. This ensures proper isolation. The first example shows a simple case, while the second demonstrates adding additional configuration like piped stdin.
```rust
let output = repo.wt_command()
.args(["switch", "--create", "feature"])
.output()?;
```
```rust
let mut cmd = repo.wt_command();
cmd.args(["switch", "--create", "feature"])
.stdin(Stdio::piped());
```
--------------------------------
### Create project configuration file
Source: https://github.com/max-sixty/worktrunk/blob/main/docs/content/faq.md
Use `wt config create --project` to generate the project-specific configuration file `.config/wt.toml`, which should be committed to the repository.
```bash
wt config create --project
```
--------------------------------
### Configure Blocking vs. Background Hooks
Source: https://github.com/max-sixty/worktrunk/blob/main/skills/worktrunk/reference/troubleshooting.md
Illustrates how to move long-running commands from blocking hooks (like `pre-start`) to background execution using `post-start` to improve performance.
```toml
# Before — blocks for minutes
pre-start = "npm run build"
# After — fast setup, build in background
pre-start = "npm install"
post-start = "npm run build"
```
--------------------------------
### Manual Installation of Claude Code Plugin
Source: https://github.com/max-sixty/worktrunk/blob/main/docs/static/claude-code.md
Manually installs the Worktrunk plugin for Claude Code by adding it to the plugin marketplace and then installing it. This is an alternative to the `wt config plugins claude install` command.
```bash
claude plugin marketplace add max-sixty/worktrunk
```
```bash
claude plugin install worktrunk@worktrunk
```
--------------------------------
### Run NPM Install in Each Worktree
Source: https://github.com/max-sixty/worktrunk/blob/main/docs/static/step.md
Executes 'npm install' in every worktree. Suitable for straightforward package installations.
```bash
$ wt step for-each -- npm install
```
--------------------------------
### Switching to Worktrees
Source: https://github.com/max-sixty/worktrunk/blob/main/skills/worktrunk/reference/switch.md
Use 'wt switch' to navigate to an existing worktree. Use '-' to switch to the previous worktree. Use '--create' to create a new branch and worktree.
```bash
$ wt switch feature-auth # Switch to worktree
$ wt switch - # Previous worktree (like cd -)
$ wt switch --create new-feature # Create new branch and worktree
$ wt switch --create hotfix --base production
$ wt switch pr:123 # Switch to PR #123's branch
$ wt switch https://github.com/owner/repo/pull/123 # ...or paste the PR's URL
```
--------------------------------
### Install Worktrunk on Windows with Winget
Source: https://github.com/max-sixty/worktrunk/blob/main/README.md
Install Worktrunk on Windows using Winget. This method installs Worktrunk as 'git-wt' to avoid conflicts with Windows Terminal.
```bash
winget install max-sixty.worktrunk
git-wt config shell install
```
--------------------------------
### Initialize Shell Integration Manually
Source: https://github.com/max-sixty/worktrunk/blob/main/docs/content/config.md
Use this command for manual setup of shell integration. Refer to the help output for detailed options.
```shell
wt config shell init --help
```
--------------------------------
### Install Worktrunk with Cargo
Source: https://github.com/max-sixty/worktrunk/blob/main/README.md
Install Worktrunk using Cargo, followed by shell integration.
```bash
cargo install worktrunk && wt config shell install
```
--------------------------------
### Create user configuration file
Source: https://github.com/max-sixty/worktrunk/blob/main/docs/content/faq.md
Use `wt config create` to generate the user-specific configuration file `~/.config/worktrunk/config.toml`.
```bash
wt config create
```
--------------------------------
### Install Worktrunk on Windows with Winget
Source: https://github.com/max-sixty/worktrunk/blob/main/docs/content/worktrunk.md
For Windows, use Winget to install Worktrunk. Due to a potential alias conflict with Windows Terminal, it's installed as 'git-wt'. Shell integration is configured using this alias.
```powershell
winget install max-sixty.worktrunk|||git-wt config shell install
```
--------------------------------
### Build Static Docs with Base URL
Source: https://github.com/max-sixty/worktrunk/blob/main/docs/CLAUDE.md
Use this command to build static documentation files. Replace PORT with the actual port number provided by `wt list statusline`.
```bash
zola build --base-url "http://127.0.0.1:PORT"
```
--------------------------------
### Configure Dev Server with Deterministic Port
Source: https://github.com/max-sixty/worktrunk/blob/main/docs/content/tips-patterns.md
Use the `post-start` hook to run a dev server on a port derived from the branch name using the `hash_port` filter. The `list.url` setting in `wt.toml` can then reference this port.
```toml
# .config/wt.toml
[post-start]
server = "wt step tether -- npm run dev -- --port {{ branch | hash_port }}"
[list]
url = "http://localhost:{{ branch | hash_port }}"
```
--------------------------------
### Create Project Configuration File
Source: https://github.com/max-sixty/worktrunk/blob/main/docs/static/config.md
Execute this command to create a project-specific configuration file (`.config/wt.toml`). This is typically used for project hooks and shared team settings.
```bash
$ wt config create --project
```
--------------------------------
### Install Worktrunk with Conda
Source: https://github.com/max-sixty/worktrunk/blob/main/README.md
Install Worktrunk using Conda from the conda-forge channel, followed by shell integration.
```bash
conda install -c conda-forge worktrunk && wt config shell install
```
--------------------------------
### Install Worktrunk with Homebrew
Source: https://github.com/max-sixty/worktrunk/blob/main/README.md
Install Worktrunk using Homebrew on macOS and Linux, followed by shell integration.
```bash
brew install worktrunk && wt config shell install
```
--------------------------------
### Create Project Configuration File
Source: https://github.com/max-sixty/worktrunk/blob/main/docs/static/tips-patterns.md
Create the project configuration file (.config/wt.toml) from within a worktree. This configuration is automatically shared across all worktrees for the project.
```bash
cd myproject/main
wt config create --project
```
--------------------------------
### Install Worktrunk with Conda/Pixi
Source: https://github.com/max-sixty/worktrunk/blob/main/docs/static/worktrunk.md
Installs Worktrunk using Conda or Pixi. Includes shell integration for directory changes.
```bash
conda install -c conda-forge worktrunk && wt config shell install
```
```bash
pixi global install worktrunk && wt config shell install
```
--------------------------------
### Pipeline Post-Start Hooks
Source: https://github.com/max-sixty/worktrunk/blob/main/docs/content/tips-patterns.md
Sequence multiple post-start hooks, such as copying ignored files and running an install command, using a TOML pipeline. This ensures dependencies are met before subsequent steps.
```toml
[[post-start]]
copy = "wt step copy-ignored"
[[post-start]]
install = "pnpm install"
```
--------------------------------
### Install Worktrunk on Arch Linux
Source: https://github.com/max-sixty/worktrunk/blob/main/README.md
Install Worktrunk on Arch Linux using pacman, followed by shell integration.
```bash
sudo pacman -S worktrunk && wt config shell install
```
--------------------------------
### Install Gemini CLI Worktrunk Extension
Source: https://github.com/max-sixty/worktrunk/blob/main/docs/content/claude-code.md
Installs the Worktrunk extension for Gemini CLI directly from the GitHub repository.
```bash
gemini extensions install https://github.com/max-sixty/worktrunk
```
--------------------------------
### Example of Manual Hook Execution Output
Source: https://github.com/max-sixty/worktrunk/blob/main/docs/content/hook.md
This demonstrates the output when running `wt hook pre-merge` and `wt hook post-start` commands, showing hook execution and status.
```bash
wt hook pre-merge
```
```text
◎ Running pre-merge project:test
cargo test
Finished test [unoptimized + debuginfo] target(s) in 0.12s
Running unittests src/lib.rs (target/debug/deps/worktrunk-abc123)
running 18 tests
test auth::tests::test_jwt_decode ... ok
test auth::tests::test_jwt_encode ... ok
test auth::tests::test_token_refresh ... ok
test auth::tests::test_token_validation ... ok
test result: ok. 18 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.08s
◎ Running pre-merge project:lint
cargo clippy
Checking worktrunk v0.1.0
Finished dev [unoptimized + debuginfo] target(s) in 1.23s
```
```bash
wt hook post-start
```
```text
◎ Running post-start: project @ ~/acme
```
--------------------------------
### Install Claude Code Worktrunk Plugin
Source: https://github.com/max-sixty/worktrunk/blob/main/docs/content/claude-code.md
Installs the Worktrunk plugin for Claude Code using the wt CLI. This is the recommended method.
```bash
wt config plugins claude install
```
--------------------------------
### Build and Debug wt-switch Demo with Shell
Source: https://github.com/max-sixty/worktrunk/blob/main/docs/demos/CLAUDE.md
Builds the wt-switch demo and spawns an interactive fish shell with the demo environment configured. This allows for direct testing of the demo commands.
```bash
./docs/demos/build social --only wt-switch --shell
```
--------------------------------
### Create Multiple Worktrees for Parallel Agents
Source: https://github.com/max-sixty/worktrunk/blob/main/docs/content/worktrunk.md
Use `wt switch -x` to create and switch to multiple worktrees, executing a command (like launching an agent) in each. Arguments after `--` are passed to the executed command.
```bash
wt switch -x claude -c feature-a -- 'Add user authentication'|||wt switch -x claude -c feature-b -- 'Fix the pagination bug'|||wt switch -x claude -c feature-c -- 'Write tests for the API'
```
--------------------------------
### Set and Get Branch Variables
Source: https://github.com/max-sixty/worktrunk/blob/main/docs/static/config.md
Use `set` to store a custom variable and `get` to retrieve it. Variables are stored as plain strings.
```bash
$ wt config state vars set env=staging
```
```bash
$ wt config state vars get env
```
--------------------------------
### Launch and Navigate with tmux-cli
Source: https://github.com/max-sixty/worktrunk/blob/main/src/commands/CLAUDE.md
Launches a new tmux pane, navigates to the test repository, and prepares for running the command with debug logging enabled.
```bash
# Launch shell in test repo
pane=$(tmux-cli launch "zsh")
tmux-cli send "cd /tmp/wt-perf-picker-test" --pane=$pane
tmux-cli wait_idle --pane=$pane
```
--------------------------------
### Install trace_processor
Source: https://github.com/max-sixty/worktrunk/blob/main/benches/CLAUDE.md
Downloads and makes the trace_processor executable, which is used for SQL analysis of performance traces. Ensure the download URL and execution permissions are correct for your system.
```bash
curl -LO https://get.perfetto.dev/trace_processor && chmod +x trace_processor
```
--------------------------------
### Install Codex Worktrunk Plugin
Source: https://github.com/max-sixty/worktrunk/blob/main/docs/content/claude-code.md
Installs the Worktrunk plugin for Codex using the wt CLI, configuring the Worktrunk marketplace within Codex.
```bash
wt config plugins codex install
```
--------------------------------
### Create User Configuration File
Source: https://github.com/max-sixty/worktrunk/blob/main/docs/static/config.md
Use this command to create the user configuration file. This file stores personal preferences and settings.
```bash
$ wt config create
```
--------------------------------
### Example Problematic Aliases
Source: https://github.com/max-sixty/worktrunk/blob/main/skills/worktrunk/reference/shell-integration.md
These examples show aliases that bypass shell integration because they point directly to the Worktrunk binary instead of the shell function.
```bash
alias gwt="/usr/bin/wt"
alias gwt="wt.exe"
alias wt="/path/to/wt"
```
--------------------------------
### Project-Specific Configuration Example
Source: https://github.com/max-sixty/worktrunk/blob/main/docs/content/config.md
Configure project-specific settings, such as worktree paths, merge behaviors, and custom hooks, keyed by project identifier.
```toml
[projects."github.com/user/repo"]
worktree-path = ".worktrees/{{ branch | sanitize }}"
list.full = true
merge.squash = false
remove.delete-branch = false
pre-start.env = "cp .env.example .env"
step.copy-ignored.exclude = [".repo-local-cache/"]
alias.deploy = "make deploy BRANCH={{ branch }}"
```
--------------------------------
### Test Project Hooks Setup
Source: https://github.com/max-sixty/worktrunk/blob/main/skills/worktrunk/SKILL.md
Initiates the creation of a new test worktree to verify that the configured project hooks are functioning correctly.
```bash
wt switch --create test-hooks
```
--------------------------------
### Example Snapshot File Mapping
Source: https://github.com/max-sixty/worktrunk/blob/main/docs/CLAUDE.md
A table mapping placeholders in Rust source code to their corresponding snapshot files used for generating example output.
```markdown
| Placeholder |
|-------------|
| `` | `readme_example_list.snap` |
| `` | `readme_example_list_full.snap` |
| `` | `readme_example_list_branches.snap` |
```
--------------------------------
### Command Reference for 'wt config show'
Source: https://github.com/max-sixty/worktrunk/blob/main/skills/worktrunk/reference/config.md
Provides a detailed reference for the 'wt config show' command, including its usage, available options, and output formats.
```text
wt config show - Show configuration files & locations
Usage: wt config show [OPTIONS]
Options:
--full
Run diagnostic checks (CI tools, commit generation, version)
-h, --help
Print help (see a summary with '-h')
Output:
--format
Output format
[default: text]
[possible values: text, json]
Global Options:
-C
Working directory for this command
--config
User config file path
--config-set
Override config with inline TOML, e.g. --config-set list.full=true (repeatable)
-v, --verbose...
Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug
logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to
apply the same level everywhere — including shell completion, which no flag can reach
-y, --yes
Skip approval prompts
```