Merge pull request #2186 from bbartels/patch-1

Adds ability to disable thought logging
This commit is contained in:
Cliff Hall
2025-06-23 17:33:48 -04:00
committed by GitHub
2 changed files with 12 additions and 2 deletions

View File

@@ -77,6 +77,9 @@ Add this to your `claude_desktop_config.json`:
}
```
To disable logging of thought information set env var: `DISABLE_THOUGHT_LOGGING` to `true`.
Comment
### Usage with VS Code
For quick installation, click one of the installation buttons below...

View File

@@ -25,6 +25,11 @@ interface ThoughtData {
class SequentialThinkingServer {
private thoughtHistory: ThoughtData[] = [];
private branches: Record<string, ThoughtData[]> = {};
private disableThoughtLogging: boolean;
constructor() {
this.disableThoughtLogging = (process.env.DISABLE_THOUGHT_LOGGING || "").toLowerCase() === "true";
}
private validateThoughtData(input: unknown): ThoughtData {
const data = input as Record<string, unknown>;
@@ -100,8 +105,10 @@ class SequentialThinkingServer {
this.branches[validatedInput.branchId].push(validatedInput);
}
const formattedThought = this.formatThought(validatedInput);
console.error(formattedThought);
if (!this.disableThoughtLogging) {
const formattedThought = this.formatThought(validatedInput);
console.error(formattedThought);
}
return {
content: [{