Skip to content

docs(specs): add idea for Claude CLI IDE bridge#368

Open
Luis85 wants to merge 2 commits into
developfrom
claude/obsidian-cli-integration-GwmfE
Open

docs(specs): add idea for Claude CLI IDE bridge#368
Luis85 wants to merge 2 commits into
developfrom
claude/obsidian-cli-integration-GwmfE

Conversation

@Luis85
Copy link
Copy Markdown
Owner

@Luis85 Luis85 commented May 16, 2026

Summary

  • New stage-1 spec entry under specs/claude-cli-ide-bridge/ proposing an Option-4A integration: an Obsidian-side WebSocket MCP server that implements the reverse-engineered Claude Code IDE protocol so the embedded claude interactive session (IDEA-TSP-001) gains ambient vault awareness — the same surface VS Code and JetBrains plugins expose.
  • Two files added: idea.md (problem, users, success criteria, constraints, open research questions, preliminary scope) and workflow-state.md (canonical ADR-005 schema, area CIB).
  • No code, no plugin changes, no requirements yet — purely the idea artifact ahead of the Phase-4 spec-first gate.

Why this exists

The existing claude-cli-chat-sidebar (headless single-turn via the Agent SDK) and terminal-sidepanel (transparent PTY passthrough) both leave Claude blind to vault state. The reverse-engineered IDE protocol (lock file in ~/.claude/ide/<port>.lock, env vars CLAUDE_CODE_SSE_PORT / ENABLE_IDE_INTEGRATION, JSON-RPC 2.0 over ws://127.0.0.1:N, auth via x-claude-code-ide-authorization header) gives a clean way to add that awareness without modifying the CLI or the chat path. The user can keep typing into a literal claude TUI and Claude can call getCurrentSelection, getOpenEditors, openFile, openDiff, etc., against Obsidian's workspace.

Open research items captured in the idea

  • Bundle ws vs. hand-roll the WebSocket upgrade handshake.
  • Minimum viable tool surface (which tools Claude actually calls in practice).
  • openDiff modal UX and accept-path persistence.
  • Autosave reconciliation for checkDocumentDirty / saveDocument.
  • Behaviour when a concurrent VS Code/JetBrains IDE is running on the same machine.
  • Risk of protocol drift — protocol is reverse-engineered, not contractually guaranteed by Anthropic.

Spec-first gate

This PR contains only the idea artifact. Per CLAUDE.md and CONSTITUTION.md §3, no implementation branch may be opened until requirements are accepted.

Test plan

  • PM review of idea.md against the IDEA-CIB-001 problem statement
  • Confirm IDEA-TSP-001 dependency is captured (this feature spawns on top of the terminal panel's PTY)
  • Confirm scope cleanly excludes the chat-sidebar runtime path (4B) — that's a follow-on decision

https://claude.ai/code/session_01TR8tn5a6d5utftgtGz4nij


Generated by Claude Code

claude added 2 commits May 16, 2026 12:50
Stage-1 spec entry layering the reverse-engineered Claude Code IDE
integration protocol (WebSocket MCP server discovered via
~/.claude/ide/<port>.lock) onto the IDEA-TSP-001 terminal sidepanel,
giving the embedded interactive session the same ambient vault
awareness the VS Code and JetBrains plugins provide.

https://claude.ai/code/session_01TR8tn5a6d5utftgtGz4nij
Incorporates PM, architecture, and security review findings plus three
deep-research passes on the IDE protocol, Obsidian APIs, and WebSocket
library choice.

Substantive changes to idea.md:
- Tighten problem statement; demote solution detail (env var names,
  file modes, debounce values, HTTP status codes) into research
  questions and constraints.
- Add the non-technical persona explicitly as a non-goal user, with
  rationale (desktop + CLI-installed only).
- Rewrite success criteria as observable behaviour ("Claude responds
  correctly to questions that depend on knowing which note is active")
  rather than implementation values.
- Resolve the in-scope / out-of-scope contradiction around stubbed
  tools (stubs are in scope; real integration is out).
- Split the proposed port surface per ADR-008: server lifecycle is
  one narrow port; diff confirmation modal is a second narrow port
  mirroring ConfirmModalPort; tool dispatch is application-layer
  (one use case per protocol verb), not a domain port.
- Add same-UID threat boundary, Origin header rejection, stale
  lockfile sweep, multi-window safety, vault-scoped path validation,
  and process.env mutation scope to constraints and research
  questions.
- Add the openDiff accept-path question (reuse propose/commit
  envelope per ADR-0032 vs. direct VaultPort.writeFile).
- Add the REQ-CCS-009 integration question (event-bus subscription
  preferred over direct handler modification).
- Promote IDEA-TSP-001 to a hard frontmatter dependency with a
  spawn-env hook precondition.

workflow-state.md updated with revised hand-off note and open
clarifications reflecting the answered and remaining questions
across the two review and three research passes.

https://claude.ai/code/session_01TR8tn5a6d5utftgtGz4nij
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants