claude-code - 💡(How to fix) Fix [BUG] # Memory Mode not intercepted in Claude Code CLI (iTerm) [2 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#51668Fetched 2026-04-22 07:56:05
View on GitHub
Comments
2
Participants
2
Timeline
7
Reactions
0
Timeline (top)
labeled ×4commented ×2cross-referenced ×1

Error Message

Error Messages/Logs

RAW_BUFFERClick to expand / collapse

Preflight Checklist

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

What's Wrong?

I'm currently in the Anthropic Partner Basecamp and going through the steps in https://claude-code-workshop.netlify.app/

In the course content, there is a section that states:

Three ways to edit the CLAUDE.md file Method 1 — Use # Memory Mode (recommended) Press # at the prompt to enter Memory Mode. This lets you write directly to CLAUDE.md without consuming any tokens — Claude doesn't need to process the request.

Always document non-obvious logic changes with comments

Environment

  • OS: macOS (Darwin kernel 25.3.0)
  • Terminal: iTerm2
  • Claude Code version: 2.1.116
  • Interface: CLI (launched via claude in terminal)

Expected behavior Typing or pasting a message prefixed with # at the Claude Code prompt should enter Memory Mode — writing directly to CLAUDE.md without sending the input to the model or consuming tokens.

Actual behavior The #-prefixed input is passed through to the model as a regular message. The model processes it, consumes tokens, and responds — treating it as a normal prompt.

Observed result: All three variants are received and processed by the model as normal prompts.

What Should Happen?

Expected result: Claude Code CLI intercepts the # prefix and writes the content directly to CLAUDE.md without invoking the model.

Error Messages/Logs

Steps to Reproduce

  1. Open iTerm2 on macOS and launch Claude Code with claude
  2. Navigate to a project with a CLAUDE.md file
  3. At the Claude Code prompt, try each of the following:
    • Paste # Always document non-obvious logic changes with comments via Cmd+V
    • Type # Always document non-obvious logic changes with comments manually
    • Type #Always document non-obvious logic changes with comments (no space)
  4. Press Enter after each attempt

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

2.1.116

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

iTerm2

Additional Information

https://github.com/beck-source/inventory-management - for the app that we're working on in training.

extent analysis

TL;DR

The issue can be fixed by modifying the Claude Code CLI to correctly intercept the # prefix and write the content directly to CLAUDE.md without invoking the model.

Guidance

  • Verify that the # prefix is correctly handled in the Claude Code CLI by checking the code for any special handling of this character.
  • Check the documentation for the Anthropic API to see if there are any specific requirements for handling the # prefix.
  • Test the issue with different types of input, such as a # prefix with a space after it, to see if the issue is specific to certain types of input.
  • Consider filing an issue with the Claude Code repository to report the bug and get further assistance.

Example

No code snippet is provided as the issue does not include any relevant code.

Notes

The issue may be specific to the Claude Code version 2.1.116 or the Sonnet model, and further testing may be needed to determine the root cause.

Recommendation

Apply workaround: The user can try manually editing the CLAUDE.md file instead of relying on the Claude Code CLI to write to it, until the issue is fixed.

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

claude-code - 💡(How to fix) Fix [BUG] # Memory Mode not intercepted in Claude Code CLI (iTerm) [2 comments, 2 participants]