Narrow claude.ai/code interception to user-input fields

Replaces the blanket skip on claude.ai/code with a targeted walker so
the user's prompt and pasted attachments still get substituted, but
tool_use / tool_result / system / IDs / metadata pass through verbatim.

Fields touched:
- top-level prompt and input (classic claude.ai shape)
- attachments[].extracted_content and attachments[].file_name
- messages[].content (or text parts) when role === 'user'

FormData uploads continue to flow through DocumentScanner since they
are user input. Raw non-JSON bodies are skipped on this path because
they are typically tool traffic, not user text.

https://claude.ai/code/session_01Y2YprLMx348eWD5C9Z4zpV
This commit is contained in:
Claude
2026-04-16 17:58:48 +00:00
parent 16c8275f4e
commit 331b1cb2a2
3 changed files with 86 additions and 29 deletions
-9
View File
@@ -15,15 +15,6 @@
if (window.__silentSendInjected) return;
window.__silentSendInjected = true;
// Skip Claude Code (web). Its tool-call traffic carries real paths/commands
// that must reach the runtime verbatim — substitution breaks execution.
if (
location.hostname === 'claude.ai' &&
/^\/code(\/|$)/.test(location.pathname)
) {
return;
}
// Merge active profiles into flat identity object
function mergeProfiles(data) {
const profiles = data?.profiles || [];