[MODEL] Claude wrote a unit test that breaks the day after it was written

Status Open
Reported on v2.1.233
Maintainer reply None cached
Activity 0 comments · opened Aug 17, 2026

Preflight Checklist

  • [x] I have searched existing issues for similar behavior reports
  • [x] This report does NOT contain sensitive information (API keys, passwords, etc.)

Type of Behavior Issue

Other unexpected behavior

What You Asked Claude to Do

I asked claude to create a feature where the current date affects the outcome (today's date is included in the filename). Claude wrote a corresponding unit test per repo convention.

What Claude Actually Did

Claude wrote a unit test asserting the filename matches today's date, but the date was hardcoded. The test started failing the next day.

Expected Behavior

Claude should not write a test asserting an exact hardcoded date. It should either:

  • Update the assertion to not require an exact match, excluding the date part;
  • OR mock the datetime provider to get consistent outcomes/results.

Files Affected

Permission Mode

Accept Edits was ON (auto-accepting changes)

Can You Reproduce This?

Yes, every time with the same prompt

Steps to Reproduce

_No response_

Claude Model

Opus

Relevant Conversation

Impact

Medium - Extra work to undo changes

Claude Code Version

2.1.233 (Claude Code)

Platform

Anthropic API

Additional Context

_No response_

View original on GitHub ↗