Inject current timestamp into every user message by default
Problem
Claude Code has no awareness of the current time. The system prompt date is set once at session start and goes stale immediately. There is no timestamp on user messages.
This means Claude cannot:
- Distinguish morning from evening (no appropriate greetings)
- Know if the user left for 8 hours and came back
- Understand what day of the week it is (e.g. whether markets are open)
- Adjust behavior based on time of day
- Detect that a "good morning" message came after an overnight gap
Every message feels like it arrived 1 second after the last one, regardless of actual elapsed time.
Workaround
A UserPromptSubmit hook that injects the timestamp works perfectly and requires no restart.
1. Create the hook script
~/.claude/hooks/inject-timestamp.sh:
#!/bin/bash
TIMESTAMP=$(date '+%A, %B %d, %Y %I:%M %p %Z')
jq -n --arg ts "$TIMESTAMP" '{
"hookSpecificOutput": {
"hookEventName": "UserPromptSubmit",
"additionalContext": "Current date/time: \($ts)"
}
}'
chmod +x ~/.claude/hooks/inject-timestamp.sh
2. Register it in settings
Add to ~/.claude/settings.json:
{
"hooks": {
"UserPromptSubmit": [
{
"hooks": [
{
"type": "command",
"command": "~/.claude/hooks/inject-timestamp.sh"
}
]
}
]
}
}
Hooks hot-reload — no restart needed. Every message from that point forward includes the current timestamp in Claude's context.
Proposal
Inject the current date/time (day of week, date, time, timezone) into every user message by default. No opt-in, no hook needed. Just make Claude know what time it is.
This is such a basic capability that it arguably should have shipped on day one.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗