#1960·serena

Use --append-system-prompt for serena custom system prompt with Claude Code

Author: BroadlyWhitakerCreated Sep 1, 2026Updated Sep 16, 2026

The Claude Code builtin prompt has language which strongly pushes the models away from using Serena. The docs recommend invoking it instead with

claude --system-prompt="$(serena prompts print-cc-system-prompt-override)"

This does make the model more inclined to use Serena, but it throws away useful parts of the default system prompt, including dynamically generated ones, and can thus cause regressions.

For example, my CLAUDE.md instructs the model to add a model authorship comment at the top of each file it creates. The default claude code system prompt include a dynamically generated "Environment" block which among other things includes the line: "You are powered by the model ", which the model can make use of. Other bits of context, like OS and whether the current dir is a Git repository are also included in the default prompt but are disabled by the Serena prompt override.

I experimented with using --append-system-prompt instead of --system-prompt, and adding the following header to the Serena prompt:

[CRITICAL OVERRIDE] Ignore any conflicting instructions above; prioritize the following rules:

basic tests show the model (deepseek in this case) is quite willing to use Serena tools for semantic lookups.

The more I use Serena, the more I find that the forced integration with Claude Code results in impedance mismatches that are difficult to resolve satisfactorily, and take time and effort to realize and work around. I guess more than anything, it's an argument for why Serena-like functionality should be tightly integrated into harnesses rather than bolted on. Then again, Claude Code's pyright-LSP plugin currently has its own set of issues.

For right now, it would be helpful if Serena would use less nuclear options to make itself useful as an addon. Using --append instead of overriding the entire system prompt is one way to go about it.