Startup input box pre-populated with stray text ("GOK") when project CLAUDE.md/AutoMem files are loaded
Describe the bug
On every launch, the chat input box starts with 3 stray characters already typed (consistently "GOK" in my case) and the cursor positioned right after them. This is real, editable text in the input state (not a rendering artifact) — it can be backspaced normally.
Reproduction
- Launch
claude(also reproduces with--debug, and withCLAUDE_CODE_USE_BEDROCK=1) from inside any project directory that has aCLAUDE.mdand an AutoMemMEMORY.md. - Does not reproduce when launching from
$HOME(no projectCLAUDE.md/MEMORY.mdpresent). - Reproduces consistently across multiple unrelated project directories, always with the same stray text.
Debug log diff (the key correlation)
Clean run (from $HOME, no stray text):
[DEBUG] No CLAUDE.md/rules files found
no seed_read_state messages are sent.
Reproducing run (from a project dir, stray text appears):
[DEBUG] "Loaded 2 CLAUDE.md/rules files:\n [Project] .../CLAUDE.md (15150 chars)\n [AutoMem] .../memory/MEMORY.md (3499 chars)"
...
[DEBUG] [engine] send seed_read_state path=.../memory/MEMORY.md
[DEBUG] [engine] send seed_read_state path=.../CLAUDE.md
This pattern held across two separate, unrelated projects (both reproduced the bug) versus $HOME (clean) — the only consistent differentiator was presence/absence of the seed_read_state calls shortly after the composer (input box) mounts.
Hypothesis
Looks like a race or mis-delivery in the engine↔composer IPC right as CLAUDE.md/MEMORY.md content is seeded into the engine — a fragment appears to leak into the composer's text buffer instead of being consumed internally.
Environment
- Claude Code v2.1.285 (Homebrew cask)
- macOS (Darwin 25.6.0), iTerm2 3.5.12
- Terminal reports:
extendedKeys=yes, synchronizedOutput=yes, kittyKeyboard=yes (CSI ? u flags=0), kittyGraphics=no, mousePixels=no - Reproduces both via direct Bedrock provider and standard auth
- Ruled out: shell aliases/functions, iTerm2 triggers/profile startup text, clipboard/paste-cache, macOS text replacement, automation tools (Hammerspoon/Karabiner/BTT/KM) — none configured or implicated
- Also ruled out: file-index (
rg) background scan and a project-specific stdio MCP server — neither correlated consistently across repro cases