> ## Content Index
> Fetch the complete content index at: https://sanghunkang.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# Auto-copy Claude Code Resume Command to Clipboard on Session End
- URL: https://sanghunkang.com/claude-code-resume-clipboard-hook-en/
- Published: 2026-04-05T12:29:46.000Z
- Updated: 2026-04-05T12:29:46.000Z
- Author: Sanghun Kang
- Tags: dev, #en, #multi

Sometimes you need to exit and restart a Claude Code session. When you do, it prints a `claude --resume {session_id}` command to pick up where you left off. Dragging to copy it every time got old, so I automated it.

Claude Code hooks can automate this.

## Setup

Add a `SessionEnd` hook to `~/.claude/settings.json`:

```json

"hooks": {
  "SessionEnd": [
    {
      "hooks": [
        {
          "type": "command",
          "command": "jq -r '\"claude --resume \" + .session_id' | pbcopy"
        }
      ]
    }
  ]
}

```

On session end, the hook receives session info as JSON. `jq` extracts the `session_id`, assembles the resume command, and `pbcopy` puts it on your clipboard.

## Usage

Exit a session, hit `Cmd+V` in your terminal. That's it.