Skip to content
iterm2-layout logo

iTerm2 Layout Configuration

iterm2-layout

Configure iTerm2 workspace layouts with TOML. TRIGGERS - iTerm2 layout, workspace tabs, layout.toml, AutoLaunch.

SKILL.md

Full skill instructions

iTerm2 Layout Configuration

<!-- ADR: /​docs/​adr/​2025-12-15-iterm2-layout-config.md -->

Configure iTerm2 workspace layouts with proper separation of concerns: private paths in TOML config, publishable code in Python script.

Triggers

Invoke this skill when user mentions:

  • "iTerm2 layout"
  • "workspace tabs"
  • "layout.toml"
  • "AutoLaunch script"
  • "default-layout.py"
  • "configure terminal workspaces"
  • "add workspace tab"

Configuration Overview

File Locations

FileLocationPurpose
Config (private)~/​.config/​iterm2/​layout.tomlUser's workspace paths
Script (public)~/​scripts/​iterm2/​default-layout.pyLayout logic
Template~/​scripts/​iterm2/​layout.example.tomlExample config

Config File Format

# ~/​.config/​iterm2/​layout.toml

[layout]
left_pane_ratio = 0.20    # 0.0 to 1.0
settle_time = 0.3         # seconds

[commands]
left = "br --sort-by-type-dirs-first"
right = "zsh"

[worktrees]
# Optional: Enable git worktree discovery
# main_repo_root = "~/​projects/​my-project"
# worktree_pattern = "my-project.worktree-*"

[[tabs]]
name = "home"
dir = "~"

[[tabs]]
name = "projects"
dir = "~/​projects"

[[tabs]]
dir = "~/​Documents"  # name defaults to "Documents"

Setup Instructions

First-Time Setup

/​usr/​bin/​env bash << 'CONFIG_EOF'
# 1. Ensure config directory exists
mkdir -p ~/​.config/​iterm2

# 2. Copy template
cp ~/​scripts/​iterm2/​layout.example.toml ~/​.config/​iterm2/​layout.toml

# 3. Edit with your workspace paths
# Add [[tabs]] entries for each workspace

# 4. Restart iTerm2 to test
CONFIG_EOF

Adding a New Tab

Add a [[tabs]] entry to ~/​.config/​iterm2/​layout.toml:

[[tabs]]
name = "MyProject"  # Tab display name (optional)
dir = "~/​path/​to/​project"

Name field:

  • If omitted, uses directory basename
  • Custom names useful for abbreviations (e.g., "AF" instead of "alpha-forge")

Removing a Tab

Delete or comment out the [[tabs]] entry:

# [[tabs]]
# name = "OldProject"
# dir = "~/​old/​project"

Configuration Schema

SectionKeyTypeDefaultDescription
[layout]left_pane_ratiofloat0.20Left pane width (0.0-1.0)
[layout]settle_timefloat0.3Wait after cd (seconds)
[commands]leftstringbr...Left pane command
[commands]rightstringzshRight pane command
[worktrees]alpha_forge_rootstringnullWorktree root (optional)
[worktrees]worktree_patternstring*.worktree-*Glob pattern
[[tabs]]dirstringrequiredDirectory path
[[tabs]]namestringbasenameTab display name

Troubleshooting

Error: "Layout configuration not found"

Symptom: Script Console shows error about missing config

Solution:

# Create config from template
cp ~/​scripts/​iterm2/​layout.example.toml ~/​.config/​iterm2/​layout.toml

Error: "Invalid TOML syntax"

Symptom: Script Console shows TOML parse error

Solution:

  1. Check TOML syntax (quotes, brackets)
  2. Validate with: python3 -c "import tomllib; tomllib.load(open('~/​.config/​iterm2/​layout.toml', 'rb'))"

Tabs Not Appearing

Symptom: iTerm2 opens but no custom tabs created

Causes:

  1. No [[tabs]] entries in config
  2. Config file in wrong location
  3. Script not in AutoLaunch

Solution:

# Verify config location
ls -la ~/​.config/​iterm2/​layout.toml

# Verify AutoLaunch symlink
ls -la ~/​Library/​Application\ Support/​iTerm2/​Scripts/​AutoLaunch/

# Check Script Console for errors
# iTerm2 > Scripts > Manage > Console

Directory Does Not Exist Warning

Symptom: Tab skipped with warning in Script Console

Solution: Verify directory path exists or create it:

mkdir -p ~/​path/​to/​missing/​directory

Error Handling Behavior

The script uses "print + early return" pattern:

  1. Missing config: Logs instructions to Script Console, exits cleanly
  2. Invalid TOML: Logs parse error with details, exits cleanly
  3. Missing directory: Logs warning, skips tab, continues with others

Viewing errors: Scripts > Manage > Console in iTerm2

Git Worktree Detection (Optional)

Enable dynamic tab creation for git worktrees:

[worktrees]
main_repo_root = "~/​projects/​my-project"
worktree_pattern = "my-project.worktree-*"

How it works:

  1. Script globs for ~/​projects/​my-project.worktree-* directories
  2. Validates each against git worktree list
  3. Generates acronym-based tab names (e.g., AF-ssv for sharpe-statistical-validation)
  4. Inserts worktree tabs after main project tab

References

More skills from majiayu000

xiaohongshu logo
majiayu000/claude-arsenal

xiaohongshu

xiaohongshu

286 148
View
agent-task-conductor logo
majiayu000/claude-skill-registry

agent-task-conductor

Conduct multi-agent task orchestration and workflow coordination.

663 1
View
conductor-setup logo
majiayu000/claude-skill-registry

conductor-setup

Initialize project with Conductor artifacts (product definition,

663 1
View
animation-designer logo
majiayu000/claude-skill-registry

animation-designer

Expert in web animations, transitions, and motion design using Framer Motion and CSS

663 1
View
diagramming logo
majiayu000/claude-skill-registry

diagramming

Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...

663 1
View
h3-pg logo
majiayu000/claude-skill-registry-data

h3-pg

PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.

23 1
View
conductor-development logo
majiayu000/claude-skill-registry

conductor-development

Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...

663 1
View
conductor-status logo
majiayu000/claude-skill-registry

conductor-status

Display project status, active tracks, and next actions

663 1
View
dockerization logo
majiayu000/claude-skill-registry

dockerization

Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.

663 1
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View