~/.claude/settings.jsonJSON
{
"mcpServers": {
"clockme": {
"type": "http",
"url": "https://clockme.co/api/mcp",
"headers": {
"Authorization": "Bearer ck_live_YOUR_KEY"
}
}
},
"hooks": {
"SessionStart": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "p=$(basename \"$CLAUDE_PROJECT_DIR\"); if [ -z \"$p\" ] || [ \"$p\" = \"$(basename \"$HOME\")\" ]; then exit 0; fi; b=$(git -C \"$CLAUDE_PROJECT_DIR\" branch --show-current 2>/dev/null | tr -d '\"\\\\'); curl -sf --max-time 10 -X POST https://clockme.co/api/timer/start -H 'Authorization: Bearer ck_live_YOUR_KEY' -H 'Content-Type: application/json' -d \"{\\\"projectName\\\":\\\"$p\\\",\\\"branch\\\":\\\"$b\\\",\\\"autoCreate\\\":true,\\\"source\\\":\\\"hook\\\",\\\"description\\\":\\\"Claude Code session\\\"}\" > /dev/null",
"shell": "bash"
}
]
}
],
"SessionEnd": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "p=$(basename \"$CLAUDE_PROJECT_DIR\"); if [ -z \"$p\" ] || [ \"$p\" = \"$(basename \"$HOME\")\" ]; then exit 0; fi; curl -sf --max-time 10 -X POST https://clockme.co/api/timer/stop -H 'Authorization: Bearer ck_live_YOUR_KEY' -H 'Content-Type: application/json' -d \"{\\\"projectName\\\":\\\"$p\\\"}\" > /dev/null",
"shell": "bash"
}
]
}
],
"UserPromptSubmit": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "p=$(basename \"$CLAUDE_PROJECT_DIR\"); if [ -z \"$p\" ] || [ \"$p\" = \"$(basename \"$HOME\")\" ]; then exit 0; fi; b=$(git -C \"$CLAUDE_PROJECT_DIR\" branch --show-current 2>/dev/null | tr -d '\"\\\\'); curl -sf --max-time 10 -X POST https://clockme.co/api/timer/heartbeat -H 'Authorization: Bearer ck_live_YOUR_KEY' -H 'Content-Type: application/json' -d \"{\\\"projectName\\\":\\\"$p\\\",\\\"branch\\\":\\\"$b\\\"}\" > /dev/null",
"shell": "bash"
}
]
}
],
"Stop": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "p=$(basename \"$CLAUDE_PROJECT_DIR\"); if [ -z \"$p\" ] || [ \"$p\" = \"$(basename \"$HOME\")\" ]; then exit 0; fi; b=$(git -C \"$CLAUDE_PROJECT_DIR\" branch --show-current 2>/dev/null | tr -d '\"\\\\'); curl -sf --max-time 10 -X POST https://clockme.co/api/timer/heartbeat -H 'Authorization: Bearer ck_live_YOUR_KEY' -H 'Content-Type: application/json' -d \"{\\\"projectName\\\":\\\"$p\\\",\\\"branch\\\":\\\"$b\\\"}\" > /dev/null",
"shell": "bash"
}
]
}
],
"PostToolUse": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "p=$(basename \"$CLAUDE_PROJECT_DIR\"); if [ -z \"$p\" ] || [ \"$p\" = \"$(basename \"$HOME\")\" ]; then exit 0; fi; f=\"$HOME/.claude/.cm_beat_$p\"; now=$(date +%s); last=$(cat \"$f\" 2>/dev/null || echo 0); [ $((now-last)) -lt 60 ] && exit 0; echo \"$now\" > \"$f\"; b=$(git -C \"$CLAUDE_PROJECT_DIR\" branch --show-current 2>/dev/null | tr -d '\"\\\\'); curl -sf --max-time 10 -X POST https://clockme.co/api/timer/heartbeat -H 'Authorization: Bearer ck_live_YOUR_KEY' -H 'Content-Type: application/json' -d \"{\\\"projectName\\\":\\\"$p\\\",\\\"branch\\\":\\\"$b\\\"}\" > /dev/null",
"shell": "bash"
}
]
}
]
}
}