Skip to content

A date tool should be included by default #2618

@gianlucamazza

Description

@gianlucamazza

Summary

Claude Code CLI should include a built-in date/time tool to enable better temporal context and time-aware operations without requiring additional setup or external dependencies.

Problem Statement

Claude often uses outdated temporal information in its responses, referencing dates from its training data (e.g., treating 2024 as "current year" when we're actually in 2025). This creates several issues:

  • Incorrect temporal context: Claude may suggest outdated practices, deprecated APIs, or reference events as "recent" when they're actually old
  • Wrong date calculations: When generating code or scripts, Claude might use hardcoded dates from 2024 instead of dynamic current dates
  • Misleading information: Users receive contextually incorrect information about timeframes, deadlines, or version compatibility

Without access to current date/time, Claude cannot:

  • Provide accurate temporal context for its responses
  • Generate code with correct current timestamps
  • Make appropriate assumptions about software versions, compatibility, or current best practices

Proposed Solution

Include a built-in date tool that provides Claude with real-time temporal context to ensure accurate and current responses.

Core Functionality

  • Current date/time awareness: Enable Claude to know the actual current date and time
  • Temporal context: Allow Claude to make informed decisions based on current timeframe
  • Dynamic date generation: Generate code and responses with correct current timestamps
  • Version/compatibility awareness: Help Claude suggest current best practices and compatible versions

Example Impact

Before (without date tool):

Claude: "In 2024, you should use Node.js 18..."
Claude: "This year (2024), the latest React version is..."

After (with date tool):

Claude: "As of June 2025, you should use Node.js 22..."
Claude: "Currently in 2025, the latest React version is..."

Benefits

  1. Accurate temporal context: Claude provides responses based on current date/time instead of training data timestamps
  2. Correct code generation: Generated scripts and applications use current dates instead of hardcoded old dates
  3. Better recommendations: Claude can suggest current best practices, latest versions, and up-to-date approaches
  4. Contextual awareness: Claude understands the actual timeline for project planning, deadlines, and scheduling

Use Cases

  • Code generation: Creating scripts with current timestamps and dates
  • Project planning: Accurate timeline suggestions and deadline calculations
  • Version recommendations: Suggesting current stable versions of frameworks and tools
  • Log analysis: Proper temporal context when analyzing recent vs. old log entries
  • Documentation: Generating documentation with current dates and relevant timeframes
  • API integration: Using current timestamps for API calls and data processing

Alternative Considerations

  • Integration with existing system date tools
  • Optional vs. mandatory inclusion
  • Performance impact assessment
  • Configuration options for default formats/timezones

Implementation Notes

  • The tool should automatically provide current date/time context to Claude for every interaction
  • Consider making this a default tool that's always available (similar to filesystem access)
  • Should include timezone information and locale support
  • Could be implemented as a simple tool that Claude can query when it needs temporal context
  • Priority should be on providing accurate current date/time rather than complex date manipulation features

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions