claude-code - 💡(How to fix) Fix Bare /loop ignores .claude/loop.md — shows usage prompt instead [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#47883Fetched 2026-04-15 06:39:35
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
1
Author
Participants
Timeline (top)
labeled ×3

Fix Action

Workaround

/loop follow the instructions in .claude/loop.md works — the model reads and executes the file. But the auto-detection doesn't fire.

Code Example

You invoked /loop without a prompt. What would you like me to run on each iteration?
RAW_BUFFERClick to expand / collapse

Bug

Running /loop with no arguments shows a usage prompt asking what to loop on, instead of picking up .claude/loop.md as documented.

Expected behavior

Per the scheduled tasks docs:

A loop.md file replaces the built-in maintenance prompt with your own instructions. [...] Claude looks for the file in two locations and uses the first one it finds.

  • .claude/loop.md — Project-level.
  • ~/.claude/loop.md — User-level.

And the behavior table states:

What you provideWhat happens
Interval only, or nothingThe built-in maintenance prompt runs, or your loop.md if one exists

So bare /loop should either run the built-in maintenance prompt or the custom loop.md.

Actual behavior

Bare /loop prints:

You invoked /loop without a prompt. What would you like me to run on each iteration?

This happens regardless of whether .claude/loop.md exists.

Reproduction

  1. Create .claude/loop.md in a project root (any content)
  2. Run claude from the project root
  3. Type /loop with no arguments
  4. Observe: usage prompt appears instead of executing loop.md

Also tested from a subdirectory — same result.

Environment

  • Claude Code version: 2.1.107 (native, latest)
  • Platform: Linux (WSL2) — Windows host
  • Install method: native
  • Shell: bash

Workaround

/loop follow the instructions in .claude/loop.md works — the model reads and executes the file. But the auto-detection doesn't fire.

extent analysis

TL;DR

The issue can be worked around by specifying the path to the loop.md file when running the /loop command, until the auto-detection issue is resolved.

Guidance

  • Verify that the .claude/loop.md file exists in the project root and has the correct permissions.
  • Check if the issue persists when running the command from the project root versus a subdirectory.
  • Test if providing the path to the loop.md file explicitly, as in the provided workaround, works consistently.
  • Review the scheduled tasks docs to ensure that the loop.md file is correctly formatted and placed.

Example

No code snippet is provided as the issue seems related to configuration and file placement rather than code.

Notes

The issue might be related to how Claude detects and prioritizes the loop.md files in different locations. Further investigation into the documentation and possibly the source code of Claude might be necessary to understand why the auto-detection is not working as expected.

Recommendation

Apply the workaround by specifying the path to the loop.md file when running the /loop command, as this allows the model to read and execute the file correctly until the auto-detection issue is addressed.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

Per the scheduled tasks docs:

A loop.md file replaces the built-in maintenance prompt with your own instructions. [...] Claude looks for the file in two locations and uses the first one it finds.

  • .claude/loop.md — Project-level.
  • ~/.claude/loop.md — User-level.

And the behavior table states:

What you provideWhat happens
Interval only, or nothingThe built-in maintenance prompt runs, or your loop.md if one exists

So bare /loop should either run the built-in maintenance prompt or the custom loop.md.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix Bare /loop ignores .claude/loop.md — shows usage prompt instead [1 participants]