[{"data":1,"prerenderedAt":1832},["ShallowReactive",2],{"guide:/guides/claude-code-stop-hook":3},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"tag":10,"date":11,"body":12,"_type":1826,"_id":1827,"_source":1828,"_file":1829,"_stem":1830,"_extension":1831},"/guides/claude-code-stop-hook","guides",false,"","The Claude Code Stop hook, explained","The Stop hook fires when Claude Code finishes a turn. Here is exactly when it runs, what it receives, and copy-paste examples to log, notify or chain the next step.","Hooks","2026-08-15",{"type":13,"children":14,"toc":1814},"root",[15,47,54,71,99,105,133,317,323,328,437,447,600,606,611,794,823,829,849,958,971,1037,1043,1069,1314,1326,1332,1337,1428,1461,1467,1492,1708,1713,1719,1762,1768,1808],{"type":16,"tag":17,"props":18,"children":19},"element","p",{},[20,23,30,32,39,41],{"type":21,"value":22},"text","Of all ",{"type":16,"tag":24,"props":25,"children":27},"a",{"href":26},"/guides/claude-code-hooks",[28],{"type":21,"value":29},"Claude Code hooks",{"type":21,"value":31},", ",{"type":16,"tag":33,"props":34,"children":36},"code",{"className":35},[],[37],{"type":21,"value":38},"Stop",{"type":21,"value":40}," is the one people reach for first. It answers the single most useful question when you have stepped away: ",{"type":16,"tag":42,"props":43,"children":44},"strong",{},[45],{"type":21,"value":46},"is it done?",{"type":16,"tag":48,"props":49,"children":51},"h2",{"id":50},"when-it-fires",[52],{"type":21,"value":53},"When it fires",{"type":16,"tag":17,"props":55,"children":56},{},[57,62,64,69],{"type":16,"tag":33,"props":58,"children":60},{"className":59},[],[61],{"type":21,"value":38},{"type":21,"value":63}," fires when Claude finishes its turn and hands control back to you: the moment the agent stops working and waits for your next prompt. It does ",{"type":16,"tag":42,"props":65,"children":66},{},[67],{"type":21,"value":68},"not",{"type":21,"value":70}," fire for every tool call or every message; it fires once, at the end of a turn.",{"type":16,"tag":17,"props":72,"children":73},{},[74,76,82,84,89,91,97],{"type":21,"value":75},"That makes it the right signal for \"the run I kicked off is finished\", and the wrong one for \"something happened mid-run\" (for that, look at ",{"type":16,"tag":33,"props":77,"children":79},{"className":78},[],[80],{"type":21,"value":81},"PostToolUse",{"type":21,"value":83},"). It is also not the same as the session ending: a session usually fires ",{"type":16,"tag":33,"props":85,"children":87},{"className":86},[],[88],{"type":21,"value":38},{"type":21,"value":90}," many times before ",{"type":16,"tag":33,"props":92,"children":94},{"className":93},[],[95],{"type":21,"value":96},"SessionEnd",{"type":21,"value":98}," fires once.",{"type":16,"tag":48,"props":100,"children":102},{"id":101},"the-minimal-hook",[103],{"type":21,"value":104},"The minimal hook",{"type":16,"tag":17,"props":106,"children":107},{},[108,110,115,117,123,125,131],{"type":21,"value":109},"Like every hook, ",{"type":16,"tag":33,"props":111,"children":113},{"className":112},[],[114],{"type":21,"value":38},{"type":21,"value":116}," lives in a ",{"type":16,"tag":33,"props":118,"children":120},{"className":119},[],[121],{"type":21,"value":122},"settings.json",{"type":21,"value":124}," under the ",{"type":16,"tag":33,"props":126,"children":128},{"className":127},[],[129],{"type":21,"value":130},"hooks",{"type":21,"value":132}," key. It is a lifecycle event, so there is no tool matcher:",{"type":16,"tag":134,"props":135,"children":139},"pre",{"className":136,"code":137,"language":138,"meta":7,"style":7},"language-json shiki shiki-themes github-light github-dark","{\n  \"hooks\": {\n    \"Stop\": [\n      {\n        \"hooks\": [\n          { \"type\": \"command\", \"command\": \"echo \\\"done at $(date)\\\" >> ~/claude.log\" }\n        ]\n      }\n    ]\n  }\n}\n","json",[140],{"type":16,"tag":33,"props":141,"children":142},{"__ignoreMap":7},[143,155,170,184,193,206,272,281,290,299,308],{"type":16,"tag":144,"props":145,"children":148},"span",{"class":146,"line":147},"line",1,[149],{"type":16,"tag":144,"props":150,"children":152},{"style":151},"--shiki-default:#24292E;--shiki-dark:#E1E4E8",[153],{"type":21,"value":154},"{\n",{"type":16,"tag":144,"props":156,"children":158},{"class":146,"line":157},2,[159,165],{"type":16,"tag":144,"props":160,"children":162},{"style":161},"--shiki-default:#005CC5;--shiki-dark:#79B8FF",[163],{"type":21,"value":164},"  \"hooks\"",{"type":16,"tag":144,"props":166,"children":167},{"style":151},[168],{"type":21,"value":169},": {\n",{"type":16,"tag":144,"props":171,"children":173},{"class":146,"line":172},3,[174,179],{"type":16,"tag":144,"props":175,"children":176},{"style":161},[177],{"type":21,"value":178},"    \"Stop\"",{"type":16,"tag":144,"props":180,"children":181},{"style":151},[182],{"type":21,"value":183},": [\n",{"type":16,"tag":144,"props":185,"children":187},{"class":146,"line":186},4,[188],{"type":16,"tag":144,"props":189,"children":190},{"style":151},[191],{"type":21,"value":192},"      {\n",{"type":16,"tag":144,"props":194,"children":196},{"class":146,"line":195},5,[197,202],{"type":16,"tag":144,"props":198,"children":199},{"style":161},[200],{"type":21,"value":201},"        \"hooks\"",{"type":16,"tag":144,"props":203,"children":204},{"style":151},[205],{"type":21,"value":183},{"type":16,"tag":144,"props":207,"children":209},{"class":146,"line":208},6,[210,215,220,225,231,235,239,243,248,253,258,262,267],{"type":16,"tag":144,"props":211,"children":212},{"style":151},[213],{"type":21,"value":214},"          { ",{"type":16,"tag":144,"props":216,"children":217},{"style":161},[218],{"type":21,"value":219},"\"type\"",{"type":16,"tag":144,"props":221,"children":222},{"style":151},[223],{"type":21,"value":224},": ",{"type":16,"tag":144,"props":226,"children":228},{"style":227},"--shiki-default:#032F62;--shiki-dark:#9ECBFF",[229],{"type":21,"value":230},"\"command\"",{"type":16,"tag":144,"props":232,"children":233},{"style":151},[234],{"type":21,"value":31},{"type":16,"tag":144,"props":236,"children":237},{"style":161},[238],{"type":21,"value":230},{"type":16,"tag":144,"props":240,"children":241},{"style":151},[242],{"type":21,"value":224},{"type":16,"tag":144,"props":244,"children":245},{"style":227},[246],{"type":21,"value":247},"\"echo ",{"type":16,"tag":144,"props":249,"children":250},{"style":161},[251],{"type":21,"value":252},"\\\"",{"type":16,"tag":144,"props":254,"children":255},{"style":227},[256],{"type":21,"value":257},"done at $(date)",{"type":16,"tag":144,"props":259,"children":260},{"style":161},[261],{"type":21,"value":252},{"type":16,"tag":144,"props":263,"children":264},{"style":227},[265],{"type":21,"value":266}," >> ~/claude.log\"",{"type":16,"tag":144,"props":268,"children":269},{"style":151},[270],{"type":21,"value":271}," }\n",{"type":16,"tag":144,"props":273,"children":275},{"class":146,"line":274},7,[276],{"type":16,"tag":144,"props":277,"children":278},{"style":151},[279],{"type":21,"value":280},"        ]\n",{"type":16,"tag":144,"props":282,"children":284},{"class":146,"line":283},8,[285],{"type":16,"tag":144,"props":286,"children":287},{"style":151},[288],{"type":21,"value":289},"      }\n",{"type":16,"tag":144,"props":291,"children":293},{"class":146,"line":292},9,[294],{"type":16,"tag":144,"props":295,"children":296},{"style":151},[297],{"type":21,"value":298},"    ]\n",{"type":16,"tag":144,"props":300,"children":302},{"class":146,"line":301},10,[303],{"type":16,"tag":144,"props":304,"children":305},{"style":151},[306],{"type":21,"value":307},"  }\n",{"type":16,"tag":144,"props":309,"children":311},{"class":146,"line":310},11,[312],{"type":16,"tag":144,"props":313,"children":314},{"style":151},[315],{"type":21,"value":316},"}\n",{"type":16,"tag":48,"props":318,"children":320},{"id":319},"what-it-receives",[321],{"type":21,"value":322},"What it receives",{"type":16,"tag":17,"props":324,"children":325},{},[326],{"type":21,"value":327},"Claude pipes a JSON payload to your command on standard input:",{"type":16,"tag":329,"props":330,"children":331},"table",{},[332,351],{"type":16,"tag":333,"props":334,"children":335},"thead",{},[336],{"type":16,"tag":337,"props":338,"children":339},"tr",{},[340,346],{"type":16,"tag":341,"props":342,"children":343},"th",{},[344],{"type":21,"value":345},"Field",{"type":16,"tag":341,"props":347,"children":348},{},[349],{"type":21,"value":350},"Contains",{"type":16,"tag":352,"props":353,"children":354},"tbody",{},[355,373,390,407],{"type":16,"tag":337,"props":356,"children":357},{},[358,368],{"type":16,"tag":359,"props":360,"children":361},"td",{},[362],{"type":16,"tag":33,"props":363,"children":365},{"className":364},[],[366],{"type":21,"value":367},"session_id",{"type":16,"tag":359,"props":369,"children":370},{},[371],{"type":21,"value":372},"Which session finished, useful when you run several.",{"type":16,"tag":337,"props":374,"children":375},{},[376,385],{"type":16,"tag":359,"props":377,"children":378},{},[379],{"type":16,"tag":33,"props":380,"children":382},{"className":381},[],[383],{"type":21,"value":384},"transcript_path",{"type":16,"tag":359,"props":386,"children":387},{},[388],{"type":21,"value":389},"Path to the conversation log on disk.",{"type":16,"tag":337,"props":391,"children":392},{},[393,402],{"type":16,"tag":359,"props":394,"children":395},{},[396],{"type":16,"tag":33,"props":397,"children":399},{"className":398},[],[400],{"type":21,"value":401},"cwd",{"type":16,"tag":359,"props":403,"children":404},{},[405],{"type":21,"value":406},"The directory the session is running in.",{"type":16,"tag":337,"props":408,"children":409},{},[410,419],{"type":16,"tag":359,"props":411,"children":412},{},[413],{"type":16,"tag":33,"props":414,"children":416},{"className":415},[],[417],{"type":21,"value":418},"stop_hook_active",{"type":16,"tag":359,"props":420,"children":421},{},[422,428,430,435],{"type":16,"tag":33,"props":423,"children":425},{"className":424},[],[426],{"type":21,"value":427},"true",{"type":21,"value":429}," if this turn is already continuing because of a ",{"type":16,"tag":33,"props":431,"children":433},{"className":432},[],[434],{"type":21,"value":38},{"type":21,"value":436}," hook.",{"type":16,"tag":17,"props":438,"children":439},{},[440,445],{"type":16,"tag":33,"props":441,"children":443},{"className":442},[],[444],{"type":21,"value":401},{"type":21,"value":446}," is the one you will use most: it turns a generic \"done\" into \"the API project is done\".",{"type":16,"tag":134,"props":448,"children":452},{"className":449,"code":450,"language":451,"meta":7,"style":7},"language-bash shiki shiki-themes github-light github-dark","#!/usr/bin/env bash\n# .claude/hooks/done.sh\npayload=$(cat)\nproject=$(basename \"$(echo \"$payload\" | jq -r '.cwd')\")\nnotify-send \"Claude Code\" \"$project finished\"\n","bash",[453],{"type":16,"tag":33,"props":454,"children":455},{"__ignoreMap":7},[456,465,473,503,573],{"type":16,"tag":144,"props":457,"children":458},{"class":146,"line":147},[459],{"type":16,"tag":144,"props":460,"children":462},{"style":461},"--shiki-default:#6A737D;--shiki-dark:#6A737D",[463],{"type":21,"value":464},"#!/usr/bin/env bash\n",{"type":16,"tag":144,"props":466,"children":467},{"class":146,"line":157},[468],{"type":16,"tag":144,"props":469,"children":470},{"style":461},[471],{"type":21,"value":472},"# .claude/hooks/done.sh\n",{"type":16,"tag":144,"props":474,"children":475},{"class":146,"line":172},[476,481,487,492,498],{"type":16,"tag":144,"props":477,"children":478},{"style":151},[479],{"type":21,"value":480},"payload",{"type":16,"tag":144,"props":482,"children":484},{"style":483},"--shiki-default:#D73A49;--shiki-dark:#F97583",[485],{"type":21,"value":486},"=",{"type":16,"tag":144,"props":488,"children":489},{"style":151},[490],{"type":21,"value":491},"$(",{"type":16,"tag":144,"props":493,"children":495},{"style":494},"--shiki-default:#6F42C1;--shiki-dark:#B392F0",[496],{"type":21,"value":497},"cat",{"type":16,"tag":144,"props":499,"children":500},{"style":151},[501],{"type":21,"value":502},")\n",{"type":16,"tag":144,"props":504,"children":505},{"class":146,"line":186},[506,511,515,519,524,529,534,539,544,549,554,559,564,569],{"type":16,"tag":144,"props":507,"children":508},{"style":151},[509],{"type":21,"value":510},"project",{"type":16,"tag":144,"props":512,"children":513},{"style":483},[514],{"type":21,"value":486},{"type":16,"tag":144,"props":516,"children":517},{"style":151},[518],{"type":21,"value":491},{"type":16,"tag":144,"props":520,"children":521},{"style":494},[522],{"type":21,"value":523},"basename",{"type":16,"tag":144,"props":525,"children":526},{"style":227},[527],{"type":21,"value":528}," \"$(",{"type":16,"tag":144,"props":530,"children":531},{"style":161},[532],{"type":21,"value":533},"echo",{"type":16,"tag":144,"props":535,"children":536},{"style":227},[537],{"type":21,"value":538}," \"",{"type":16,"tag":144,"props":540,"children":541},{"style":151},[542],{"type":21,"value":543},"$payload",{"type":16,"tag":144,"props":545,"children":546},{"style":227},[547],{"type":21,"value":548},"\" ",{"type":16,"tag":144,"props":550,"children":551},{"style":483},[552],{"type":21,"value":553},"|",{"type":16,"tag":144,"props":555,"children":556},{"style":494},[557],{"type":21,"value":558}," jq",{"type":16,"tag":144,"props":560,"children":561},{"style":161},[562],{"type":21,"value":563}," -r",{"type":16,"tag":144,"props":565,"children":566},{"style":227},[567],{"type":21,"value":568}," '.cwd')\"",{"type":16,"tag":144,"props":570,"children":571},{"style":151},[572],{"type":21,"value":502},{"type":16,"tag":144,"props":574,"children":575},{"class":146,"line":195},[576,581,586,590,595],{"type":16,"tag":144,"props":577,"children":578},{"style":494},[579],{"type":21,"value":580},"notify-send",{"type":16,"tag":144,"props":582,"children":583},{"style":227},[584],{"type":21,"value":585}," \"Claude Code\"",{"type":16,"tag":144,"props":587,"children":588},{"style":227},[589],{"type":21,"value":538},{"type":16,"tag":144,"props":591,"children":592},{"style":151},[593],{"type":21,"value":594},"$project",{"type":16,"tag":144,"props":596,"children":597},{"style":227},[598],{"type":21,"value":599}," finished\"\n",{"type":16,"tag":48,"props":601,"children":603},{"id":602},"notify-yourself",[604],{"type":21,"value":605},"Notify yourself",{"type":16,"tag":17,"props":607,"children":608},{},[609],{"type":21,"value":610},"The most common use is a heads-up. On macOS:",{"type":16,"tag":134,"props":612,"children":614},{"className":136,"code":613,"language":138,"meta":7,"style":7},"{\n  \"hooks\": {\n    \"Stop\": [\n      {\n        \"hooks\": [\n          { \"type\": \"command\", \"command\": \"osascript -e 'display notification \\\"Run finished\\\" with title \\\"Claude Code\\\" sound name \\\"Glass\\\"'\" }\n        ]\n      }\n    ]\n  }\n}\n",[615],{"type":16,"tag":33,"props":616,"children":617},{"__ignoreMap":7},[618,625,636,647,654,665,759,766,773,780,787],{"type":16,"tag":144,"props":619,"children":620},{"class":146,"line":147},[621],{"type":16,"tag":144,"props":622,"children":623},{"style":151},[624],{"type":21,"value":154},{"type":16,"tag":144,"props":626,"children":627},{"class":146,"line":157},[628,632],{"type":16,"tag":144,"props":629,"children":630},{"style":161},[631],{"type":21,"value":164},{"type":16,"tag":144,"props":633,"children":634},{"style":151},[635],{"type":21,"value":169},{"type":16,"tag":144,"props":637,"children":638},{"class":146,"line":172},[639,643],{"type":16,"tag":144,"props":640,"children":641},{"style":161},[642],{"type":21,"value":178},{"type":16,"tag":144,"props":644,"children":645},{"style":151},[646],{"type":21,"value":183},{"type":16,"tag":144,"props":648,"children":649},{"class":146,"line":186},[650],{"type":16,"tag":144,"props":651,"children":652},{"style":151},[653],{"type":21,"value":192},{"type":16,"tag":144,"props":655,"children":656},{"class":146,"line":195},[657,661],{"type":16,"tag":144,"props":658,"children":659},{"style":161},[660],{"type":21,"value":201},{"type":16,"tag":144,"props":662,"children":663},{"style":151},[664],{"type":21,"value":183},{"type":16,"tag":144,"props":666,"children":667},{"class":146,"line":208},[668,672,676,680,684,688,692,696,701,705,710,714,719,723,728,732,737,741,746,750,755],{"type":16,"tag":144,"props":669,"children":670},{"style":151},[671],{"type":21,"value":214},{"type":16,"tag":144,"props":673,"children":674},{"style":161},[675],{"type":21,"value":219},{"type":16,"tag":144,"props":677,"children":678},{"style":151},[679],{"type":21,"value":224},{"type":16,"tag":144,"props":681,"children":682},{"style":227},[683],{"type":21,"value":230},{"type":16,"tag":144,"props":685,"children":686},{"style":151},[687],{"type":21,"value":31},{"type":16,"tag":144,"props":689,"children":690},{"style":161},[691],{"type":21,"value":230},{"type":16,"tag":144,"props":693,"children":694},{"style":151},[695],{"type":21,"value":224},{"type":16,"tag":144,"props":697,"children":698},{"style":227},[699],{"type":21,"value":700},"\"osascript -e 'display notification ",{"type":16,"tag":144,"props":702,"children":703},{"style":161},[704],{"type":21,"value":252},{"type":16,"tag":144,"props":706,"children":707},{"style":227},[708],{"type":21,"value":709},"Run finished",{"type":16,"tag":144,"props":711,"children":712},{"style":161},[713],{"type":21,"value":252},{"type":16,"tag":144,"props":715,"children":716},{"style":227},[717],{"type":21,"value":718}," with title ",{"type":16,"tag":144,"props":720,"children":721},{"style":161},[722],{"type":21,"value":252},{"type":16,"tag":144,"props":724,"children":725},{"style":227},[726],{"type":21,"value":727},"Claude Code",{"type":16,"tag":144,"props":729,"children":730},{"style":161},[731],{"type":21,"value":252},{"type":16,"tag":144,"props":733,"children":734},{"style":227},[735],{"type":21,"value":736}," sound name ",{"type":16,"tag":144,"props":738,"children":739},{"style":161},[740],{"type":21,"value":252},{"type":16,"tag":144,"props":742,"children":743},{"style":227},[744],{"type":21,"value":745},"Glass",{"type":16,"tag":144,"props":747,"children":748},{"style":161},[749],{"type":21,"value":252},{"type":16,"tag":144,"props":751,"children":752},{"style":227},[753],{"type":21,"value":754},"'\"",{"type":16,"tag":144,"props":756,"children":757},{"style":151},[758],{"type":21,"value":271},{"type":16,"tag":144,"props":760,"children":761},{"class":146,"line":274},[762],{"type":16,"tag":144,"props":763,"children":764},{"style":151},[765],{"type":21,"value":280},{"type":16,"tag":144,"props":767,"children":768},{"class":146,"line":283},[769],{"type":16,"tag":144,"props":770,"children":771},{"style":151},[772],{"type":21,"value":289},{"type":16,"tag":144,"props":774,"children":775},{"class":146,"line":292},[776],{"type":16,"tag":144,"props":777,"children":778},{"style":151},[779],{"type":21,"value":298},{"type":16,"tag":144,"props":781,"children":782},{"class":146,"line":301},[783],{"type":16,"tag":144,"props":784,"children":785},{"style":151},[786],{"type":21,"value":307},{"type":16,"tag":144,"props":788,"children":789},{"class":146,"line":310},[790],{"type":16,"tag":144,"props":791,"children":792},{"style":151},[793],{"type":21,"value":316},{"type":16,"tag":17,"props":795,"children":796},{},[797,799,805,807,813,815,821],{"type":21,"value":798},"On Linux, use ",{"type":16,"tag":33,"props":800,"children":802},{"className":801},[],[803],{"type":21,"value":804},"notify-send 'Claude Code' 'Run finished'",{"type":21,"value":806},". Want a plain sound instead? A single ",{"type":16,"tag":33,"props":808,"children":810},{"className":809},[],[811],{"type":21,"value":812},"printf '\\\\a'",{"type":21,"value":814}," rings the terminal bell. There is a fuller walkthrough in ",{"type":16,"tag":24,"props":816,"children":818},{"href":817},"/guides/claude-code-notifications",[819],{"type":21,"value":820},"how to get notified when Claude Code needs you (or finishes)",{"type":21,"value":822},".",{"type":16,"tag":48,"props":824,"children":826},{"id":825},"chain-the-next-step",[827],{"type":21,"value":828},"Chain the next step",{"type":16,"tag":17,"props":830,"children":831},{},[832,834,839,841,847],{"type":21,"value":833},"Because the command is just a shell command, ",{"type":16,"tag":33,"props":835,"children":837},{"className":836},[],[838],{"type":21,"value":38},{"type":21,"value":840}," can also ",{"type":16,"tag":842,"props":843,"children":844},"em",{},[845],{"type":21,"value":846},"do",{"type":21,"value":848}," something, like run your test suite when a coding turn ends:",{"type":16,"tag":134,"props":850,"children":852},{"className":136,"code":851,"language":138,"meta":7,"style":7},"{\n  \"hooks\": {\n    \"Stop\": [\n      { \"hooks\": [{ \"type\": \"command\", \"command\": \"npm test --silent || notify-send 'Claude Code' 'tests failed'\" }] }\n    ]\n  }\n}\n",[853],{"type":16,"tag":33,"props":854,"children":855},{"__ignoreMap":7},[856,863,874,885,937,944,951],{"type":16,"tag":144,"props":857,"children":858},{"class":146,"line":147},[859],{"type":16,"tag":144,"props":860,"children":861},{"style":151},[862],{"type":21,"value":154},{"type":16,"tag":144,"props":864,"children":865},{"class":146,"line":157},[866,870],{"type":16,"tag":144,"props":867,"children":868},{"style":161},[869],{"type":21,"value":164},{"type":16,"tag":144,"props":871,"children":872},{"style":151},[873],{"type":21,"value":169},{"type":16,"tag":144,"props":875,"children":876},{"class":146,"line":172},[877,881],{"type":16,"tag":144,"props":878,"children":879},{"style":161},[880],{"type":21,"value":178},{"type":16,"tag":144,"props":882,"children":883},{"style":151},[884],{"type":21,"value":183},{"type":16,"tag":144,"props":886,"children":887},{"class":146,"line":186},[888,893,898,903,907,911,915,919,923,927,932],{"type":16,"tag":144,"props":889,"children":890},{"style":151},[891],{"type":21,"value":892},"      { ",{"type":16,"tag":144,"props":894,"children":895},{"style":161},[896],{"type":21,"value":897},"\"hooks\"",{"type":16,"tag":144,"props":899,"children":900},{"style":151},[901],{"type":21,"value":902},": [{ ",{"type":16,"tag":144,"props":904,"children":905},{"style":161},[906],{"type":21,"value":219},{"type":16,"tag":144,"props":908,"children":909},{"style":151},[910],{"type":21,"value":224},{"type":16,"tag":144,"props":912,"children":913},{"style":227},[914],{"type":21,"value":230},{"type":16,"tag":144,"props":916,"children":917},{"style":151},[918],{"type":21,"value":31},{"type":16,"tag":144,"props":920,"children":921},{"style":161},[922],{"type":21,"value":230},{"type":16,"tag":144,"props":924,"children":925},{"style":151},[926],{"type":21,"value":224},{"type":16,"tag":144,"props":928,"children":929},{"style":227},[930],{"type":21,"value":931},"\"npm test --silent || notify-send 'Claude Code' 'tests failed'\"",{"type":16,"tag":144,"props":933,"children":934},{"style":151},[935],{"type":21,"value":936}," }] }\n",{"type":16,"tag":144,"props":938,"children":939},{"class":146,"line":195},[940],{"type":16,"tag":144,"props":941,"children":942},{"style":151},[943],{"type":21,"value":298},{"type":16,"tag":144,"props":945,"children":946},{"class":146,"line":208},[947],{"type":16,"tag":144,"props":948,"children":949},{"style":151},[950],{"type":21,"value":307},{"type":16,"tag":144,"props":952,"children":953},{"class":146,"line":274},[954],{"type":16,"tag":144,"props":955,"children":956},{"style":151},[957],{"type":21,"value":316},{"type":16,"tag":17,"props":959,"children":960},{},[961,963,969],{"type":21,"value":962},"Keep these fast and safe: the hook runs automatically, so anything slow or destructive will bite you unattended. The ",{"type":16,"tag":33,"props":964,"children":966},{"className":965},[],[967],{"type":21,"value":968},"timeout",{"type":21,"value":970}," field (in seconds) caps how long Claude waits:",{"type":16,"tag":134,"props":972,"children":974},{"className":136,"code":973,"language":138,"meta":7,"style":7},"{ \"type\": \"command\", \"command\": \"npm test --silent\", \"timeout\": 120 }\n",[975],{"type":16,"tag":33,"props":976,"children":977},{"__ignoreMap":7},[978],{"type":16,"tag":144,"props":979,"children":980},{"class":146,"line":147},[981,986,990,994,998,1002,1006,1010,1015,1019,1024,1028,1033],{"type":16,"tag":144,"props":982,"children":983},{"style":151},[984],{"type":21,"value":985},"{ ",{"type":16,"tag":144,"props":987,"children":988},{"style":161},[989],{"type":21,"value":219},{"type":16,"tag":144,"props":991,"children":992},{"style":151},[993],{"type":21,"value":224},{"type":16,"tag":144,"props":995,"children":996},{"style":227},[997],{"type":21,"value":230},{"type":16,"tag":144,"props":999,"children":1000},{"style":151},[1001],{"type":21,"value":31},{"type":16,"tag":144,"props":1003,"children":1004},{"style":161},[1005],{"type":21,"value":230},{"type":16,"tag":144,"props":1007,"children":1008},{"style":151},[1009],{"type":21,"value":224},{"type":16,"tag":144,"props":1011,"children":1012},{"style":227},[1013],{"type":21,"value":1014},"\"npm test --silent\"",{"type":16,"tag":144,"props":1016,"children":1017},{"style":151},[1018],{"type":21,"value":31},{"type":16,"tag":144,"props":1020,"children":1021},{"style":161},[1022],{"type":21,"value":1023},"\"timeout\"",{"type":16,"tag":144,"props":1025,"children":1026},{"style":151},[1027],{"type":21,"value":224},{"type":16,"tag":144,"props":1029,"children":1030},{"style":161},[1031],{"type":21,"value":1032},"120",{"type":16,"tag":144,"props":1034,"children":1035},{"style":151},[1036],{"type":21,"value":271},{"type":16,"tag":48,"props":1038,"children":1040},{"id":1039},"sending-claude-back-to-work",[1041],{"type":21,"value":1042},"Sending Claude back to work",{"type":16,"tag":17,"props":1044,"children":1045},{},[1046,1051,1053,1059,1061,1067],{"type":16,"tag":33,"props":1047,"children":1049},{"className":1048},[],[1050],{"type":21,"value":38},{"type":21,"value":1052}," can do more than observe: exit with code ",{"type":16,"tag":33,"props":1054,"children":1056},{"className":1055},[],[1057],{"type":21,"value":1058},"2",{"type":21,"value":1060}," and whatever your script prints on ",{"type":16,"tag":33,"props":1062,"children":1064},{"className":1063},[],[1065],{"type":21,"value":1066},"stderr",{"type":21,"value":1068}," goes back to Claude, which continues the turn instead of stopping. That turns the hook into a completion check: if the linter fails, do not let the run end.",{"type":16,"tag":134,"props":1070,"children":1072},{"className":449,"code":1071,"language":451,"meta":7,"style":7},"#!/usr/bin/env bash\npayload=$(cat)\n\n# Never block twice in a row, or the turn will never end.\nif [ \"$(echo \"$payload\" | jq -r '.stop_hook_active')\" = \"true\" ]; then\n  exit 0\nfi\n\nif ! npm run lint --silent; then\n  echo \"Lint is failing. Fix the reported errors before finishing.\" >&2\n  exit 2\nfi\nexit 0\n",[1073],{"type":16,"tag":33,"props":1074,"children":1075},{"__ignoreMap":7},[1076,1083,1106,1115,1123,1194,1207,1215,1222,1263,1281,1293,1301],{"type":16,"tag":144,"props":1077,"children":1078},{"class":146,"line":147},[1079],{"type":16,"tag":144,"props":1080,"children":1081},{"style":461},[1082],{"type":21,"value":464},{"type":16,"tag":144,"props":1084,"children":1085},{"class":146,"line":157},[1086,1090,1094,1098,1102],{"type":16,"tag":144,"props":1087,"children":1088},{"style":151},[1089],{"type":21,"value":480},{"type":16,"tag":144,"props":1091,"children":1092},{"style":483},[1093],{"type":21,"value":486},{"type":16,"tag":144,"props":1095,"children":1096},{"style":151},[1097],{"type":21,"value":491},{"type":16,"tag":144,"props":1099,"children":1100},{"style":494},[1101],{"type":21,"value":497},{"type":16,"tag":144,"props":1103,"children":1104},{"style":151},[1105],{"type":21,"value":502},{"type":16,"tag":144,"props":1107,"children":1108},{"class":146,"line":172},[1109],{"type":16,"tag":144,"props":1110,"children":1112},{"emptyLinePlaceholder":1111},true,[1113],{"type":21,"value":1114},"\n",{"type":16,"tag":144,"props":1116,"children":1117},{"class":146,"line":186},[1118],{"type":16,"tag":144,"props":1119,"children":1120},{"style":461},[1121],{"type":21,"value":1122},"# Never block twice in a row, or the turn will never end.\n",{"type":16,"tag":144,"props":1124,"children":1125},{"class":146,"line":195},[1126,1131,1136,1141,1145,1149,1153,1157,1161,1165,1169,1174,1179,1184,1189],{"type":16,"tag":144,"props":1127,"children":1128},{"style":483},[1129],{"type":21,"value":1130},"if",{"type":16,"tag":144,"props":1132,"children":1133},{"style":151},[1134],{"type":21,"value":1135}," [ ",{"type":16,"tag":144,"props":1137,"children":1138},{"style":227},[1139],{"type":21,"value":1140},"\"$(",{"type":16,"tag":144,"props":1142,"children":1143},{"style":161},[1144],{"type":21,"value":533},{"type":16,"tag":144,"props":1146,"children":1147},{"style":227},[1148],{"type":21,"value":538},{"type":16,"tag":144,"props":1150,"children":1151},{"style":151},[1152],{"type":21,"value":543},{"type":16,"tag":144,"props":1154,"children":1155},{"style":227},[1156],{"type":21,"value":548},{"type":16,"tag":144,"props":1158,"children":1159},{"style":483},[1160],{"type":21,"value":553},{"type":16,"tag":144,"props":1162,"children":1163},{"style":494},[1164],{"type":21,"value":558},{"type":16,"tag":144,"props":1166,"children":1167},{"style":161},[1168],{"type":21,"value":563},{"type":16,"tag":144,"props":1170,"children":1171},{"style":227},[1172],{"type":21,"value":1173}," '.stop_hook_active')\"",{"type":16,"tag":144,"props":1175,"children":1176},{"style":483},[1177],{"type":21,"value":1178}," =",{"type":16,"tag":144,"props":1180,"children":1181},{"style":227},[1182],{"type":21,"value":1183}," \"true\"",{"type":16,"tag":144,"props":1185,"children":1186},{"style":151},[1187],{"type":21,"value":1188}," ]; ",{"type":16,"tag":144,"props":1190,"children":1191},{"style":483},[1192],{"type":21,"value":1193},"then\n",{"type":16,"tag":144,"props":1195,"children":1196},{"class":146,"line":208},[1197,1202],{"type":16,"tag":144,"props":1198,"children":1199},{"style":161},[1200],{"type":21,"value":1201},"  exit",{"type":16,"tag":144,"props":1203,"children":1204},{"style":161},[1205],{"type":21,"value":1206}," 0\n",{"type":16,"tag":144,"props":1208,"children":1209},{"class":146,"line":274},[1210],{"type":16,"tag":144,"props":1211,"children":1212},{"style":483},[1213],{"type":21,"value":1214},"fi\n",{"type":16,"tag":144,"props":1216,"children":1217},{"class":146,"line":283},[1218],{"type":16,"tag":144,"props":1219,"children":1220},{"emptyLinePlaceholder":1111},[1221],{"type":21,"value":1114},{"type":16,"tag":144,"props":1223,"children":1224},{"class":146,"line":292},[1225,1229,1234,1239,1244,1249,1254,1259],{"type":16,"tag":144,"props":1226,"children":1227},{"style":483},[1228],{"type":21,"value":1130},{"type":16,"tag":144,"props":1230,"children":1231},{"style":483},[1232],{"type":21,"value":1233}," !",{"type":16,"tag":144,"props":1235,"children":1236},{"style":494},[1237],{"type":21,"value":1238}," npm",{"type":16,"tag":144,"props":1240,"children":1241},{"style":227},[1242],{"type":21,"value":1243}," run",{"type":16,"tag":144,"props":1245,"children":1246},{"style":227},[1247],{"type":21,"value":1248}," lint",{"type":16,"tag":144,"props":1250,"children":1251},{"style":161},[1252],{"type":21,"value":1253}," --silent",{"type":16,"tag":144,"props":1255,"children":1256},{"style":151},[1257],{"type":21,"value":1258},"; ",{"type":16,"tag":144,"props":1260,"children":1261},{"style":483},[1262],{"type":21,"value":1193},{"type":16,"tag":144,"props":1264,"children":1265},{"class":146,"line":301},[1266,1271,1276],{"type":16,"tag":144,"props":1267,"children":1268},{"style":161},[1269],{"type":21,"value":1270},"  echo",{"type":16,"tag":144,"props":1272,"children":1273},{"style":227},[1274],{"type":21,"value":1275}," \"Lint is failing. Fix the reported errors before finishing.\"",{"type":16,"tag":144,"props":1277,"children":1278},{"style":483},[1279],{"type":21,"value":1280}," >&2\n",{"type":16,"tag":144,"props":1282,"children":1283},{"class":146,"line":310},[1284,1288],{"type":16,"tag":144,"props":1285,"children":1286},{"style":161},[1287],{"type":21,"value":1201},{"type":16,"tag":144,"props":1289,"children":1290},{"style":161},[1291],{"type":21,"value":1292}," 2\n",{"type":16,"tag":144,"props":1294,"children":1296},{"class":146,"line":1295},12,[1297],{"type":16,"tag":144,"props":1298,"children":1299},{"style":483},[1300],{"type":21,"value":1214},{"type":16,"tag":144,"props":1302,"children":1304},{"class":146,"line":1303},13,[1305,1310],{"type":16,"tag":144,"props":1306,"children":1307},{"style":161},[1308],{"type":21,"value":1309},"exit",{"type":16,"tag":144,"props":1311,"children":1312},{"style":161},[1313],{"type":21,"value":1206},{"type":16,"tag":17,"props":1315,"children":1316},{},[1317,1319,1324],{"type":21,"value":1318},"That ",{"type":16,"tag":33,"props":1320,"children":1322},{"className":1321},[],[1323],{"type":21,"value":418},{"type":21,"value":1325}," guard is not optional. Without it, a hook that always blocks will send Claude back to work forever, burning tokens with nobody watching. Check the flag, or cap the retries yourself with a counter file.",{"type":16,"tag":48,"props":1327,"children":1329},{"id":1328},"stop-subagentstop-and-sessionend",[1330],{"type":21,"value":1331},"Stop, SubagentStop and SessionEnd",{"type":16,"tag":17,"props":1333,"children":1334},{},[1335],{"type":21,"value":1336},"Three events sound like \"it is over\" and only one of them means what you want:",{"type":16,"tag":329,"props":1338,"children":1339},{},[1340,1361],{"type":16,"tag":333,"props":1341,"children":1342},{},[1343],{"type":16,"tag":337,"props":1344,"children":1345},{},[1346,1351,1356],{"type":16,"tag":341,"props":1347,"children":1348},{},[1349],{"type":21,"value":1350},"Event",{"type":16,"tag":341,"props":1352,"children":1353},{},[1354],{"type":21,"value":1355},"Fires",{"type":16,"tag":341,"props":1357,"children":1358},{},[1359],{"type":21,"value":1360},"Times per session",{"type":16,"tag":352,"props":1362,"children":1363},{},[1364,1385,1407],{"type":16,"tag":337,"props":1365,"children":1366},{},[1367,1375,1380],{"type":16,"tag":359,"props":1368,"children":1369},{},[1370],{"type":16,"tag":33,"props":1371,"children":1373},{"className":1372},[],[1374],{"type":21,"value":38},{"type":16,"tag":359,"props":1376,"children":1377},{},[1378],{"type":21,"value":1379},"The main agent finishes a turn.",{"type":16,"tag":359,"props":1381,"children":1382},{},[1383],{"type":21,"value":1384},"Once per turn, so many times.",{"type":16,"tag":337,"props":1386,"children":1387},{},[1388,1397,1402],{"type":16,"tag":359,"props":1389,"children":1390},{},[1391],{"type":16,"tag":33,"props":1392,"children":1394},{"className":1393},[],[1395],{"type":21,"value":1396},"SubagentStop",{"type":16,"tag":359,"props":1398,"children":1399},{},[1400],{"type":21,"value":1401},"A spawned subagent finishes.",{"type":16,"tag":359,"props":1403,"children":1404},{},[1405],{"type":21,"value":1406},"Once per subagent, often in bursts.",{"type":16,"tag":337,"props":1408,"children":1409},{},[1410,1418,1423],{"type":16,"tag":359,"props":1411,"children":1412},{},[1413],{"type":16,"tag":33,"props":1414,"children":1416},{"className":1415},[],[1417],{"type":21,"value":96},{"type":16,"tag":359,"props":1419,"children":1420},{},[1421],{"type":21,"value":1422},"The session itself closes.",{"type":16,"tag":359,"props":1424,"children":1425},{},[1426],{"type":21,"value":1427},"Once, at the very end.",{"type":16,"tag":17,"props":1429,"children":1430},{},[1431,1433,1438,1440,1445,1447,1452,1454,1460],{"type":21,"value":1432},"For \"come back, it is done\", ",{"type":16,"tag":33,"props":1434,"children":1436},{"className":1435},[],[1437],{"type":21,"value":38},{"type":21,"value":1439}," is the one. Wiring a notification to ",{"type":16,"tag":33,"props":1441,"children":1443},{"className":1442},[],[1444],{"type":21,"value":1396},{"type":21,"value":1446}," will alert you eight times during a single fan-out, and ",{"type":16,"tag":33,"props":1448,"children":1450},{"className":1449},[],[1451],{"type":21,"value":96},{"type":21,"value":1453}," fires too late to be useful. More on all of them in ",{"type":16,"tag":24,"props":1455,"children":1457},{"href":1456},"/guides/claude-code-hook-events",[1458],{"type":21,"value":1459},"what every Claude Code hook event means",{"type":21,"value":822},{"type":16,"tag":48,"props":1462,"children":1464},{"id":1463},"saying-what-it-finished",[1465],{"type":21,"value":1466},"Saying what it finished",{"type":16,"tag":17,"props":1468,"children":1469},{},[1470,1475,1477,1482,1484,1490],{"type":16,"tag":33,"props":1471,"children":1473},{"className":1472},[],[1474],{"type":21,"value":38},{"type":21,"value":1476}," tells you a turn ended, not what came out of it. If you want that in your notification, the payload hands you ",{"type":16,"tag":33,"props":1478,"children":1480},{"className":1479},[],[1481],{"type":21,"value":384},{"type":21,"value":1483},", a JSON Lines file of the conversation, so the last assistant message is one ",{"type":16,"tag":33,"props":1485,"children":1487},{"className":1486},[],[1488],{"type":21,"value":1489},"jq",{"type":21,"value":1491}," away:",{"type":16,"tag":134,"props":1493,"children":1495},{"className":449,"code":1494,"language":451,"meta":7,"style":7},"#!/usr/bin/env bash\npayload=$(cat)\ntranscript=$(echo \"$payload\" | jq -r '.transcript_path')\nlast=$(tail -n 20 \"$transcript\" | jq -r 'select(.type == \"assistant\") | .message.content[]? | select(.type == \"text\") | .text' | tail -c 120)\nnotify-send \"Claude Code\" \"${last:-Run finished}\"\n",[1496],{"type":16,"tag":33,"props":1497,"children":1498},{"__ignoreMap":7},[1499,1506,1529,1584,1668],{"type":16,"tag":144,"props":1500,"children":1501},{"class":146,"line":147},[1502],{"type":16,"tag":144,"props":1503,"children":1504},{"style":461},[1505],{"type":21,"value":464},{"type":16,"tag":144,"props":1507,"children":1508},{"class":146,"line":157},[1509,1513,1517,1521,1525],{"type":16,"tag":144,"props":1510,"children":1511},{"style":151},[1512],{"type":21,"value":480},{"type":16,"tag":144,"props":1514,"children":1515},{"style":483},[1516],{"type":21,"value":486},{"type":16,"tag":144,"props":1518,"children":1519},{"style":151},[1520],{"type":21,"value":491},{"type":16,"tag":144,"props":1522,"children":1523},{"style":494},[1524],{"type":21,"value":497},{"type":16,"tag":144,"props":1526,"children":1527},{"style":151},[1528],{"type":21,"value":502},{"type":16,"tag":144,"props":1530,"children":1531},{"class":146,"line":172},[1532,1537,1541,1545,1549,1553,1557,1562,1567,1571,1575,1580],{"type":16,"tag":144,"props":1533,"children":1534},{"style":151},[1535],{"type":21,"value":1536},"transcript",{"type":16,"tag":144,"props":1538,"children":1539},{"style":483},[1540],{"type":21,"value":486},{"type":16,"tag":144,"props":1542,"children":1543},{"style":151},[1544],{"type":21,"value":491},{"type":16,"tag":144,"props":1546,"children":1547},{"style":161},[1548],{"type":21,"value":533},{"type":16,"tag":144,"props":1550,"children":1551},{"style":227},[1552],{"type":21,"value":538},{"type":16,"tag":144,"props":1554,"children":1555},{"style":151},[1556],{"type":21,"value":543},{"type":16,"tag":144,"props":1558,"children":1559},{"style":227},[1560],{"type":21,"value":1561},"\"",{"type":16,"tag":144,"props":1563,"children":1564},{"style":483},[1565],{"type":21,"value":1566}," |",{"type":16,"tag":144,"props":1568,"children":1569},{"style":494},[1570],{"type":21,"value":558},{"type":16,"tag":144,"props":1572,"children":1573},{"style":161},[1574],{"type":21,"value":563},{"type":16,"tag":144,"props":1576,"children":1577},{"style":227},[1578],{"type":21,"value":1579}," '.transcript_path'",{"type":16,"tag":144,"props":1581,"children":1582},{"style":151},[1583],{"type":21,"value":502},{"type":16,"tag":144,"props":1585,"children":1586},{"class":146,"line":186},[1587,1592,1596,1600,1605,1610,1615,1619,1624,1628,1632,1636,1640,1645,1649,1654,1659,1664],{"type":16,"tag":144,"props":1588,"children":1589},{"style":151},[1590],{"type":21,"value":1591},"last",{"type":16,"tag":144,"props":1593,"children":1594},{"style":483},[1595],{"type":21,"value":486},{"type":16,"tag":144,"props":1597,"children":1598},{"style":151},[1599],{"type":21,"value":491},{"type":16,"tag":144,"props":1601,"children":1602},{"style":494},[1603],{"type":21,"value":1604},"tail",{"type":16,"tag":144,"props":1606,"children":1607},{"style":161},[1608],{"type":21,"value":1609}," -n",{"type":16,"tag":144,"props":1611,"children":1612},{"style":161},[1613],{"type":21,"value":1614}," 20",{"type":16,"tag":144,"props":1616,"children":1617},{"style":227},[1618],{"type":21,"value":538},{"type":16,"tag":144,"props":1620,"children":1621},{"style":151},[1622],{"type":21,"value":1623},"$transcript",{"type":16,"tag":144,"props":1625,"children":1626},{"style":227},[1627],{"type":21,"value":1561},{"type":16,"tag":144,"props":1629,"children":1630},{"style":483},[1631],{"type":21,"value":1566},{"type":16,"tag":144,"props":1633,"children":1634},{"style":494},[1635],{"type":21,"value":558},{"type":16,"tag":144,"props":1637,"children":1638},{"style":161},[1639],{"type":21,"value":563},{"type":16,"tag":144,"props":1641,"children":1642},{"style":227},[1643],{"type":21,"value":1644}," 'select(.type == \"assistant\") | .message.content[]? | select(.type == \"text\") | .text'",{"type":16,"tag":144,"props":1646,"children":1647},{"style":483},[1648],{"type":21,"value":1566},{"type":16,"tag":144,"props":1650,"children":1651},{"style":494},[1652],{"type":21,"value":1653}," tail",{"type":16,"tag":144,"props":1655,"children":1656},{"style":161},[1657],{"type":21,"value":1658}," -c",{"type":16,"tag":144,"props":1660,"children":1661},{"style":161},[1662],{"type":21,"value":1663}," 120",{"type":16,"tag":144,"props":1665,"children":1666},{"style":151},[1667],{"type":21,"value":502},{"type":16,"tag":144,"props":1669,"children":1670},{"class":146,"line":195},[1671,1675,1679,1684,1688,1693,1698,1703],{"type":16,"tag":144,"props":1672,"children":1673},{"style":494},[1674],{"type":21,"value":580},{"type":16,"tag":144,"props":1676,"children":1677},{"style":227},[1678],{"type":21,"value":585},{"type":16,"tag":144,"props":1680,"children":1681},{"style":227},[1682],{"type":21,"value":1683}," \"${",{"type":16,"tag":144,"props":1685,"children":1686},{"style":151},[1687],{"type":21,"value":1591},{"type":16,"tag":144,"props":1689,"children":1690},{"style":483},[1691],{"type":21,"value":1692},":-",{"type":16,"tag":144,"props":1694,"children":1695},{"style":151},[1696],{"type":21,"value":1697},"Run",{"type":16,"tag":144,"props":1699,"children":1700},{"style":151},[1701],{"type":21,"value":1702}," finished",{"type":16,"tag":144,"props":1704,"children":1705},{"style":227},[1706],{"type":21,"value":1707},"}\"\n",{"type":16,"tag":17,"props":1709,"children":1710},{},[1711],{"type":21,"value":1712},"Be deliberate about this one. It is genuinely useful locally, and a bad idea for anything that leaves your machine: the transcript holds your prompts and your code, so never pipe it to a chat webhook or a remote logger.",{"type":16,"tag":48,"props":1714,"children":1716},{"id":1715},"debugging-it",[1717],{"type":21,"value":1718},"Debugging it",{"type":16,"tag":17,"props":1720,"children":1721},{},[1722,1724,1729,1731,1736,1738,1744,1746,1752,1754,1760],{"type":21,"value":1723},"A ",{"type":16,"tag":33,"props":1725,"children":1727},{"className":1726},[],[1728],{"type":21,"value":38},{"type":21,"value":1730}," hook that seems to do nothing is almost always one of two things. Either you edited ",{"type":16,"tag":33,"props":1732,"children":1734},{"className":1733},[],[1735],{"type":21,"value":122},{"type":21,"value":1737}," mid-session, and Claude Code is still using the hooks it snapshotted at startup (restart, or review from ",{"type":16,"tag":33,"props":1739,"children":1741},{"className":1740},[],[1742],{"type":21,"value":1743},"/hooks",{"type":21,"value":1745},"). Or the command works in your terminal but not here, because hooks run without your interactive shell setup and cannot see an alias or a ",{"type":16,"tag":33,"props":1747,"children":1749},{"className":1748},[],[1750],{"type":21,"value":1751},"PATH",{"type":21,"value":1753}," entry from your profile. Use absolute paths, and run ",{"type":16,"tag":33,"props":1755,"children":1757},{"className":1756},[],[1758],{"type":21,"value":1759},"claude --debug",{"type":21,"value":1761}," to watch the hook fire and see its exit code.",{"type":16,"tag":48,"props":1763,"children":1765},{"id":1764},"one-stop-hook-per-session-read-at-a-glance",[1766],{"type":21,"value":1767},"One Stop hook per session, read at a glance",{"type":16,"tag":17,"props":1769,"children":1770},{},[1771,1772,1777,1779,1785,1787,1792,1794,1799,1801,1806],{"type":21,"value":1723},{"type":16,"tag":33,"props":1773,"children":1775},{"className":1774},[],[1776],{"type":21,"value":38},{"type":21,"value":1778}," notification is perfect for one session. Run several at once and the pings blur together: which project just finished? ",{"type":16,"tag":24,"props":1780,"children":1782},{"href":1781},"/",[1783],{"type":21,"value":1784},"Blooby",{"type":21,"value":1786}," uses the same ",{"type":16,"tag":33,"props":1788,"children":1790},{"className":1789},[],[1791],{"type":21,"value":38},{"type":21,"value":1793}," event, but instead of a notification it makes the ",{"type":16,"tag":42,"props":1795,"children":1796},{},[1797],{"type":21,"value":1798},"mascot for that specific session",{"type":21,"value":1800}," celebrate, so you see ",{"type":16,"tag":842,"props":1802,"children":1803},{},[1804],{"type":21,"value":1805},"which",{"type":21,"value":1807}," of your running sessions just wrapped up without reading a word.",{"type":16,"tag":1809,"props":1810,"children":1811},"style",{},[1812],{"type":21,"value":1813},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":7,"searchDepth":157,"depth":157,"links":1815},[1816,1817,1818,1819,1820,1821,1822,1823,1824,1825],{"id":50,"depth":157,"text":53},{"id":101,"depth":157,"text":104},{"id":319,"depth":157,"text":322},{"id":602,"depth":157,"text":605},{"id":825,"depth":157,"text":828},{"id":1039,"depth":157,"text":1042},{"id":1328,"depth":157,"text":1331},{"id":1463,"depth":157,"text":1466},{"id":1715,"depth":157,"text":1718},{"id":1764,"depth":157,"text":1767},"markdown","content:guides:claude-code-stop-hook.md","content","guides/claude-code-stop-hook.md","guides/claude-code-stop-hook","md",1]