claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG] --append-system-prompt does not append to the system prompt, but is a user message instead

Open solatis opened this issue 1 year ago • 8 comments

Environment

  • Platform (select one):
    • [ ] Anthropic API
    • [ ] AWS Bedrock
    • [ ] Google Vertex AI
    • [x] Other: Claude Code via Max 20 subscription
  • Claude CLI version: 1.0.61
  • Operating System: MacOS
  • Terminal: Alacritty

Bug Description

--append-system-prompt does not actually append to the system prompt, but injects a user message instead. This completely defeats the purpose of it being a system prompt: the context is lost over time, and may even be subject to compaction, which would lead to complete loss of the role.

Steps to Reproduce

  1. Use --append-system-prompt
  2. Observe with mitmproxy that it is actually a message

Expected Behavior

It would be appended as-is after the existing claude code system prompt, perhaps with some clear markers around it.

Actual Behavior

It is sent as a user message.

Additional Context

Image

Here you can see that the literal text I provided as --append-system-prompt is actually provided as a user message, which makes it not very much different than just a custom slash command and defeats the purpose.

solatis avatar Jul 27 '25 06:07 solatis

yep i noted the same!

MiwiDots avatar Jul 27 '25 07:07 MiwiDots

wondered why it was not quite following my instructions as well, this makes it clear!

One unrelated question - do you know how the flag behaves when you continue a conversation? Will it append the system prompt after each continue of the convo?

presmihaylov avatar Aug 09 '25 18:08 presmihaylov

It's just user input, will lose relevance as the context size grows, and may eventually be compacted away.

This imho is a major bug, as especially with the sub-agents, it doesn't enable us to provide additional instructions to the "main" agent, ie "never ever edit code yourself" or those kind of things.

solatis avatar Aug 10 '25 10:08 solatis

I asked Claude if he could see my amendment in the system prompt and it said no. It wasn't following the instructions in it ... so that explains it.

RogerLevy avatar Aug 25 '25 22:08 RogerLevy

Can you check again?

/context seems still broken

but Claude acknowledges the --append-system-prompt context as being actually in the system prompt

Elijas avatar Nov 06 '25 21:11 Elijas

This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

github-actions[bot] avatar Dec 12 '25 10:12 github-actions[bot]

This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.

github-actions[bot] avatar Jan 12 '26 10:01 github-actions[bot]

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.

github-actions[bot] avatar Jan 19 '26 14:01 github-actions[bot]