Introduction

Sasha Shlemov, with Drinkins, personal AI assistant · Zed PR · VS Code feature request

TL;DR: Record each user message’s creation time and original UTC offset once, persist it with the thread, and supply it beside that message. Keep the changing clock out of the system prompt. This gives the AI chronology without repeatedly invalidating the prompt cache.

That sounds cosmetic until a session lasts longer than one coffee. “The build is still running” means something different after 30 seconds and after three hours. “Tomorrow” changes overnight. “This morning” depends on the user’s timezone. Without message times, neither the AI nor a later investigator can distinguish a pause from a retry or a stalled process.

An agent definitely can check the time using a tool. In practice, it does so reluctantly: the model must first notice that time matters and request the tool; the client executes it, attaches the tool call output, and sends another request. Every such tool loop adds latency and cost, and the model is trained to avoid it.

Adding the current time to the system prompt has the opposite problem. The system prompt is the beginning of the reusable server-side KV-cache; changing it on every turn invalidates the cached conversation history, degrading performance and potentially creating substantial bills.

On each turn, an AI client such as ChatGPT, VS Code, or Copilot CLI combines the visible chat text with useful model-facing metadata. Depending on the client, this may include the working directory, operating system and shell, open files, terminal state, and available tools. This is the context the model needs to interpret and act on the user’s message. We suggest adding one more host fact: the current time. The current user message is appended anyway, so attaching the time does not break the prefix cache.

The useful unit is the message:

user sends message
→ record creation timestamp once
→ persist it with the thread
→ include it in that message’s context forever
→ prefix is naturally accumulated

One mainstream agent already ships it. GitHub Copilot CLI is the only prior per-turn date/time/offset implementation we found. It has supplied per-turn date, time, and local UTC offset since version 1.0.32 on 2026-04-17 [1]. Local model-request logs from current version 1.0.83 show this as the first block of the captured user message:

<current_datetime>2026-09-09T22:02:57.364+02:00</current_datetime>

We implemented the same approach for Zed and VS Code:

  • Zed: try zed-industries/zed#63987 and leave us a 👍 if it is useful. The patch persists each new user-message timestamp and applies the established per-turn pattern in this compact form:

    <time>Wed 2026-09-09T01:22:58+02:00</time>
    
  • VS Code: the earlier feature request remains at microsoft/vscode#314377. The implementation patch adds configurable time, weekday, and timezone to VS Code’s existing per-turn date context [2]. We rebased and verified it against VS Code 13fa06a39ca and Copilot Chat 0.66.0 on 2026-09-09.

On top of Copilot CLI’s industry standard (n = 1), we added the weekday explicitly because deriving it reliably from a date is surprisingly error-prone for language models [3]. We also removed milliseconds from the model-facing message because their usefulness there is questionable.

Use the coordinate

Supplying time does not decide what the agent should do with it. That belongs in the user’s operating contract. For example:

Use message timestamps when interpreting relative expressions such as
“today,” “tomorrow,” “this morning,” and “later.” Use the recorded UTC
offset rather than assuming the user's timezone.

When resuming after a substantial gap, revalidate volatile state: running
processes, branches, credentials, browser sessions, files, and external jobs
may have changed. Do not infer elapsed tool runtime from conversational turn
count; inspect process or log evidence when duration matters.

Or, for a personal schedule:

My schedule rules are defined separately. Apply them only when message time
actually satisfies their conditions; do not guess that it is late, a workday,
or time for a break.

Vox intelligentiae artificialis

As an AI assistant, I already know what to do with time and how to interpret it. Just give it to me.

A calendar tells an AI what year it is. A watch lets it participate in a process.

Drinkins, AI assistant

References

[1] GitHub, GitHub Copilot CLI per-turn current datetime context. (Apr. 17, 2026). Accessed: Sep. 09, 2026. [Online]. Available: https://github.com/github/copilot-cli/blob/main/changelog.md

[2] S. Shlemov and Drinkins, VS Code configurable time, weekday, and timezone patch. (Sep. 09, 2026). Accessed: Sep. 09, 2026. [Online]. Available: https://eodus.github.io/patches/vscode-time-context.patch

[3] plee7, “Model confidently stated wrong weekday for a date.” Accessed: Sep. 09, 2026. [Online]. Available: https://github.com/anthropics/claude-code/issues/76170

[4] E. Welle, “Why can’t ChatGPT tell time?” Accessed: Sep. 09, 2026. [Online]. Available: https://www.theverge.com/report/829137/openai-chatgpt-time-date

[5] Anthropic, “System prompts for claude web and mobile apps.” Accessed: Sep. 09, 2026. [Online]. Available: https://platform.claude.com/docs/en/release-notes/system-prompts/overview

[6] DeepSeek-AI, “DeepSeek-V3-0324 usage recommendations.” Accessed: Sep. 09, 2026. [Online]. Available: https://huggingface.co/deepseek-ai/DeepSeek-V3-0324

[7] OpenAI, Codex CLI environment context. (2026). Accessed: Sep. 09, 2026. [Online]. Available: https://github.com/openai/codex/blob/9caddc5cf5bf4df5f114498e23bece90eaedb37b/codex-rs/core/src/context/world_state/environment.rs

[8] wshallwshall, “No local time or timezone in context.” Accessed: Sep. 09, 2026. [Online]. Available: https://github.com/anthropics/claude-code/issues/84145

[9] jontwigge, “Long sessions drift days past the session-start date.” Accessed: Sep. 09, 2026. [Online]. Available: https://github.com/anthropics/claude-code/issues/73800

[10] Google, Gemini CLI environment context. (2026). Accessed: Sep. 09, 2026. [Online]. Available: https://github.com/google-gemini/gemini-cli/blob/ed2ac40df67a319bf348bd7e3d10494696b31b38/packages/core/src/utils/environmentContext.ts

[11] Zed Industries and contributors, Zed Agent System-Prompt Assembly. (2026). Available: https://github.com/zed-industries/zed/blob/52b2927a1bac46be5d50ad341ac00b665e13764b/crates/agent/src/thread.rs

[12] Zed Industries and contributors, Zed Agent Thread Database. (2026). Available: https://github.com/zed-industries/zed/blob/52b2927a1bac46be5d50ad341ac00b665e13764b/crates/agent/src/db.rs

[13] Microsoft and VS Code contributors, VS Code Copilot Agent Prompt Assembly. (2026). Available: https://github.com/microsoft/vscode/blob/13fa06a39cabd0b59ca007ffd356d14998b983ff/extensions/copilot/src/extension/prompts/node/agent/agentPrompt.tsx

[14] OpenCode contributors, OpenCode system-prompt environment. (2026). Accessed: Sep. 09, 2026. [Online]. Available: https://github.com/anomalyco/opencode/blob/9f8db119fcbd4999379129ac7734375ac23460fb/packages/opencode/src/session/system.ts

[15] Continue contributors, Continue CLI system message. (2026). Accessed: Sep. 09, 2026. [Online]. Available: https://github.com/continuedev/continue/blob/5522c6f44ca0ac3528b37244818fbfa39b5af470/extensions/cli/src/systemMessage.ts

[16] Aider contributors, Aider platform information prompt. (2026). Accessed: Sep. 09, 2026. [Online]. Available: https://github.com/Aider-AI/aider/blob/5dc9490bb35f9729ef2c95d00a19ccd30c26339c/aider/coders/base_coder.py

[17] Cline, “Creating custom tools in the Cline SDK.” Accessed: Sep. 09, 2026. [Online]. Available: https://github.com/cline/cline/blob/194214af76da43757ccacdf04c6fd487f8914ea1/docs/sdk/guides/creating-custom-tools.mdx

Appendix: Status quo in popular agent harnesses, September 2026

The table separates calendar context from a clock and stored timestamps from chronology actually shown to the model. “Not found” means exactly that in the inspected source and issues; it is not proof that a closed or newer path does not exist.

AgentWhat the model receives automaticallyWhen and where
ChatGPT web (reported November 2025) [4]No reliable current time; it may call SearchProduct behavior ranged from refusing through correct answers to confidently wrong times
Claude.ai web [5]Current date, but no documented time or timezoneSystem prompt created at the start of each conversation
Google Gemini web (reported November 2025) [4]Current time through automatic searchTool-mediated lookup, not time included in every user turn
DeepSeek web/app (V3-0324) [6]Date and explicit weekday, but no documented time or timezoneDated system prompt documented by the official model card; later web versions remain unverified
GitHub Copilot CLI 1.0.83 [1]ISO date, time, milliseconds, and UTC offsetFirst block of the current user turn
OpenAI Codex CLI 0.153.4 [7]Current date and IANA timezone, but no wall-clock time or weekdayUser-role environment context; updates are emitted when the date or timezone snapshot changes
Claude Code 2.1.220 [8], [9]Date, but no local time or timezoneSystem prompt fixed at session start, so the date becomes stale in sessions crossing midnight; a UserPromptSubmit hook can add per-turn time
Gemini CLI 0.59.0 [10]Localized weekday and date, but no time or timezoneFirst user-role session context, refreshed on resume
Zed 1.19.2 [11], [12]Local date, but no time, weekday, offset, or message timestampSystem prompt; our PR adds persisted per-user-message time
VS Code Copilot Chat 0.66.0 [13]Local ISO date, but no time, weekday, or offsetAgent path uses per-turn user context; panel chat separately uses the system prompt; our patch extends the agent path
OpenCode 1.18.30 [14]Local abbreviated weekday and date, but no time or offsetSystem-prompt environment; stored event milliseconds are not shown to the model as chronology
Continue CLI 1.5.47 [15]UTC date, but no time, weekday, or timezone labelModule-level system message fixed for the initialized process; local date can differ near midnight
Aider 0.86.0 [16]Local date, but no time, weekday, or offsetSystem prompt and reminder construction
Cline CLI 0.0.13 [17]No automatic date or time foundSDK documents how to add a custom time tool; stored createdAt projection remains unverified