How to Configure output_style in DeepSeek-Reasonix for Different Persona Tones
Set output_style to explanatory, learning, or concise in your TOML configuration, use the /output-style slash command at runtime, or assign cfg.Agent.OutputStyle programmatically to control the agent’s explanatory depth.
The open-source DeepSeek-Reasonix framework lets you reshape the agent’s communication persona without touching the core inference logic. By configuring the output_style parameter, you append or replace system prompt instructions to shift the tone between verbose explanations, interactive tutorials, or terse code-only responses. This guide covers the three built-in styles and exactly where in the codebase the transformation happens.
What Is output_style?
An output style is a text block that modifies the system prompt to alter how the agent presents information. DeepSeek-Reasonix ships with three built-in personas:
- explanatory: Explains non-obvious implementation choices as it generates code.
- learning: Pauses for user decisions and inserts
TODO(human)stubs. - concise: Minimal prose—outputs code and short bullets only.
All built-in styles use KeepCoding: true, meaning they append their instructions to the existing system prompt rather than replacing it entirely. The implementation lives in internal/outputstyle/outputstyle.go, where the Resolve function performs case-insensitive name lookups and Apply handles prompt injection.
Where Configuration Is Defined
Understanding the data flow requires knowing these four key locations:
internal/config/config.go(lines 1258–1261): Defines the TOML fieldoutput_styleas a string within the[agent]table.internal/boot/boot.go(lines 543–545): Callsoutputstyle.Resolveat boot time to validate the configured name, then invokesoutputstyle.Applyto fold the style into the system prompt.internal/cli/slash_registry.go(lines 46–48): Registers the/output-stylecommand and its/output-stylesalias.internal/cli/output_style_view.go(lines 10–22): Renders the interactive list you see when changing styles in the TUI.
Three Ways to Configure output_style
Edit the TOML Configuration File
The most persistent method is editing your configuration file (typically reasonix.example.toml or a custom copy). Add the output_style key under the [agent] table:
[agent]
# ... other settings ...
output_style = "learning" # Options: explanatory | learning | concise
The file is automatically rendered when you run reasonix config edit, as noted in internal/config/render.go (lines 290–291). Changes take effect on the next agent restart when internal/boot/boot.go processes the configuration.
Use the /output-style Slash Command
For on-the-fly changes inside the REPL or TUI, type:
/output-style concise
The parser in internal/cli/cli.go (lines 1279–1280) stores the value in m.outputStyle, and the TUI highlights the active selection via renderOutputStyles in internal/cli/chat_tui.go (lines 4686–4689). This overrides the file setting for the current session.
Set It Programmatically in Go
If you are embedding DeepSeek-Reasonix as a library, set the style directly on the configuration struct before initialization:
cfg := reasonix.DefaultConfig()
cfg.Agent.OutputStyle = "explanatory"
// Proceed with agent initialization
When the agent boots, outputstyle.Resolve matches the string to a style definition, and outputstyle.Apply injects the corresponding prompt text.
How Styles Modify the System Prompt
The transformation happens in two steps:
- Resolution:
outputstyle.Resolvesearches for the style name (case-insensitive) among built-ins and any custom markdown files located in directories returned byoutputstyle.Dirs()(such as.reasonix/output-stylesor.agents/output-styles). - Application:
outputstyle.Applyeither appends the style body to the system prompt (ifKeepCoding == true) or replaces the prompt entirely (ifKeepCoding == false). The built-in styles all append, ensuring core coding instructions remain intact.
Custom styles can override this behavior by setting keep-coding-instructions: "false" in their front matter.
Adding Custom Persona Styles
You can extend the three built-ins by creating markdown files in the convention directories. Create a file like .reasonix/output-styles/mentor.md with YAML front matter:
name: "mentor"
description: "Senior engineer review tone"
keep-coding-instructions: "false"
The body of the file becomes the prompt text. Because keep-coding-instructions is set to "false", this style replaces the entire system prompt rather than appending to it. Custom files take precedence over built-ins when names collide.
Summary
- Configure
output_styleinreasonix.example.tomlunder[agent]for persistent defaults. - Switch styles at runtime with the
/output-styleslash command, handled byinternal/cli/cli.goand rendered ininternal/cli/output_style_view.go. - Embed programmatically by setting
cfg.Agent.OutputStylebefore boot. - Built-in options:
explanatory,learning, andconcise, all defined ininternal/outputstyle/outputstyle.go. - Extend capabilities by placing custom
.mdfiles in.reasonix/output-styleswith front-matter metadata.
Frequently Asked Questions
What are the differences between the three built-in output_style options?
Explanatory narrates non-obvious implementation choices while coding. Learning pauses generation to ask clarifying questions and leaves TODO(human) markers for user completion. Concise suppresses narrative, emitting only code blocks and essential bullet points. All three append to the base system prompt (KeepCoding: true).
Can I switch output_style during an active session?
Yes. The /output-style command updates the active configuration stored in the TUI model (m.outputStyle in internal/cli/cli.go). The change takes effect immediately on the next agent turn without requiring a restart.
How do I override a built-in style with my own definition?
Create a markdown file with the same name as the built-in (e.g., concise.md) in one of the search directories returned by outputstyle.Dirs(). According to the resolution logic in internal/outputstyle/outputstyle.go (lines 119–128), custom files override built-ins when names match.
Does output_style affect the code generation or just the commentary?
It primarily affects the commentary tone and structure—for example, whether to insert explanatory paragraphs or TODO stubs. The underlying code generation capabilities remain consistent because the built-in styles append to rather than replace the core coding instructions (KeepCoding == true), unless you explicitly configure a custom style with keep-coding-instructions: "false".
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →