Hook
Inject Current Date
A Claude Code hook that tells the agent today's date, weekday and time zone on each prompt, so date math and changelog entries come out right.
.claude/settings.json
1node -e "let d='';process.stdin.on('data',c=>d+=c).on('end',()=>{let j={};try{j=JSON.parse(d)}catch(e){}const n=new Date();const z=x=>String(x).padStart(2,'0');const day=n.toLocaleDateString('en-US',{weekday:'long'});console.log('Current date: '+day+', '+n.getFullYear()+'-'+z(n.getMonth()+1)+'-'+z(n.getDate())+' (time zone '+Intl.DateTimeFormat().resolvedOptions().timeZone+'). Use it for anything that depends on today.');process.exit(0)})"
Claude CodeCodex
@
Inject Current Date
HookWorkflow
Free