Created
December 15, 2025 15:42
-
-
Save Nucs/e4ed7c08dfdd517bbcdae5a10accce0e to your computer and use it in GitHub Desktop.
Claude Code hook to print SessionId and cli command "claude --resume <session_id>" for convenient copy for later resume or restart.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "hooks": { | |
| "SessionEnd": [ | |
| { | |
| "hooks": [ | |
| { | |
| "type": "command", | |
| "command": "node -e \"let i='';process.stdin.on('data',c=>i+=c);process.stdin.on('end',()=>{try{const d=JSON.parse(i);const r='claude --resume '+d.session_id+' --debug';const w=r.length+16;const ln='═'.repeat(w);console.error('\\n'+ln);console.error(' Dir: '+d.cwd);console.error(' Reason: '+d.reason);console.error(' Resume: '+r);console.error(ln);process.exit(2)}catch(e){}})\"" | |
| } | |
| ] | |
| } | |
| ] | |
| } | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just add the hook to your ~.claude\settings.json (create if not existent).
The hook doesn't (and can't) persist the arguments so just add your favorite ones in the hook.
The debug and dangerous permissions are not necessary.