ホーム 車・バイク Mastering Claude Code with Ghostty — Practical Tips to Transform Your Development with a Single Terminal

Mastering Claude Code with Ghostty — Practical Tips to Transform Your Development with a Single Terminal

篠原 沙世 篠原 沙世 • 更新: • 公開: • 読了約 27 分
目次

Introduction

n7f080cf026a7

You've started using Claude Code, but do you feel like you're just running it in the terminal without really knowing how to use it?

I was in that state for a while myself. Claude Code is certainly amazing. However, I realized after digging into Ghostty's features that the experience changes completely depending on how you use the terminal.

In this article, I will focus on Ghostty Terminal × Claude Code and summarize practical tips that will take your development to the next level if you know them. I won't be talking about iTerm2 or WezTerm. This is an article for Ghostty users.

Why Ghostty and Claude Code are a Great Match

First, as a premise, Ghostty is one of the officially recommended terminals for use with Claude Code. It is mentioned in Anthropic's documentation as a terminal where you can use full features without any configuration.

Specifically, there are three points that make it good.

1. Shift+Enter works out of the box

In Claude Code, there are frequent situations where you want to input multi-line prompts. In many terminals, you need additional configuration (/terminal-setup) to use Shift+Enter for line breaks, but in Ghostty, it works as is without any settings. It's a small thing, but since it's something you use every day, it makes a big difference.

2. Native support for desktop notifications

When Claude Code completes a long-running task, you want to receive a notification. Ghostty supports desktop notifications without additional configuration. If you combine it with Claude Code's Notification hook, you won't miss that Claude has finished while you are working on something else.

3. Good memory efficiency

In long Claude Code sessions, the terminal continues to process a large amount of text output. Ghostty uses Metal GPU rendering, which keeps memory consumption low. There are reports that while running two sessions in the VS Code integrated terminal might consume about 8GB, it only takes about 500MB with Ghostty.

Basic Operations — Learn These First

These are the minimum Ghostty operations you should learn to use Claude Code comfortably.

Tab Operations
  • Cmd+T — Open a new tab

  • Cmd+W — Close a tab

  • Cmd+1-9 — Jump directly to a tab number

  • Ctrl+Tab / Ctrl+Shift+Tab — Switch to next/previous tab

  • Shift+Cmd+\\ — Grid view of tab list (useful when you have many tabs)

Split Panes (Screen Splitting)
  • Cmd+D — Split right (separated by a vertical line)

  • Cmd+Shift+D — Split down (separated by a horizontal line)

  • Cmd+] / Cmd+[ — Navigate between panes

  • Cmd+Ctrl+Arrow keys — Resize panes

  • Double-tap Cmd+Enter — Toggle full-screen for a single pane (same as tmux zoom)

  • Cmd+Ctrl+Shift+= — Reset all panes to equal size

Practical Workflow ① — 3-Pane Layout

The most practical setup for development using Claude Code is the 3-pane layout.

Layout Configuration
  • Left pane (main): Launch Claude Code

  • Right pane: Editor (Neovim, Vim, etc.) or for checking files

  • Bottom pane: Development server / test runner / git operations

Setup Steps
  1. Open Ghostty

  2. Cmd+D to split right → Launch editor in the right pane

  3. Focus on the left pane and Cmd+Shift+D to split down → Launch dev server in the bottom pane

  4. Launch claude in the top-left pane

By doing this, you can have Claude write code while checking files in real-time in the right pane and viewing test results in the bottom pane, completing the entire workflow on one screen.

Setting up Vim-style pane navigation

While you can move between panes using the default Cmd+]/[, Vim-style keybindings that allow for intuitive directional specification are more convenient. Add the following to ~/.config/ghostty/config.

keybind = ctrl+h=goto_split:left
keybind = ctrl+j=goto_split:bottom
keybind = ctrl+k=goto_split:top
keybind = ctrl+l=goto_split:right

With this, you can instantly move between panes using Ctrl+H/J/K/L. Checking code in the right pane while Claude Code is working, then immediately returning to the left to input feedback—this back-and-forth becomes stress-free.

Practical Workflow ② — Parallel Agents

The true value of Claude Code is unleashed by running multiple instances simultaneously. You can easily achieve this by combining Ghostty tabs with Git worktrees.

What is a Git worktree?

In standard Git, you have one working directory per repository. By using worktrees, you can create multiple working directories from the same repository. Since you can have independent directories for each branch, you can deploy Claude Code to separate feature developments at the same time.

Setup steps
# ワークツリーを作成
git worktree add ../my-project-feature-a feature-a
git worktree add ../my-project-feature-b feature-b
# タブ1: 機能Aの開発
cd ../my-project-feature-a
claude
タブ2: 機能Bの開発(Cmd+Tで新しいタブを開いて)
cd ../my-project-feature-b
claude

Independent Claude Code sessions run in each tab, allowing for parallel development without file conflicts. Simply use Cmd+1/2 to switch tabs and check progress.

Tab organization

Ghostty tabs automatically display the last command executed, so you can see at a glance which tab is for which task. When you have four or more tabs open, Shift+Cmd+\ is useful for a grid view of all tabs.

Quick Terminal — The ultimate "quick check"

Ghostty's Quick Terminal is a dropdown-style terminal that slides down smoothly from the top of the screen.

Default shortcut

Cmd+` (Command key + backtick)

Pressing this overlays the terminal on top of your current application. Press it again to hide it.

When to use it for Claude Code development
  • When you want to check for a moment the status of another repository while Claude is running a long task

  • When you want to quickly review the changes Claude made using git log or git diff

  • When you want to check environment variables or do a quick calculation

Without interrupting your main Claude Code session or switching windows, you can show, check, and hide it in an instant with Cmd+\. This experience is unique to Ghostty.

Customization

The Quick Terminal hotkey can be changed.

keybind = global:ctrl+grave_accent=toggle_quick_terminal

The global: prefix allows it to work even when Ghostty is not in focus (requires accessibility permissions on macOS).

Leveraging Claude Code Session Management

If you are using Ghostty's tabs and panes, it is also useful to know about Claude Code's session management features.

Resuming Sessions
# 直前のセッションを再開
claude --continue
セッション一覧から選んで再開
claude --resume
特定のセッションIDで再開
claude --resume abc123

Even if you accidentally close the terminal, the session is preserved. You can open a new tab and type claude --continue to resume from where you left off.

Use /compact for a smoother long-running session

Claude Code approaches the context window limit as conversations get longer. It compresses automatically when it reaches 95%, but it is recommended to run /compact yourself before that happens.

Automatic compression doesn't let you choose the timing, but manual compression allows you to trigger it at a good stopping point after you've finished a task. This minimizes information loss.

Setting up Notification Hooks — Don't miss when Claude is finished

While you have Claude Code working on a long task, you are likely working in another pane or app. Setting up a Notification hook will send a macOS notification when Claude is waiting for input.

How to set it up

Enter /hooks in Claude Code or add it directly to .claude/settings.json.

  "hooks": 
    "Notification": [
      
        "matcher": "",
        "command": "osascript -e 'display notification \"$CLAUDE_NOTIFICATION_MESSAGE\" with title \"Claude Code\"'"
      
    ]
  

Since Ghostty natively supports desktop notifications, this setting alone will cause Claude Code notifications to appear in the macOS Notification Center.

Recommended Ghostty Settings

Here is an example of Ghostty settings optimized for Claude Code development. Add these to ~/.config/ghostty/config.

# フォント
font-family = JetBrains Mono
font-size = 14
テーマ(ダークテーマ推奨)
theme = catppuccin-mocha
シェル統合(zsh使用時)
shell-integration = zsh
ウィンドウの余白
window-padding-x = 4
window-padding-y = 4
Quick Terminal(グローバルホットキー)
keybind = global:ctrl+grave_accent=toggle_quick_terminal
ペイン移動(Vim風)
keybind = ctrl+h=goto_split:left
keybind = ctrl+j=goto_split:bottom
keybind = ctrl+k=goto_split:top
keybind = ctrl+l=goto_split:right
ペイン作成
keybind = super+d=new_split:right
keybind = super+shift+d=new_split:down
ペイン均等化
keybind = super+ctrl+shift+equal=equalize_splits
After changing the settings

Cmd+Shift+, allows you to reload Ghostty settings. There is no need to restart the terminal.

To check the current list of keybindings, run the following in the terminal.

ghostty +list-keybinds

Common Pitfalls and Solutions

“Ctrl+H/J/K/L are not working”

When Claude Code (or Vim) is running, key inputs may be captured by the application. By using the unconsumed: prefix in your Ghostty keybindings, the Ghostty action will only trigger if the app does not consume the input.

keybind = unconsumed:ctrl+h=goto_split:left

However, since this might cause them to stop working while Claude Code is running, it is also a good idea to have alternative keybindings (e.g., Cmd+Ctrl+H/J/K/L) ready.

“The Quick Terminal global hotkey is not working”

You need to grant permission to Ghostty in macOS under “System Settings → Privacy & Security → Accessibility”. Keybindings with the global: prefix will not work without this permission.

“My Claude Code session disappeared”

Even if you close a Ghostty pane or tab, your Claude Code session data is preserved. Running claude --resume will display a list of past sessions, so you can select one to resume from there.

Summary

  • Ghostty has excellent compatibility with Claude Code right out of the box. Shift+Enter, notifications, and memory efficiency work without any configuration.

  • A 3-pane layout (Claude Code + Editor + Server) is the most practical base setup.

  • Git worktrees + tabs allow you to run multiple Claude Code instances in parallel.

  • Quick Terminal (Cmd+`) is perfect for quick checks without interrupting your main work.

  • Notification hooks can be set up to receive macOS notifications when Claude finishes a task.

  • Vim-style keybindings (Ctrl+H/J/K/L) make navigating between panes stress-free.

  • Reload configuration changes with Cmd+Shift+,. No restart required.

By fully utilizing Ghostty's features, Claude Code transforms from a “chatbot running in a terminal” into an “AI architect integrated into your development environment.” Start by trying out the 3-pane layout.

同じカテゴリの記事

篠原 沙世

アニメとゲームの新作情報を担当。制作会社・配信元の公式告知と登壇情報を照合して記事化します。

おすすめの関連記事