[GH-ISSUE #7447] [Issue]: Claude subscription chats make an extra hidden request and send your email to the model #4149

Closed
opened 2026-10-21 06:11:46 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @JurijPietrowicz on GitHub (Oct 11, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/7447

Originally assigned to: @SpicyMarinara on GitHub.

Summary

The Claude (Subscription) provider runs on Claude Code, and Claude Code adds things to every chat that only make sense for a coding tool:

  1. An extra hidden request. When a new chat starts, Claude Code makes a second request in the background to name the "session". This uses your subscription limits for nothing.
  2. Extra information in the prompt. Claude Code adds today's date, details about the server (folder, OS, shell, git status) and a note about which model is running. It puts all of this between Marinara's system prompt and the chat, so it can change how the model behaves. Additionally, it adds a system-reminder with your account email to the last message. A roleplay doesn't need any of it, and your email shouldn't be sent with every chat.

PR for this issue here: https://github.com/Pasta-Devs/Marinara-Engine/pull/7448

Expected behavior

  • There is no automatic title generation.
  • The model sees only Marinara's prompt and the conversation. Nothing is added between them.

Actual behavior

Extra request: a second request named generate_session_title is sent next to the chat request when:

  • you send the first message of a new chat
  • Marinara makes a one-off call (agents, summaries, scene analysis, connection tests, TTS speaker detection)
  • you use the fold mode (CLAUDE_SUBSCRIPTION_USE_RESUME=false). Here it happens on every message.

Follow-up messages in an existing chat and very short first messages (like "Hi") don't trigger it.

Extra information: Claude Code adds Environment block at the end of system prompt:

# Environment
You have been invoked in the following environment:
 - Primary working directory: ...  - Is a git repository: ...
 - Platform / Shell / OS Version ...
You are powered by the model named <model>. The exact model ID is <id>. ...
Today's date is <date>.

Claude Code also adds the following to the last user message:

<system-reminder> ... The user's email address is <email>. ... </system-reminder>

The provider's current settings (tools: [], skills: [], settingSources: []) don't remove it.

Steps to reproduce

  1. Add a Claude (Subscription) connection.
  2. Add OTEL_LOG_RAW_API_BODIES=file:<folder> to Marinara's .env. This saves every request to that folder.
  3. Start a new chat and send a first message of at least one sentence.
  4. Open <folder>/index.jsonl. There are two requests: query_source: "sdk" (the chat) and query_source: "generate_session_title" (the extra one).
  5. Open the chat request's file. It contains your email, the # Environment block, the model note and the date.

The saved files contain your email. Delete the folder and remove the .env line when you're done.

Environment

  • Marinara Engine version: 2.5.0 (staging)
  • Install type: source
  • OS + version: Fedora 44 (Linux 7.2)
  • Browser or app shell: n/a (server-side)
  • Claude Agent SDK 0.3.293. Reproduced with both its bundled Claude Code (2.1.293) and the installed Claude Code (2.1.296).

Logs, screenshots, or video

The saved requests aren't attached because they contain the account email.

Additional context

Planned fix, in packages/server/src/services/llm/providers/claude-subscription.provider.ts:

  • Extra request: give each session a fixed title with the SDK's title option. Claude Code then skips the naming request. The connection test in connections.routes.ts gets the same option.
  • Extra information: ship a small Claude Code plugin (a "mod") with Marinara and load it through the SDK's plugins option. The plugin removes everything Claude Code adds between the system prompt and the chat (email, date, environment block and model note) before the request is sent. If a Claude Code version or an admin policy doesn't allow mods, the plugin is ignored and chats work as they do today. Original inspiration for a fix from here: https://github.com/AlexErrant/claude-code-no-email

Not part of this fix: Claude Code also adds a billing header and the line You are a Claude agent, built on Anthropic's Claude Agent SDK.. Neither can be turned off. Both sit before Marinara's system prompt, not between the prompt and the chat. Without the model note, the model may guess wrong when asked which model it is. That doesn't matter for roleplay, and the connection test checks the model separately.

Template check

Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • [] I DID NOT read this template and provide the requested details.
Originally created by @JurijPietrowicz on GitHub (Oct 11, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/7447 Originally assigned to: @SpicyMarinara on GitHub. ## Summary The Claude (Subscription) provider runs on Claude Code, and Claude Code adds things to every chat that only make sense for a coding tool: 1. **An extra hidden request.** When a new chat starts, Claude Code makes a second request in the background to name the "session". This uses your subscription limits for nothing. 2. **Extra information in the prompt.** Claude Code adds today's date, details about the server (folder, OS, shell, git status) and a note about which model is running. It puts all of this between Marinara's system prompt and the chat, so it can change how the model behaves. Additionally, it adds a system-reminder with your account email to the last message. A roleplay doesn't need any of it, and your email shouldn't be sent with every chat. PR for this issue here: https://github.com/Pasta-Devs/Marinara-Engine/pull/7448 ## Expected behavior - There is no automatic title generation. - The model sees only Marinara's prompt and the conversation. Nothing is added between them. ## Actual behavior **Extra request:** a second request named `generate_session_title` is sent next to the chat request when: - you send the first message of a new chat - Marinara makes a one-off call (agents, summaries, scene analysis, connection tests, TTS speaker detection) - you use the fold mode (`CLAUDE_SUBSCRIPTION_USE_RESUME=false`). Here it happens on **every** message. Follow-up messages in an existing chat and very short first messages (like "Hi") don't trigger it. **Extra information:** Claude Code adds Environment block at the end of system prompt: ``` # Environment You have been invoked in the following environment: - Primary working directory: ... - Is a git repository: ... - Platform / Shell / OS Version ... You are powered by the model named <model>. The exact model ID is <id>. ... Today's date is <date>. ``` Claude Code also adds the following to the last user message: ``` <system-reminder> ... The user's email address is <email>. ... </system-reminder> ``` The provider's current settings (`tools: []`, `skills: []`, `settingSources: []`) don't remove it. ## Steps to reproduce 1. Add a Claude (Subscription) connection. 2. Add `OTEL_LOG_RAW_API_BODIES=file:<folder>` to Marinara's `.env`. This saves every request to that folder. 3. Start a **new** chat and send a first message of at least one sentence. 4. Open `<folder>/index.jsonl`. There are two requests: `query_source: "sdk"` (the chat) and `query_source: "generate_session_title"` (the extra one). 5. Open the chat request's file. It contains your email, the `# Environment` block, the model note and the date. The saved files contain your email. Delete the folder and remove the `.env` line when you're done. ## Environment - Marinara Engine version: 2.5.0 (`staging`) - Install type: source - OS + version: Fedora 44 (Linux 7.2) - Browser or app shell: n/a (server-side) - Claude Agent SDK 0.3.293. Reproduced with both its bundled Claude Code (2.1.293) and the installed Claude Code (2.1.296). ## Logs, screenshots, or video The saved requests aren't attached because they contain the account email. ## Additional context Planned fix, in `packages/server/src/services/llm/providers/claude-subscription.provider.ts`: - **Extra request:** give each session a fixed title with the SDK's `title` option. Claude Code then skips the naming request. The connection test in `connections.routes.ts` gets the same option. - **Extra information:** ship a small Claude Code plugin (a "mod") with Marinara and load it through the SDK's `plugins` option. The plugin removes everything Claude Code adds between the system prompt and the chat (email, date, environment block and model note) before the request is sent. If a Claude Code version or an admin policy doesn't allow mods, the plugin is ignored and chats work as they do today. Original inspiration for a fix from here: https://github.com/AlexErrant/claude-code-no-email Not part of this fix: Claude Code also adds a billing header and the line `You are a Claude agent, built on Anthropic's Claude Agent SDK.`. Neither can be turned off. Both sit before Marinara's system prompt, not between the prompt and the chat. Without the model note, the model may guess wrong when asked which model it is. That doesn't matter for roleplay, and the connection test checks the model separately. ## Template check Please **uncheck (untick)** the box below before submitting so we know you read the template. It is intentionally pre-checked: - [] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-21 06:11:46 +07:00
  • closed this issue
  • added the
    in-pr
    bug
    labels
Author
Owner

@SpicyMarinara commented on GitHub (Oct 12, 2026):

Fixed on staging by #7448.

<!-- gh-comment-id:6132192829 --> @SpicyMarinara commented on GitHub (Oct 12, 2026): Fixed on staging by #7448.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#4149
No description provided.