Skip to content

Commit b7c48c7

Browse files
authored
Merge pull request #2186 from bbartels/patch-1
Adds ability to disable thought logging
2 parents df25e5f + 65c5e1e commit b7c48c7

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

src/sequentialthinking/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ Add this to your `claude_desktop_config.json`:
7777
}
7878
```
7979

80+
To disable logging of thought information set env var: `DISABLE_THOUGHT_LOGGING` to `true`.
81+
Comment
82+
8083
### Usage with VS Code
8184

8285
For quick installation, click one of the installation buttons below...

src/sequentialthinking/index.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ interface ThoughtData {
2525
class SequentialThinkingServer {
2626
private thoughtHistory: ThoughtData[] = [];
2727
private branches: Record<string, ThoughtData[]> = {};
28+
private disableThoughtLogging: boolean;
29+
30+
constructor() {
31+
this.disableThoughtLogging = (process.env.DISABLE_THOUGHT_LOGGING || "").toLowerCase() === "true";
32+
}
2833

2934
private validateThoughtData(input: unknown): ThoughtData {
3035
const data = input as Record<string, unknown>;
@@ -100,8 +105,10 @@ class SequentialThinkingServer {
100105
this.branches[validatedInput.branchId].push(validatedInput);
101106
}
102107

103-
const formattedThought = this.formatThought(validatedInput);
104-
console.error(formattedThought);
108+
if (!this.disableThoughtLogging) {
109+
const formattedThought = this.formatThought(validatedInput);
110+
console.error(formattedThought);
111+
}
105112

106113
return {
107114
content: [{

0 commit comments

Comments
 (0)