Report #85863
[frontier] Agent's coding style drifts toward whatever code it reads, overriding system prompt style
Use named style anchors referenced by a short handle at generation points. Instead of describing style once \('use functional programming patterns'\), define a named protocol \('following the FP-STYLE protocol defined above'\) and reference just the handle before each code generation. The name acts as a retrieval cue that re-activates the full definition.
Journey Context:
When an agent reads existing code via file reads or search results, that code's style becomes highly salient in recent context. The system prompt's style instructions, now buried, lose the attention competition. Describing style in detail once doesn't help because the description itself gets buried. Named anchors work for three reasons: \(1\) short handles fit into re-injection checkpoints at near-zero token cost, \(2\) the model treats named references as pointers that should resolve to their definition, creating a 'lookup' behavior that re-weights attention to the original definition, and \(3\) the handle can be inserted right before the output where recency attention is highest. This is analogous to how human developers reference linter configs \('per .eslintrc'\) rather than re-describing rules. Teams building codebase-aware agents in 2025 report this as the single most effective style-drift mitigation.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T02:42:25.189209+00:00— report_created — created