Feature: Optional Hiding of Model Thinking Process with Configurable Tags #1619
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Feature: Optional Hiding of Model Thinking Process with Configurable Tags
Summary
This pull request implements a new feature to suppress "thinking" output from Claude models. The feature allows users to hide internal reasoning text that appears between configurable start and end tags (defaulting to
<think>and</think>), while still displaying the final response to the user.Related Issues
Closes #1458
Files Changed
Code Changes
New Command-Line Flags
Core Filtering Logic
Streaming Output Control
Text Processing Function
Reason for Changes
This feature addresses the need to hide Claude's internal reasoning process from end users while still allowing the model to perform its thinking steps. When Claude models use thinking tags to show their reasoning process, users may want to see only the final answer without the intermediate steps. This is particularly useful for:
Impact of Changes
Positive Impacts:
Potential Concerns:
Test Plan
The changes include comprehensive test coverage:
Testing should verify:
Additional Notes
(?s)flag to handle multi-line thinking blocks<think>and</think>but can be customized\s*to clean up whitespace after thinking blocks