feat: add timestamp to context header
Display current date/time in context header for both terminal (Color) and markdown formatters. Shows format like "2026-01-04 2:46am EST". Also bumps version to 8.5.9. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -14,12 +14,27 @@ import type {
|
||||
import { ModeManager } from '../../domain/ModeManager.js';
|
||||
import { formatObservationTokenDisplay } from '../TokenCalculator.js';
|
||||
|
||||
/**
|
||||
* Format current date/time for header display
|
||||
*/
|
||||
function formatHeaderDateTime(): string {
|
||||
const now = new Date();
|
||||
const date = now.toLocaleDateString('en-CA'); // YYYY-MM-DD format
|
||||
const time = now.toLocaleTimeString('en-US', {
|
||||
hour: 'numeric',
|
||||
minute: '2-digit',
|
||||
hour12: true
|
||||
}).toLowerCase().replace(' ', '');
|
||||
const tz = now.toLocaleTimeString('en-US', { timeZoneName: 'short' }).split(' ').pop();
|
||||
return `${date} ${time} ${tz}`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Render markdown header
|
||||
*/
|
||||
export function renderMarkdownHeader(project: string): string[] {
|
||||
return [
|
||||
`# [${project}] recent context`,
|
||||
`# [${project}] recent context, ${formatHeaderDateTime()}`,
|
||||
''
|
||||
];
|
||||
}
|
||||
@@ -222,5 +237,5 @@ export function renderMarkdownFooter(totalDiscoveryTokens: number, totalReadToke
|
||||
* Render markdown empty state
|
||||
*/
|
||||
export function renderMarkdownEmptyState(project: string): string {
|
||||
return `# [${project}] recent context\n\nNo previous sessions found for this project yet.`;
|
||||
return `# [${project}] recent context, ${formatHeaderDateTime()}\n\nNo previous sessions found for this project yet.`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user