Developer Report — Claude Code Provider Failure (v5.4.0)
Plugin: Nexus MCP for Obsidian
Version: v5.4.1
OS: Windows 11
Date: 2026-03-24
Reporter: Midway65
Severity: Critical — Claude Code provider completely unusable on Windows without manual workaround
Executive Summary
The Claude Code provider in Nexus Chat v5.4.1 fails silently on Windows for any user who has files listed in defaultContextNotes. The plugin injects the full text content of those files into the claude CLI spawn call via command-line arguments. Windows imposes a hard 32,767-character limit on process command lines (CreateProcess). Any non-trivial context file exceeds this limit immediately, causing every message to hang without any user-visible error.
The Anthropic API provider is unaffected because it transmits context in the HTTP request body, not via argv.
Chronology of Discovery
- User configured Nexus Chat with
defaultContextNotes containing three files.
2. User authenticated Claude Code via claude auth login — succeeded in terminal.
- User switched Nexus Chat to Claude Code provider — every message hung indefinitely with no error shown in the UI.
- Removing the Anthropic API key had no effect (expected — the two providers use independent credential systems).
- Obsidian Developer Console (
Ctrl+Shift+I) revealed:
Error in generateResponse: Error: spawn ENAMETOOLONG
at ChildProcess.spawn (node:internal/child_process:420:11)
at Object.spawn (node:child_process:801:9)
at spawnDesktopProcess (plugin:nexus:17747:23)
at AnthropicClaudeCodeAdapter.generateStreamAsync (plugin:nexus:17926:25)
- Direct spawn test in Developer Console confirmed
claude.exe was reachable and functional:
require('child_process').exec(
'claude -p "hello" --output-format text',
(err, stdout, stderr) => { console.log('err:', err?.message, 'stdout:', stdout, 'stderr:', stderr) }
)
// Result: err: undefined, stdout: "Hello! How can I help you today?"
// stderr: "Warning: no stdin data received in 3s..."
- Inspecting
data.json revealed defaultContextNotes contained the large rules file — confirmed as the payload source.
- Fix: Cleared
defaultContextNotes to [] via Obsidian Settings → Nexus. Claude Code provider worked immediately on next test.
Root Cause
AnthropicClaudeCodeAdapter.generateStreamAsync (line ~17926) constructs a claude CLI spawn call and passes context — including the full text of all defaultContextNotes files — as command-line arguments via argv. On Windows, CreateProcess enforces a hard limit of 32,767 characters for the entire command line. A single large context file exceeds this before any conversation history is added.
The failure is silent in the UI. The spawn ENAMETOOLONG error is caught internally but not surfaced to the user. The chat simply hangs indefinitely, which makes diagnosis extremely difficult without knowing to open the Developer Console.
Secondary Finding: stdin Warning
The direct spawn test also revealed:
Warning: no stdin data received in 3s, proceeding without it.
The claude CLI expects stdin to be explicitly closed or redirected when not piping input. The plugin does not appear to pass stdio: ['ignore', 'pipe', 'pipe'] (or equivalent) in the spawn options, causing the CLI to stall for 3 seconds on every call waiting for stdin. This is a latency issue independent of ENAMETOOLONG — it adds ~3 seconds to every Claude Code response even when the argv limit is not exceeded.
Additional Console Finding: data.json Parse Error
The following error appeared in the Developer Console on Obsidian load:
failed to read JSON .obsidian/plugins/nexus/data.json
SyntaxError: Expected double-quoted property name in JSON at position 3704 (line 28 column 9)
This appeared to be transient (the file was valid when inspected manually) and may have occurred during a write operation earlier in the session. However, if data.json fails to parse on load, provider configuration including claudePath will not load correctly, which could contribute to Claude Code provider failures independently of the ENAMETOOLONG issue. The plugin should handle data.json parse failures gracefully and surface a clear error rather than silently falling back to defaults.
Impact
| Scenario |
Impact |
| User has any large file in defaultContextNotes |
Claude Code provider completely non-functional on Windows |
| User has small/no context notes |
Claude Code may work but stdin latency adds ~3s per message |
| data.json parse failure on load |
Provider config silently reverts to defaults; Claude Code may appear unconfigured |
| Failure with no UI feedback |
User has no path to diagnosis without knowing to open Developer Console |
Recommended Fixes
Fix 1 — Pass context via stdin, not argv (Critical)
Rewrite AnthropicClaudeCodeAdapter.generateStreamAsync to pipe conversation context and defaultContextNotes content to the claude process via stdin rather than constructing a long argv string. This removes the Windows 32,767-char limit entirely.
// Current approach (problematic)
spawn('claude', [...contextArgs, ...historyArgs], { ... })
// Recommended approach
const proc = spawn('claude', ['--output-format', 'stream-json'], {
stdio: ['pipe', 'pipe', 'pipe'] // explicitly control all three streams
})
proc.stdin.write(JSON.stringify(contextPayload))
proc.stdin.end()
Fix 2 — Close stdin explicitly on spawn (High)
Even if context is not passed via stdin, always set stdin to 'ignore' when no stdin input is needed:
spawn('claude', args, {
stdio: ['ignore', 'pipe', 'pipe'] // prevents 3s stdin wait
})
This eliminates the no stdin data received in 3s warning and removes the latency it causes.
Fix 3 — Enforce a context size budget with user warning (High)
If argv-based context injection is retained for any reason, enforce a maximum character budget before spawning and warn the user when files are truncated or excluded:
const MAX_ARGV_CHARS = 20000 // conservative budget below 32,767
if (totalContextLength > MAX_ARGV_CHARS) {
// truncate and notify, or exclude defaultContextNotes
showNotice('Context too large for Claude Code provider — defaultContextNotes excluded')
}
Fix 4 — Surface ENAMETOOLONG as a user-visible error (High)
Currently the spawn error is swallowed and the UI hangs silently. At minimum, catch ENAMETOOLONG specifically and display a clear message:
"Message too long for Claude Code provider.
Start a new chat, reduce context notes, or switch to the API provider."
Fix 5 — Validate data.json on load with fallback UI (Medium)
If data.json fails to parse, display a settings warning rather than silently loading defaults. A corrupted config that resets provider settings is a confusing failure mode.
Fix 6 — Document defaultContextNotes size constraint (Low)
Until the above fixes are implemented, add a note in the UI next to the defaultContextNotes setting:
"Note: Large context files may cause failures with the Claude Code provider on Windows
due to OS command-line length limits. Recommend keeping total context under 20KB."
Workaround (Current)
Clear defaultContextNotes in Obsidian Settings → Nexus → Default Context Notes. Remove all entries. The Claude Code provider will then function correctly. Context can be loaded per-session via the prompt selector or via MCP tool calls within the conversation.
Environment
Obsidian: 1.12.2
Nexus: v5.4.0
OS: Windows 11
Node (Electron internal): Chromium-bundled
Claude CLI: (authorized, functional)
Developer Report — Claude Code Provider Failure (v5.4.0)
Plugin: Nexus MCP for Obsidian
Version: v5.4.1
OS: Windows 11
Date: 2026-03-24
Reporter: Midway65
Severity: Critical — Claude Code provider completely unusable on Windows without manual workaround
Executive Summary
The Claude Code provider in Nexus Chat v5.4.1 fails silently on Windows for any user who has files listed in
defaultContextNotes. The plugin injects the full text content of those files into theclaudeCLI spawn call via command-line arguments. Windows imposes a hard 32,767-character limit on process command lines (CreateProcess). Any non-trivial context file exceeds this limit immediately, causing every message to hang without any user-visible error.The Anthropic API provider is unaffected because it transmits context in the HTTP request body, not via argv.
Chronology of Discovery
defaultContextNotescontaining three files.2. User authenticated Claude Code via
claude auth login— succeeded in terminal.Ctrl+Shift+I) revealed:claude.exewas reachable and functional:data.jsonrevealeddefaultContextNotescontained the large rules file — confirmed as the payload source.defaultContextNotesto[]via Obsidian Settings → Nexus. Claude Code provider worked immediately on next test.Root Cause
AnthropicClaudeCodeAdapter.generateStreamAsync(line ~17926) constructs aclaudeCLI spawn call and passes context — including the full text of alldefaultContextNotesfiles — as command-line arguments via argv. On Windows,CreateProcessenforces a hard limit of 32,767 characters for the entire command line. A single large context file exceeds this before any conversation history is added.The failure is silent in the UI. The
spawn ENAMETOOLONGerror is caught internally but not surfaced to the user. The chat simply hangs indefinitely, which makes diagnosis extremely difficult without knowing to open the Developer Console.Secondary Finding: stdin Warning
The direct spawn test also revealed:
The
claudeCLI expects stdin to be explicitly closed or redirected when not piping input. The plugin does not appear to passstdio: ['ignore', 'pipe', 'pipe'](or equivalent) in the spawn options, causing the CLI to stall for 3 seconds on every call waiting for stdin. This is a latency issue independent of ENAMETOOLONG — it adds ~3 seconds to every Claude Code response even when the argv limit is not exceeded.Additional Console Finding:
data.jsonParse ErrorThe following error appeared in the Developer Console on Obsidian load:
This appeared to be transient (the file was valid when inspected manually) and may have occurred during a write operation earlier in the session. However, if
data.jsonfails to parse on load, provider configuration includingclaudePathwill not load correctly, which could contribute to Claude Code provider failures independently of the ENAMETOOLONG issue. The plugin should handledata.jsonparse failures gracefully and surface a clear error rather than silently falling back to defaults.Impact
Recommended Fixes
Fix 1 — Pass context via stdin, not argv (Critical)
Rewrite
AnthropicClaudeCodeAdapter.generateStreamAsyncto pipe conversation context anddefaultContextNotescontent to theclaudeprocess via stdin rather than constructing a long argv string. This removes the Windows 32,767-char limit entirely.Fix 2 — Close stdin explicitly on spawn (High)
Even if context is not passed via stdin, always set stdin to
'ignore'when no stdin input is needed:This eliminates the
no stdin data received in 3swarning and removes the latency it causes.Fix 3 — Enforce a context size budget with user warning (High)
If argv-based context injection is retained for any reason, enforce a maximum character budget before spawning and warn the user when files are truncated or excluded:
Fix 4 — Surface ENAMETOOLONG as a user-visible error (High)
Currently the spawn error is swallowed and the UI hangs silently. At minimum, catch
ENAMETOOLONGspecifically and display a clear message:Fix 5 — Validate
data.jsonon load with fallback UI (Medium)If
data.jsonfails to parse, display a settings warning rather than silently loading defaults. A corrupted config that resets provider settings is a confusing failure mode.Fix 6 — Document
defaultContextNotessize constraint (Low)Until the above fixes are implemented, add a note in the UI next to the
defaultContextNotessetting:Workaround (Current)
Clear
defaultContextNotesin Obsidian Settings → Nexus → Default Context Notes. Remove all entries. The Claude Code provider will then function correctly. Context can be loaded per-session via the prompt selector or via MCP tool calls within the conversation.Environment