In Claude Code there are also "output styles" that are more deeply embedded - into a system prompt - and agent is also periodically reminded of them during the session:
https://code.claude.com/docs/en/output-stylesMaybe these would work better for such cases.