[Feature Request] Support for user-prompt-submit hook to log prompts

Resolved 💬 3 comments Opened Oct 22, 2025 by ramnishkalsi Closed Oct 26, 2025

Bug Description
How do I get a hook to log every prompt I write. This hook is not working -

{
"hooks": {
"user-prompt-submit": "echo \"$(date '+%Y-%m-%d %H:%M:%S') - $PROMPT\" >> \"$PROJECT_DIR/prompt_history.txt\""
}
}

I have tried placing the file at:
~/.config/claude-code/settings.json
and
$PROJECT_ROOT/.claude-code/settings.json

but none of them append to the prompt history as I was expecting. I think if I just instruct it to do it, it will work. but that feels like
wasting tokens. Please advise!

Environment Info

  • Platform: darwin
  • Terminal: iTerm.app
  • Version: 2.0.25
  • Feedback ID: 09dec197-4d6a-4ced-8b4c-16efdea7fb5c

Errors

[{"error":"Error: Request was aborted.\n    at makeRequest (/$bunfs/root/claude:506:3850)\n    at processTicksAndRejections (native:7:39)","timestamp":"2025-10-22T11:20:06.199Z"},{"error":"Error: No assistant message found\n    at Th (/$bunfs/root/claude:3358:12909)\n    at async <anonymous> (/$bunfs/root/claude:3358:21926)\n    at async Md1 (/$bunfs/root/claude:3358:2017)\n    at async aV (/$bunfs/root/claude:3358:21783)\n    at async <anonymous> (/$bunfs/root/claude:1149:5300)\n    at async <anonymous> (/$bunfs/root/claude:1149:4884)\n    at async <anonymous> (/$bunfs/root/claude:1149:4821)\n    at async EM1 (/$bunfs/root/claude:1216:16027)\n    at async checkPermissions (/$bunfs/root/claude:3426:1784)\n    at async <anonymous> (/$bunfs/root/claude:3566:20366)\n    at processTicksAndRejections (native:7:39)","timestamp":"2025-10-22T11:20:06.233Z"}]

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗