[BUG] Custom command not running in old session, only in new

Resolved 💬 3 comments Opened Feb 18, 2026 by ivorscott Closed Mar 19, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

When creating a custom command I need to start a new session to use it. It is failing to run in old sessions.

I saw the same behavior in a tutorial I am following.

What Should Happen?

The command should work in any session.

Error Messages/Logs

❯ /commit-message                                                                              
  ⎿  API Error: 400      
     {"type":"error","error":{"type":"invalid_request_error","message":"messages: text content 
     blocks must be non-empty"},"request_id":"req_011CYEZBoKSb1ebtGqQzxn1c"}

Steps to Reproduce

  1. Create a session.
  2. With the session still open, create a custom command in the project directory (only with front matter description). Then run the command prematurely without restarting the open session. See it fail as expected.
  3. Next add the required body to the custom command markdown. Then exit the open session, and reopened it (to restart claude), run the command again, it should still fail.
  4. Oddly enough, if you create a new session, the command works.

Claude Model

Sonnet (default)

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.1.45

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

My guess is that the old session cached the first API failure, and doesn't attempt to rerun the custom command.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗