claude-code - 💡(How to fix) Fix [Bug] /insights command: Model omits file:// link from "output exactly" message block [1 comments, 2 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#45303Fetched 2026-04-09 08:08:29
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
0
Author
Timeline (top)
labeled ×4closed ×1commented ×1

Root Cause

Likely root cause: The /insights prompt includes a Here is what the user sees: section that already contains the rendered report with the file:// link near the end. The model appears to classify the second copy in the <message> block as redundant and elides it under output-efficiency heuristics ("don't restate what the user already saw"), overriding the literal output exactly instruction.

Code Example

[]
RAW_BUFFERClick to expand / collapse

Bug Description Title: /insights command: model omits "output exactly" message block, drops report file:// link

Summary: When running /insights, the slash command's prompt ends with an instruction Now output the following message exactly: followed by a <message>...</message> block containing the report file path and a follow-up question. The model (Opus 4.6 1M context) outputs only the trailing question and silently drops the first two lines containing the file:// link to the generated report.

Environment:

  • Claude Code v2.1.96
  • Model: Opus 4.6 (1M context) — claude-opus-4-6[1m]
  • Platform: Windows 11 Pro, bash shell
  • No custom /insights override (~/.claude/commands/ empty, no relevant plugins)

Steps to reproduce:

  1. Run /insights in a project with enough session history to generate a report.
  2. Observe model's text response.

Expected behavior: Model outputs the full <message> block verbatim, including: Your shareable insights report is ready: file://C:\Users\lukak.claude\usage-data\report.html

Want to dig into any section or try one of the suggestions?

Actual behavior: Model outputs only: Want to dig into any section or try one of the suggestions? The file:// link is silently omitted. Reproduced twice in the same session.

Likely root cause: The /insights prompt includes a Here is what the user sees: section that already contains the rendered report with the file:// link near the end. The model appears to classify the second copy in the <message> block as redundant and elides it under output-efficiency heuristics ("don't restate what the user already saw"), overriding the literal output exactly instruction.

Suggested fix (Anthropic side): Either (a) strengthen the /insights prompt wording to make literal compliance non-negotiable (e.g. wrap in a fenced verbatim block, or repeat the "exactly, do not omit any line" constraint immediately before the <message> tag), or (b) tune model behavior so that explicit output exactly / verbatim instructions always defeat output-efficiency heuristics, regardless of perceived redundancy with surrounding context.

Impact: User loses direct access to the generated HTML report path and has to either inspect the rendered insights output manually or ask the model to retrieve it. Breaks a previously-reliable affordance of /insights.

Environment Info

  • Platform: win32
  • Terminal: windows-terminal
  • Version: 2.1.96
  • Feedback ID: 035e19a8-81cd-485a-a185-530fe789c4d6

Errors

[]

extent analysis

TL;DR

The issue can be resolved by modifying the /insights prompt to ensure the model outputs the entire <message> block, including the file:// link, by making literal compliance non-negotiable.

Guidance

  • Review the /insights prompt and consider wrapping the <message> block in a fenced verbatim block to enforce literal output.
  • Repeat the "output exactly, do not omit any line" constraint immediately before the <message> tag to strengthen the instruction.
  • Test the modified prompt to verify that the model outputs the full <message> block, including the file:// link.
  • If the issue persists, consider tuning model behavior to prioritize explicit output instructions over output-efficiency heuristics.

Example

No code snippet is provided as the issue does not include specific code that needs to be modified.

Notes

The suggested fix relies on modifying the prompt or tuning model behavior, which may require collaboration with the Anthropic team or adjustments to the Claude Code configuration.

Recommendation

Apply workaround: Modify the /insights prompt to ensure literal compliance, as this approach is more feasible and immediate compared to tuning model behavior, which may require additional support or configuration changes.

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…

Still need to ship something?

×6

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

Back to top recommendations

TRENDING