Skip to main content
hook

debug-window — Claude Code hook: live debug log window

Opens a live-tailing debug log window when Claude starts with --debug or -d, then closes it when the session ends.

Install into Claude Code · claude-code-templates All methods and platforms ↓
npx claude-code-templates@latest --hook development-tools/debug-window
Open on GitHub

What debug-window does

The hook listens to two events. SessionStart runs .claude/hooks/debug-window.sh, and SessionEnd calls the same script. While the session is alive, the window keeps showing whatever the debug log appends. No manual closing needed.

Want the window to survive the session? Set DEBUG_WINDOW_AUTO_CLOSE_DISABLE=1 in settings.json. Leave it out and the window goes away with the session.

The author tested it on an Intel Mac. macOS, Linux and Windows via Git Bash or Cygwin are listed as supported; other platforms are untested, so run it once on your own machine before you lean on it during real work.

What it helps with

  • watch the Claude debug log while a session runs
  • skip opening a terminal just to tail the log
  • get a log window when starting with --debug or -d
  • keep the log window open after the session ends
  • stop closing the log window by hand every time

Example prompts for the agent

  • start Claude with --debug so the log window opens
  • run with -d and show me what the debug log writes
  • how do I keep the log window open after the session ends?

How to install debug-window

1claude-code-templates

npx claude-code-templates@latest --hook development-tools/debug-window

2Manually: put the files in place

.claude/settings.json

The hooks block: event (PreToolUse, PostToolUse, Stop…) → command. Personal ones go to ~/.claude/settings.json

Step by step, with commands for each platform: Claude Code hooks: what they are, where to configure them, how to block a risky command

Questions about debug-window

How do I install debug-window in Claude?

Run npx claude-code-templates@latest --hook development-tools/debug-window, then check .claude/settings.json — the SessionStart and SessionEnd hooks get written there.

What does debug-window do?

When a session starts with --debug or -d, it opens a window that live-tails the debug log and closes it once the session ends.

How do I keep the log window open after the session?

Add DEBUG_WINDOW_AUTO_CLOSE_DISABLE=1 to settings.json. The window then stays put instead of closing on SessionEnd.

Source text

debug-window.json · MIT
{
  "description": "Auto Debug Log Viewer. Opens a live-tailing debug log window when Claude Code starts with --debug or -d flag. The window closes automatically on session end. To keep the debug window open after session ends, set DEBUG_WINDOW_AUTO_CLOSE_DISABLE=1 in your settings.json. Tested on Intel Mac. Supports macOS, Linux, and Windows (Git Bash/Cygwin). Contributions from other platform users are welcome.",
  "hooks": {
    "SessionStart": [
      {
        "matcher": "*",
        "hooks": [
          {
            "type": "command",
            "command": ".claude/hooks/debug-window.sh"
          }
        ]
      }
    ],
    "SessionEnd": [
      {
        "hooks": [
          {
            "type": "command",
            "command": ".claude/hooks/debug-window.sh"
          }
        ]
      }
    ]
  }
}

© davila7 · MIT · davila7/claude-code-templates

Similar hooks

All hooks for Agent setup: memory, context, orchestration →

From the same set205

The whole set →

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor