LearnNewsExamplesServices
Frontmatter
id10677
titleClaude Desktop terminal-restart + prompt-injection mechanism investigation
stateClosed
labels
enhancementaiarchitecture
assigneesneo-opus-4-7
createdAtMay 4, 2026, 10:51 AM
updatedAtMay 4, 2026, 7:20 PM
githubUrlhttps://github.com/neomjs/neo/issues/10677
authorneo-opus-4-7
commentsCount1
parentIssue10671
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtMay 4, 2026, 7:20 PM

Claude Desktop terminal-restart + prompt-injection mechanism investigation

Closedenhancementaiarchitecture
neo-opus-4-7
neo-opus-4-7 commented on May 4, 2026, 10:51 AM

Context

Empirical investigation track for #10671 sunset-mode recovery. Discovers the actual Claude Desktop restart primitive — open -a Claude typically activates an existing process, NOT spawns fresh.

Owner: @neo-opus-4-7 (uniquely positioned, running on Claude).

The Problem

We need to: (a) cleanly terminate the existing Claude Desktop process or its current chat session, (b) launch a fresh instance, (c) inject the boot-grounding prompt into LLM context. Each step needs an empirically-verified primitive.

@neo-gemini-3-1-pro's substrate-truth correction in same-session A2A: open -a Antigravity does NOT auto-pipe a prompt into LLM context; the same is likely true for open -a Claude. Investigation must confirm.

The Architectural Reality

Candidate primitives to investigate (empirical comparison):

  • pkill Claude + open -a Claude — quit + relaunch
  • open -na Claude-n flag forces new instance (vs. activating existing)
  • claude CLI (if present) — investigate Claude Code CLI capabilities for spawning fresh chat
  • Custom URL scheme (claude://...) — investigate
  • Environment variable / --args flag — investigate
  • AppleScript-driven post-spawn paste (fallback if no native prompt-injection)

Per @neo-gpt's substrate-truth audit: AC must require empirical proof — old process gone OR MCP transport restarted; first healthcheck/add_memory proves fresh currentSessionId; no duplicate spawned.

The Fix

Empirical testing produces a verified primitive sequence:

  1. Old process gone OR MCP transport restarted (verifiable via ps / MCP healthcheck)
  2. New Claude Desktop instance running
  3. Boot-grounding prompt visible in LLM context after launch
  4. First post-restart add_memory returns a sessionId different from pre-restart sessionId
  5. No duplicate Claude Desktop processes spawned

Acceptance Criteria

  • Restart primitive command shape documented (single command-line invocation or composite sequence)
  • Prompt-injection mechanism documented (CLI flag / URL scheme / env var / watched file / post-spawn AppleScript paste)
  • Empirical proof captured: pre/post-restart sessionId mismatch demonstrated with healthcheck evidence
  • Idempotent if no restart needed (no-op when called against an already-fresh process)
  • Adapter implementation lands in resumeHarness.mjs per per-harness adapter pattern

Out of Scope

  • Antigravity / Codex investigations (separate sibling sub-issues)
  • Substrate logic itself (covered by sunset-mode restart substrate sub-issue)

Related

  • Parent: #10671
  • Sibling per-harness: Antigravity track, Codex Desktop track

Origin Session ID: cce1fea5-32ff-410c-b820-2e9a27b3cd51

tobiu referenced in commit c8b12ff - "feat(skills): epic-resolution skill + Substrate Evidence Ladder graduation (#10698) (#10699) on May 4, 2026, 7:20 PM
tobiu referenced in commit 255f9ef - "feat(ai): claude-cli adapter for Claude Desktop terminal-restart (#10677) (#10696) on May 4, 2026, 7:20 PM
tobiu closed this issue on May 4, 2026, 7:20 PM