Crash on /fork: undefined is not an object (evaluating 'T.match') in stderr parsing
Resolved 💬 3 comments Opened Feb 9, 2026 by RQ-Akiyoshi Closed Feb 12, 2026
Description
Running the /fork command causes Claude Code to crash with undefined is not an object (evaluating 'T.match'). The crash occurs in the Bash tool output rendering pipeline when stderr is undefined.
Steps to Reproduce
- Start a Claude Code session
- Execute the
/forkcommand - Application crashes
Error Message
undefined is not an object (evaluating 'T.match')
Stack Trace
Be7 (/$bunfs/root/claude:1953:13358)
G7T (/$bunfs/root/claude:1953:13795)
g1 (/$bunfs/root/claude:656:20780)
F6 (/$bunfs/root/claude:656:39182)
yb (/$bunfs/root/claude:656:49801)
dx (/$bunfs/root/claude:656:86058)
Se (/$bunfs/root/claude:656:85032)
Ap (/$bunfs/root/claude:656:84857)
td (/$bunfs/root/claude:656:81650)
nR (/$bunfs/root/claude:656:6275)
Root Cause Analysis
The Be7 function (sandbox violations parser) calls .match() on its input parameter without a null/undefined check:
// Deminified problematic code
function Be7(T) {
// Crashes here when T is undefined
if (!T.match(/<sandbox_violations>([\s\S]*?)<\/sandbox_violations>/))
return { cleanedStderr: T };
return { cleanedStderr: e3R(T).trim() };
}
This function is called from G7T (Bash tool output rendering component) with stderr as the argument. When /fork restores previous tool results, some content objects lack the stderr field, resulting in undefined being passed to Be7.
Expected Fix
Add a null/undefined guard at the top of the function:
function Be7(T) {
if (!T) return { cleanedStderr: '' };
if (!T.match(/<sandbox_violations>([\s\S]*?)<\/sandbox_violations>/))
return { cleanedStderr: T };
return { cleanedStderr: e3R(T).trim() };
}
Environment
- OS: macOS (Darwin 24.4.0)
- Runtime: Bun
- Claude Code: Latest as of 2026-02-09
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗