[BUG] "ERROR G.ref is not a function" when attempting to pipe a slash command

Resolved 💬 6 comments Opened Sep 9, 2025 by uhchris Closed Jan 8, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

I was curious if I could pipe slash commands because the CLI reference demonstrates piping prompts, and doesn't explicitly say you can't pipe slash commands.

As a test I tried /cost.

The following attempts both fail the same way:

# with echo
$ echo "/cost" | claude

# with cat
$ echo "/cost" > slash.txt
$ cat slash.txt | claude

What Should Happen?

One of the following would be less surprising:

  • Support piping commands this way
  • Present an error if piping commands is not going to be supported
  • Ignore the commands and just start claude normally

Error Messages/Logs

╭───────────────────────────────────────────────────╮
│ ✻ Welcome to Claude Code!                         │
│                                                   │
│   /help for help, /status for your current setup  │
│                                                   │
│   cwd: /Users/chris/ws/github/project            │
╰───────────────────────────────────────────────────╯

  ERROR  G.ref is not a function. (In 'G.ref()', 'G.ref' is undefined)

 /$bunfs/root/claude:666:164

 663 `).slice(1).map((J)=>{let Q=wYZ.parseLine(J);if(!Q)return KQ.default.createElement(y,{key:J},KQ.default.createElement(O,{dimColor:!0},"- "),KQ.default.createElement(O,{dimColor:!0,bold:!0},J));return
 :  KQ.default.createElement(y,{key:J},KQ.default.createElement(O,{dimColor:!0},"- "),KQ.default.createElement(O,{dimColor:!0,bold:!0},Q.function),KQ.default.createElement(O,{dimColor:!0,color:"secondaryText"},"
    ","(",DYZ(Q.file)??"",":",Q.line,":",Q.column,")"))})))}import{Buffer as $M5}from"buffer";var
    UM5=/^(?:\x1b)([a-zA-Z0-9])$/,AM5=/^(?:\x1b+)(O|N|\[|\[\[)(?:(\d+)(?:;(\d+))?([~^$])|(?:1;)?(\d+)?([a-zA-Z]))/,NM5="\x1B[200~",v30="\x1B[201~";function
    CM5(Z){return{name:"",fn:!1,ctrl:!1,meta:!1,shift:!1,option:!1,sequence:Z,raw:Z,isPasted:!0}}var LM5=new
    RegExp("^(.*?)("+["\\x1b\\][0-9]*(?:;[^\\x07\\x1b]*)*(?:\\x07|\\x1b\\\\)","\\x1bP[^\\x1b]*\\x1b\\\\","\\x1b\\[[0-9]*(?:;[0-9]*)*[A-Za-z~]","\\x1bO[A-Za-z]","\\x1b[\\x00-\\x7F]","\\x1b\\x1b","$"].map((Z)=>`(?:${Z})`).join("|")+")","s"),MM5=new
    RegExp("(.*?)("+["\\x1b\\][0-9]*(?:;[^\\x07\\x1b]*)*$","\\x1bP[^\\x1b]*$","\\x1b\\[[0-9]*(?:;[0-9]*)*$","\\x1bO$","\\x1b$","$"].map((Z)=>`(?:${Z})`).join("|")+")","s"),AYZ={mode:"NORMAL",incomplete:""};function
    OM5(Z){if($M5.isBuffer(Z))if(Z[0]>127&&Z[1]===void 0)return Z[0]-=128,"\x1B"+String(Z);else return String(Z);else if(Z!==void 0&&typeof Z!=="string")return String(Z);else if(!Z)return"";else return Z}function NYZ(Z,G=""){let
    W=G===null,Y=W?"":OM5(G);if(Z.mode==="IN_PASTE"){if((Z.incomplete.slice(-v30.length+1)+Y).indexOf(v30)===-1)return[[],{...Z,incomplete:Z.incomplete+Y}]}let X=Z.incomplete+Y,B={...Z,incomplete:""},J=[],Q={NORMAL:()=>{let
    V=LM5.exec(X);X=X.substring(V[0].length);let K=V[1];if(!V[2]&&!W){let H=MM5.exec(K);B.incomplete=H[2],K=H[1]}if(K)J.push(UYZ(K));if(V[2]===NM5)B.mode="IN_PASTE";else if(V[2])J.push(UYZ(V[2]))},IN_PASTE:()=>{let
    V=X.indexOf(v30);if(V===-1){if(!W){B.incomplete=X,X="";return}V=X.length}let K=X.substring(0,V);if(K)J.push(CM5(K));X=X.substring(V+v30.length),B.mode="NORMAL"}};while(X)Q[B.mode]();return[J,B]}var
    CYZ={OP:"f1",OQ:"f2",OR:"f3",OS:"f4","[11~":"f1","[12~":"f2","[13~":"f3","[14~":"f4","[[A":"f1","[[B":"f2","[[C":"f3","[[D":"f4","[[E":"f5","[15~":"f5","[17~":"f6","[18~":"f7","[19~":"f8","[20~":"f9","[21~":"f10","[23~":"f11","[24~":"f12","[A"
    :"up","[B":"down","[C":"right","[D":"left","[E":"clear","[F":"end","[H":"home",OA:"up",OB:"down",OC:"right",OD:"left",OE:"clear",OF:"end",OH:"home","[1~":"home","[2~":"insert","[3~":"delete","[4~":"end","[5~":"pageup","[6~":"pagedown","[[5~":"
    pageup","[[6~":"pagedown","[7~":"home","[8~":"end","[a":"up","[b":"down","[c":"right","[d":"left","[e":"clear","[2$":"insert","[3$":"delete","[5$":"pageup","[6$":"pagedown","[7$":"home","[8$":"end",Oa:"up",Ob:"down",Oc:"right",Od:"left",Oe:"cl
    ear","[2^":"insert","[3^":"delete","[5^":"pageup","[6^":"pagedown","[7^":"home","[8^":"end","[Z":"tab"},LYZ=[...Object.values(CYZ),"backspace"],EM5=(Z)=>{return["[a","[b","[c","[d","[e","[2$","[3$","[5$","[6$","[7$","[8$","[Z"].includes(Z)},RM
    5=(Z)=>{return["Oa","Ob","Oc","Od","Oe","[2^","[3^","[5^","[6^","[7^","[8^"].includes(Z)},UYZ=(Z="")=>{let
    G,W={name:"",fn:!1,ctrl:!1,meta:!1,shift:!1,option:!1,sequence:Z,raw:Z,isPasted:!1};if(W.sequence=W.sequence||Z||W.name,Z==="\r")W.raw=void 0,W.name="return";else if(Z===`
 664 `)W.name="enter";else if(Z==="\t")W.name="tab";else if(Z==="\b"||Z==="\x1B\b")W.name="backspace",W.meta=Z.charAt(0)==="\x1B";else if(Z==="\x7F"||Z==="\x1B\x7F")W.name="backspace",W.meta=Z.charAt(0)==="\x1B";else
 :  if(Z==="\x1B"||Z==="\x1B\x1B")W.name="escape",W.meta=Z.length===2;else if(Z===" "||Z==="\x1B ")W.name="space",W.meta=Z.length===2;else if(Z==="\x1F")W.name="_",W.ctrl=!0;else
    if(Z<="\x1A"&&Z.length===1)W.name=String.fromCharCode(Z.charCodeAt(0)+97-1),W.ctrl=!0;else if(Z.length===1&&Z>="0"&&Z<="9")W.name="number";else if(Z.length===1&&Z>="a"&&Z<="z")W.name=Z;else
    if(Z.length===1&&Z>="A"&&Z<="Z")W.name=Z.toLowerCase(),W.shift=!0;else if(G=UM5.exec(Z))W.meta=!0,W.shift=/^[A-Z]$/.test(G[1]);else if(G=AM5.exec(Z)){let Y=[...Z];if(Y[0]==="\x1B"&&Y[1]==="\x1B")W.option=!0;let
    X=[G[1],G[2],G[4],G[6]].filter(Boolean).join(""),B=(G[3]||G[5]||1)-1;W.ctrl=!!(B&4),W.meta=!!(B&10),W.shift=!!(B&1),W.code=X,W.name=CYZ[X],W.shift=EM5(X)||W.shift,W.ctrl=RM5(X)||W.ctrl}if(W.raw==="\x1Bb")W.meta=!0,W.name="left";else
    if(W.raw==="\x1Bf")W.meta=!0,W.name="right";switch(Z){case"\x1B[1~":return{name:"home",ctrl:!1,meta:!1,shift:!1,option:!1,fn:!1,sequence:Z,raw:Z,isPasted:!1};case"\x1B[4~":return{name:"end",ctrl:!1,meta:!1,shift:!1,option:!1,fn:!1,sequence:Z,r
    aw:Z,isPasted:!1};case"\x1B[5~":return{name:"pageup",ctrl:!1,meta:!1,shift:!1,option:!1,fn:!1,sequence:Z,raw:Z,isPasted:!1};case"\x1B[6~":return{name:"pagedown",ctrl:!1,meta:!1,shift:!1,option:!1,fn:!1,sequence:Z,raw:Z,isPasted:!1};case"\x1B[1
    ;5D":return{name:"left",ctrl:!0,meta:!1,shift:!1,option:!1,fn:!1,sequence:Z,raw:Z,isPasted:!1};case"\x1B[1;5C":return{name:"right",ctrl:!0,meta:!1,shift:!1,option:!1,fn:!1,sequence:Z,raw:Z,isPasted:!1};case"\x1B[1~":return{name:"left",ctrl:!0,
    fn:!0,meta:!1,shift:!1,option:!1,sequence:Z,raw:Z,isPasted:!1};case"\x1B[4~":return{name:"right",ctrl:!0,fn:!0,meta:!1,shift:!1,option:!1,sequence:Z,raw:Z,isPasted:!1}}return W};var PM5="\t",SM5="\x1B[Z",_M5="\x1B",yM5=!0;class b30 extends
    UC.PureComponent{static displayName="InternalApp";static getDerivedStateFromError(Z){return{error:Z}}state={isFocusEnabled:!0,activeFocusId:void 0,focusables:[],error:void 0};rawModeEnabledCount=0;internal_eventEmitter=new
    TM5;keyParseState=AYZ;incompleteEscapeTimer=null;NORMAL_TIMEOUT=50;PASTE_TIMEOUT=500;isRawModeSupported(){return this.props.stdin.isTTY}render(){return UC.default.createElement(pl0.Provider,{value:{exit:this.handleExit}},UC.default.createEleme
    nt(tl0,{initialState:this.props.initialTheme},UC.default.createElement(y30.Provider,{value:{stdin:this.props.stdin,setRawMode:this.handleSetRawMode,isRawModeSupported:this.isRawModeSupported(),internal_exitOnCtrlC:this.props.exitOnCtrlC,intern
    al_eventEmitter:this.internal_eventEmitter,internal_resetLineCount:this.props.resetLineCount}},UC.default.createElement(il0.Provider,{value:{stdout:this.props.stdout,write:this.props.writeToStdout}},UC.default.createElement(nl0.Provider,{value
    :{stderr:this.props.stderr,write:this.props.writeToStderr}},UC.default.createElement(f30.Provider,{value:{activeId:this.state.activeFocusId,add:this.addFocusable,remove:this.removeFocusable,activate:this.activateFocusable,deactivate:this.deact
    ivateFocusable,enableFocus:this.enableFocus,disableFocus:this.disableFocus,focusNext:this.focusNext,focusPrevious:this.focusPrevious,focus:this.focus}},this.state.error?UC.default.createElement(Gp0,{error:this.state.error}):this.props.children
    ))))))}componentDidMount(){mS.hide(this.props.stdout)}componentWillUnmount(){if(mS.show(this.props.stdout),this.incompleteEscapeTimer)clearTimeout(this.incompleteEscapeTimer),this.incompleteEscapeTimer=null;if(this.isRawModeSupported())this.ha
    ndleSetRawMode(!1)}componentDidCatch(Z){this.handleExit(Z)}handleSetRawMode=(Z)=>{let{stdin:G}=this.props;if(!this.isRawModeSupported())if(G===process.stdin)throw new Error(`Raw mode is not supported on the current process.stdin, which Ink
    uses as input stream by default.
 665: Read about how to prevent this error on https://github.com/vadimdemedes/ink/#israwmodesupported`);else throw new Error(`Raw mode is not supported on the stdin provided to Ink.
 666 Read about how to prevent this error on https://github.com/vadimdemedes/ink/#israwmodesupported`);if(G.setEncoding("utf8"),Z){if(this.rawModeEnabledCount===0)G.ref(),G.setRawMode(!0),G.addListener("readable",this.handleReadable),this.props.st
 :  dout.write("\x1B[?2004h");this.rawModeEnabledCount++;return}if(--this.rawModeEnabledCount===0)this.props.stdout.write("\x1B[?2004l"),G.setRawMode(!1),G.removeListener("readable",this.handleReadable),G.unref()};flushIncomplete=()=>{if(this.inco
    mpleteEscapeTimer=null,!this.keyParseState.incomplete)return;this.processInput(null)};processInput=(Z)=>{let[G,W]=NYZ(this.keyParseState,Z);this.keyParseState=W;for(let Y of 
    G)this.handleInput(Y.sequence),this.internal_eventEmitter.emit("input",Y);if(this.keyParseState.incomplete){if(this.incompleteEscapeTimer)clearTimeout(this.incompleteEscapeTimer);this.incompleteEscapeTimer=setTimeout(this.flushIncomplete,this.
    keyParseState.mode==="IN_PASTE"?this.PASTE_TIMEOUT:this.NORMAL_TIMEOUT)}};handleReadable=()=>{let Z;while((Z=this.props.stdin.read())!==null)this.processInput(Z)};handleInput=(Z)=>{if(Z==="\x03"&&this.props.exitOnCtrlC)this.handleExit();if(Z==
    ="\x1A"&&yM5)this.handleSuspend();if(Z===_M5&&this.state.activeFocusId)this.setState({activeFocusId:void 0});if(this.state.isFocusEnabled&&this.state.focusables.length>0){if(Z===PM5)this.focusNext();if(Z===SM5)this.focusPrevious()}};handleExit
    =(Z)=>{if(this.isRawModeSupported())this.handleSetRawMode(!1);this.props.onExit(Z)};handleSuspend=()=>{if(!this.isRawModeSupported())return;let 
    Z=this.rawModeEnabledCount;while(this.rawModeEnabledCount>0)this.handleSetRawMode(!1);mS.show(this.props.stdout),this.internal_eventEmitter.emit("suspend");let G=()=>{for(let 
    W=0;W<Z;W++)if(this.isRawModeSupported())this.handleSetRawMode(!0);mS.hide(this.props.stdout),this.internal_eventEmitter.emit("resume"),process.removeListener("SIGCONT",G)};process.on("SIGCONT",G),process.kill(process.pid,"SIGSTOP")};enableFoc
    us=()=>{this.setState({isFocusEnabled:!0})};disableFocus=()=>{this.setState({isFocusEnabled:!1})};focus=(Z)=>{this.setState((G)=>{if(!G.focusables.some((Y)=>Y?.id===Z))return G;return{activeFocusId:Z}})};focusNext=()=>{this.setState((Z)=>{let 
    G=Z.focusables.find((Y)=>Y.isActive)?.id;return{activeFocusId:this.findNextFocusable(Z)??G}})};focusPrevious=()=>{this.setState((Z)=>{let 
    G=Z.focusables.findLast((Y)=>Y.isActive)?.id;return{activeFocusId:this.findPreviousFocusable(Z)??G}})};addFocusable=(Z,{autoFocus:G})=>{this.setState((W)=>{let 
    Y=W.activeFocusId;if(!Y&&G)Y=Z;return{activeFocusId:Y,focusables:[...W.focusables,{id:Z,isActive:!0}]}})};removeFocusable=(Z)=>{this.setState((G)=>({activeFocusId:G.activeFocusId===Z?void 
    0:G.activeFocusId,focusables:G.focusables.filter((W)=>{return W.id!==Z})}))};activateFocusable=(Z)=>{this.setState((G)=>({focusables:G.focusables.map((W)=>{if(W.id!==Z)return 
    W;return{id:Z,isActive:!0}})}))};deactivateFocusable=(Z)=>{this.setState((G)=>({activeFocusId:G.activeFocusId===Z?void 0:G.activeFocusId,focusables:G.focusables.map((W)=>{if(W.id!==Z)return 
    W;return{id:Z,isActive:!1}})}))};findNextFocusable=(Z)=>{let G=Z.focusables.findIndex((W)=>{return W.id===Z.activeFocusId});for(let W=G+1;W<Z.focusables.length;W++){let Y=Z.focusables[W];if(Y?.isActive)return 
    Y.id}return};findPreviousFocusable=(Z)=>{let G=Z.focusables.findIndex((W)=>{return W.id===Z.activeFocusId});for(let W=G-1;W>=0;W--){let Y=Z.focusables[W];if(Y?.isActive)return Y.id}return}}var ex=Boolean(!1),MYZ=()=>{};class 
    h30{options;log;throttledLog;isUnmounted;lastOutput;lastOutputHeight;container;rootNode=null;fullStaticOutput;exitPromise;restoreConsole;unsubscribeResize;beginSynchronizedUpdate="\x1B[?2026h";endSynchronizedUpdate="\x1B[?2026l";constructor(Z)
    {this.options=Z;if(Xl0(this),this.log=a5Z.create(Z.stdout),this.throttledLog=Z.debug?this.log:f70(this.log,void 
    0,{leading:!0,trailing:!0}),this.isUnmounted=!1,this.lastOutput="",this.lastOutputHeight=0,this.fullStaticOutput="",this.unsubscribeExit=OK0(this.unmount,{alwaysLast:!1}),Z.patchConsole)this.patchConsole();if(!ex)Z.stdout.on("resize",this.resi
    zed),this.unsubscribeResize=()=>{Z.stdout.off("resize",this.resized)};if(this.rootNode=$30("ink-root"),this.rootNode.onComputeLayout=this.calculateLayout,this.rootNode.onRender=Z.debug?this.onRender:f70(this.onRender,32,{leading:!0,trailing:!0
    }),this.rootNode.onImmediateRender=this.onRender,this.container=rx.createContainer(this.rootNode,0,null,!1,null,"id",()=>{},null),process.env.DEV==="true")rx.injectIntoDevTools({bundleType:0,version:"16.13.1",rendererPackageName:"ink"})}resize
    d=()=>{this.calculateLayout(),this.onRender(!0)};resolveExitPromise=()=>{};rejectExitPromise=()=>{};unsubscribeExit=()=>{};calculateLayout=()=>{let 
    Z=this.options.stdout.columns||80;if(!this.rootNode)return;this.rootNode.yogaNode.setWidth(Z),this.rootNode.yogaNode.calculateLayout(void 0,void 
    0,H30.DIRECTION_LTR)};setTheme(Z){this.options.theme=Z}onRender(Z=!1){if(this.isUnmounted)return;if(!this.rootNode)return;let{output:G,outputHeight:W,staticOutput:Y}=h5Z(this.rootNode,this.options.theme),X=Y&&Y!==`
 667 `;if(this.options.debug){if(X)this.fullStaticOutput+=Y;this.options.stdout.write(this.fullStaticOutput+G);return}if(ex){if(X)this.options.stdout.write(Y);this.lastOutput=G,this.lastOutputHeight=W;return}if(X)this.fullStaticOutput+=Y;if(W>=thi
 :  s.options.stdout.rows||this.lastOutputHeight>=this.options.stdout.rows){if(this.options.onFlicker)this.options.onFlicker(W,this.options.stdout.rows);this.options.stdout.write(this.beginSynchronizedUpdate+vS.clearTerminal+this.fullStaticOutput+
    G+`
 668: `+this.endSynchronizedUpdate),this.lastOutput=G,this.lastOutputHeight=W,this.log.updateLineCount(G+`
 669: `);return}if(Z){this.options.stdout.write(this.beginSynchronizedUpdate+vS.clearTerminal+this.fullStaticOutput+G+`

 - handleSetRawMode (/$bunfs/root/claude:666:164)
 - <anonymous> (/$bunfs/root/claude:673:257)
 - s6 (/$bunfs/root/claude:49:21530)
 - kz (/$bunfs/root/claude:49:41111)
 - QF (/$bunfs/root/claude:49:35147)
 - MY (/$bunfs/root/claude:47:4842)
 - CX (/$bunfs/root/claude:49:32454)
 - <anonymous> (/$bunfs/root/claude:53:1839)
 - render (/$bunfs/root/claude:671:511)
 - kM5 (/$bunfs/root/claude:672:954)

661 | `).length};return Q.clear=()=>{Z.write(B+vS.eraseLines(W)+J),Y="",W=0},Q.updateLineCount=(V)=>{W=V.split(`
662 | `).length},Q.resetLineCount=()=>{W=0},Q.done=()=>{if(Y="",W=0,!G)mS.show(),X=!1},Q},JM5={create:XM5},a5Z=JM5;var BM5=new Map,tx=BM5;var UC=d(H0(),1);import{EventEmitter as TM5}from"events";var o5Z=d(H0(),1),s5Z=o5Z.createContext({exit(){}});s5Z.displayName="InternalAppContext";var pl0=s5Z;var t5Z=d(H0(),1);import{EventEmitter as QM5}from"events";var e5Z=t5Z.createContext({stdin:process.stdin,internal_eventEmitter:new QM5,setRawMode(){},isRawModeSupported:!1,internal_exitOnCtrlC:!0,internal_resetLineCount(){}});e5Z.displayName="InternalStdinContext";var y30=e5Z;var ZYZ=d(H0(),1),GYZ=ZYZ.createContext({stdout:process.stdout,write(){}});GYZ.displayName="InternalStdoutContext";var il0=GYZ;var WYZ=d(H0(),1),YYZ=WYZ.createContext({stderr:process.stderr,write(){}});YYZ.displayName="InternalStderrContext";var nl0=YYZ;var XYZ=d(H0(),1),JYZ=XYZ.createContext({activeId:void 0,add(){},remove(){},activate(){},deactivate(){},enableFocus(){},disableFocus(){},focusNext(){},focusPrevious(){},focus(){}});JYZ.displayName="Inter | ... truncated 
663 | `).slice(1):void 0,W=G?wYZ.parseLine(G[0]):void 0,Y=DYZ(W?.file),X,B=0;if(Y&&W?.line&&x30.existsSync(Y)){let J=x30.readFileSync(Y,"utf8");if(X=FYZ(J,W.line),X)for(let{line:Q}of X)B=Math.max(B,String(Q).length)}return KQ.default.createElement(y,{flexDirection:"column",padding:1},KQ.default.createElement(y,null,KQ.default.createElement(O,{backgroundColor:"error",color:"text"}," ","ERROR"," "),KQ.default.createElement(O,null," ",Z.message)),W&&Y&&KQ.default.createElement(y,{marginTop:1},KQ.default.createElement(O,{dimColor:!0},Y,":",W.line,":",W.column)),W&&X&&KQ.default.createElement(y,{marginTop:1,flexDirection:"column"},X.map(({line:J,value:Q})=>KQ.default.createElement(y,{key:J},KQ.default.createElement(y,{width:B+1},KQ.default.createElement(O,{dimColor:J!==W.line,backgroundColor:J===W.line?"error":void 0,color:J===W.line?"text":void 0},String(J).padStart(B," "),":")),KQ.default.createElement(O,{key:J,backgroundColor:J===W.line?"error":void 0,color:J===W.line?"text":void 0}," "+Q)))),Z.stack&&KQ.default.crea | ... truncated 
664 | `).slice(1).map((J)=>{let Q=wYZ.parseLine(J);if(!Q)return KQ.default.createElement(y,{key:J},KQ.default.createElement(O,{dimColor:!0},"- "),KQ.default.createElement(O,{dimColor:!0,bold:!0},J));return KQ.default.createElement(y,{key:J},KQ.default.createElement(O,{dimColor:!0},"- "),KQ.default.createElement(O,{dimColor:!0,bold:!0},Q.function),KQ.default.createElement(O,{dimColor:!0,color:"secondaryText"}," ","(",DYZ(Q.file)??"",":",Q.line,":",Q.column,")"))})))}import{Buffer as $M5}from"buffer";var UM5=/^(?:\x1b)([a-zA-Z0-9])$/,AM5=/^(?:\x1b+)(O|N|\[|\[\[)(?:(\d+)(?:;(\d+))?([~^$])|(?:1;)?(\d+)?([a-zA-Z]))/,NM5="\x1B[200~",v30="\x1B[201~";function CM5(Z){return{name:"",fn:!1,ctrl:!1,meta:!1,shift:!1,option:!1,sequence:Z,raw:Z,isPasted:!0}}var LM5=new RegExp("^(.*?)("+["\\x1b\\][0-9]*(?:;[^\\x07\\x1b]*)*(?:\\x07|\\x1b\\\\)","\\x1bP[^\\x1b]*\\x1b\\\\","\\x1b\\[[0-9]*(?:;[0-9]*)*[A-Za-z~]","\\x1bO[A-Za-z]","\\x1b[\\x00-\\x7F]","\\x1b\\x1b","$"].map((Z)=>`(?:${Z})`).join("|")+")","s"),MM5=new RegExp("(.*?)("+["\\x1 | ... truncated 
665 | `)W.name="enter";else if(Z==="\t")W.name="tab";else if(Z==="\b"||Z==="\x1B\b")W.name="backspace",W.meta=Z.charAt(0)==="\x1B";else if(Z==="\x7F"||Z==="\x1B\x7F")W.name="backspace",W.meta=Z.charAt(0)==="\x1B";else if(Z==="\x1B"||Z==="\x1B\x1B")W.name="escape",W.meta=Z.length===2;else if(Z===" "||Z==="\x1B ")W.name="space",W.meta=Z.length===2;else if(Z==="\x1F")W.name="_",W.ctrl=!0;else if(Z<="\x1A"&&Z.length===1)W.name=String.fromCharCode(Z.charCodeAt(0)+97-1),W.ctrl=!0;else if(Z.length===1&&Z>="0"&&Z<="9")W.name="number";else if(Z.length===1&&Z>="a"&&Z<="z")W.name=Z;else if(Z.length===1&&Z>="A"&&Z<="Z")W.name=Z.toLowerCase(),W.shift=!0;else if(G=UM5.exec(Z))W.meta=!0,W.shift=/^[A-Z]$/.test(G[1]);else if(G=AM5.exec(Z)){let Y=[...Z];if(Y[0]==="\x1B"&&Y[1]==="\x1B")W.option=!0;let X=[G[1],G[2],G[4],G[6]].filter(Boolean).join(""),B=(G[3]||G[5]||1)-1;W.ctrl=!!(B&4),W.meta=!!(B&10),W.shift=!!(B&1),W.code=X,W.name=CYZ[X],W.shift=EM5(X)||W.shift,W.ctrl=RM5(X)||W.ctrl}if(W.raw==="\x1Bb")W.meta=!0,W.name="left";else if( | ... truncated 
666 | Read about how to prevent this error on https://github.com/vadimdemedes/ink/#israwmodesupported`);if(G.setEncoding("utf8"),Z){if(this.rawModeEnabledCount===0)G.ref(),G.setRawMode(!0),G.addListener("readable",this.handleReadable),this.props.stdout.write("\x1B[?2004h");this.rawModeEnabledCount++;return}if(--this.rawModeEnabledCount===0)this.props.stdout.write("\x1B[?2004l"),G.setRawMode(!1),G.removeListener("readable",this.handleReadable),G.unref()};flushIncomplete=()=>{if(this.incompleteEscapeTimer=null,!this.keyParseState.incomplete)return;this.processInput(null)};processInput=(Z)=>{let[G,W]=NYZ(this.keyParseState,Z);this.keyParseState=W;for(let Y of G)this.handleInput(Y.sequence),this.internal_eventEmitter.emit("input",Y);if(this.keyParseState.incomplete){if(this.incompleteEscapeTimer)clearTimeout(this.incompleteEscapeTimer);this.incompleteEscapeTimer=setTimeout(this.flushIncomplete,this.keyParseState.mode==="IN_PASTE"?this.PASTE_TIMEOUT:this.NORMAL_TIMEOUT)}};handleReadable=()=>{let Z;while((Z=this.props.st | ... truncated 

TypeError: G.ref is not a function. (In 'G.ref()', 'G.ref' is undefined)
      at handleSetRawMode (/$bunfs/root/claude:666:164)
      at <anonymous> (/$bunfs/root/claude:673:257)
      at s6 (/$bunfs/root/claude:49:21530)
      at kz (/$bunfs/root/claude:49:41111)
      at QF (/$bunfs/root/claude:49:35147)
      at MY (/$bunfs/root/claude:47:4842)
      at CX (/$bunfs/root/claude:49:32454)
      at <anonymous> (/$bunfs/root/claude:53:1839)
      at render (/$bunfs/root/claude:671:511)
      at kM5 (/$bunfs/root/claude:672:954)

661 | `).length},Q.resetLineCount=()=>{W=0},Q.done=()=>{if(Y="",W=0,!G)mS.show(),X=!1},Q},JM5={create:XM5},a5Z=JM5;var BM5=new Map,tx=BM5;var UC=d(H0(),1);import{EventEmitter as TM5}from"events";var o5Z=d(H0(),1),s5Z=o5Z.createContext({exit(){}});s5Z.displayName="InternalAppContext";var pl0=s5Z;var t5Z=d(H0(),1);import{EventEmitter as QM5}from"events";var e5Z=t5Z.createContext({stdin:process.stdin,internal_eventEmitter:new QM5,setRawMode(){},isRawModeSupported:!1,internal_exitOnCtrlC:!0,internal_resetLineCount(){}});e5Z.displayName="InternalStdinContext";var y30=e5Z;var ZYZ=d(H0(),1),GYZ=ZYZ.createContext({stdout:process.stdout,write(){}});GYZ.displayName="InternalStdoutContext";var il0=GYZ;var WYZ=d(H0(),1),YYZ=WYZ.createContext({stderr:process.stderr,write(){}});YYZ.displayName="InternalStderrContext";var nl0=YYZ;var XYZ=d(H0(),1),JYZ=XYZ.createContext({activeId:void 0,add(){},remove(){},activate(){},deactivate(){},enableFocus(){},disableFocus(){},focusNext(){},focusPrevious(){},focus(){}});JYZ.displayName="Inter | ... truncated 
662 | `).slice(1):void 0,W=G?wYZ.parseLine(G[0]):void 0,Y=DYZ(W?.file),X,B=0;if(Y&&W?.line&&x30.existsSync(Y)){let J=x30.readFileSync(Y,"utf8");if(X=FYZ(J,W.line),X)for(let{line:Q}of X)B=Math.max(B,String(Q).length)}return KQ.default.createElement(y,{flexDirection:"column",padding:1},KQ.default.createElement(y,null,KQ.default.createElement(O,{backgroundColor:"error",color:"text"}," ","ERROR"," "),KQ.default.createElement(O,null," ",Z.message)),W&&Y&&KQ.default.createElement(y,{marginTop:1},KQ.default.createElement(O,{dimColor:!0},Y,":",W.line,":",W.column)),W&&X&&KQ.default.createElement(y,{marginTop:1,flexDirection:"column"},X.map(({line:J,value:Q})=>KQ.default.createElement(y,{key:J},KQ.default.createElement(y,{width:B+1},KQ.default.createElement(O,{dimColor:J!==W.line,backgroundColor:J===W.line?"error":void 0,color:J===W.line?"text":void 0},String(J).padStart(B," "),":")),KQ.default.createElement(O,{key:J,backgroundColor:J===W.line?"error":void 0,color:J===W.line?"text":void 0}," "+Q)))),Z.stack&&KQ.default.crea | ... truncated 
663 | `).slice(1).map((J)=>{let Q=wYZ.parseLine(J);if(!Q)return KQ.default.createElement(y,{key:J},KQ.default.createElement(O,{dimColor:!0},"- "),KQ.default.createElement(O,{dimColor:!0,bold:!0},J));return KQ.default.createElement(y,{key:J},KQ.default.createElement(O,{dimColor:!0},"- "),KQ.default.createElement(O,{dimColor:!0,bold:!0},Q.function),KQ.default.createElement(O,{dimColor:!0,color:"secondaryText"}," ","(",DYZ(Q.file)??"",":",Q.line,":",Q.column,")"))})))}import{Buffer as $M5}from"buffer";var UM5=/^(?:\x1b)([a-zA-Z0-9])$/,AM5=/^(?:\x1b+)(O|N|\[|\[\[)(?:(\d+)(?:;(\d+))?([~^$])|(?:1;)?(\d+)?([a-zA-Z]))/,NM5="\x1B[200~",v30="\x1B[201~";function CM5(Z){return{name:"",fn:!1,ctrl:!1,meta:!1,shift:!1,option:!1,sequence:Z,raw:Z,isPasted:!0}}var LM5=new RegExp("^(.*?)("+["\\x1b\\][0-9]*(?:;[^\\x07\\x1b]*)*(?:\\x07|\\x1b\\\\)","\\x1bP[^\\x1b]*\\x1b\\\\","\\x1b\\[[0-9]*(?:;[0-9]*)*[A-Za-z~]","\\x1bO[A-Za-z]","\\x1b[\\x00-\\x7F]","\\x1b\\x1b","$"].map((Z)=>`(?:${Z})`).join("|")+")","s"),MM5=new RegExp("(.*?)("+["\\x1 | ... truncated 
664 | `)W.name="enter";else if(Z==="\t")W.name="tab";else if(Z==="\b"||Z==="\x1B\b")W.name="backspace",W.meta=Z.charAt(0)==="\x1B";else if(Z==="\x7F"||Z==="\x1B\x7F")W.name="backspace",W.meta=Z.charAt(0)==="\x1B";else if(Z==="\x1B"||Z==="\x1B\x1B")W.name="escape",W.meta=Z.length===2;else if(Z===" "||Z==="\x1B ")W.name="space",W.meta=Z.length===2;else if(Z==="\x1F")W.name="_",W.ctrl=!0;else if(Z<="\x1A"&&Z.length===1)W.name=String.fromCharCode(Z.charCodeAt(0)+97-1),W.ctrl=!0;else if(Z.length===1&&Z>="0"&&Z<="9")W.name="number";else if(Z.length===1&&Z>="a"&&Z<="z")W.name=Z;else if(Z.length===1&&Z>="A"&&Z<="Z")W.name=Z.toLowerCase(),W.shift=!0;else if(G=UM5.exec(Z))W.meta=!0,W.shift=/^[A-Z]$/.test(G[1]);else if(G=AM5.exec(Z)){let Y=[...Z];if(Y[0]==="\x1B"&&Y[1]==="\x1B")W.option=!0;let X=[G[1],G[2],G[4],G[6]].filter(Boolean).join(""),B=(G[3]||G[5]||1)-1;W.ctrl=!!(B&4),W.meta=!!(B&10),W.shift=!!(B&1),W.code=X,W.name=CYZ[X],W.shift=EM5(X)||W.shift,W.ctrl=RM5(X)||W.ctrl}if(W.raw==="\x1Bb")W.meta=!0,W.name="left";else if( | ... truncated 
665 | Read about how to prevent this error on https://github.com/vadimdemedes/ink/#israwmodesupported`);else throw new Error(`Raw mode is not supported on the stdin provided to Ink.
666 | Read about how to prevent this error on https://github.com/vadimdemedes/ink/#israwmodesupported`);if(G.setEncoding("utf8"),Z){if(this.rawModeEnabledCount===0)G.ref(),G.setRawMode(!0),G.addListener("readable",this.handleReadable),this.props.stdout.write("\x1B[?2004h");this.rawModeEnabledCount++;return}if(--this.rawModeEnabledCount===0)this.props.stdout.write("\x1B[?2004l"),G.setRawMode(!1),G.removeListener("readable",this.handleReadable),G.unref()};flushIncomplete=()=>{if(this.incompleteEscapeTimer=null,!this.keyParseState.incomplete)return;this.processInput(null)};processInput=(Z)=>{let[G,W]=NYZ(this.keyParseState,Z);this.keyParseState=W;for(let Y of G)this.handleInput(Y.sequence),this.internal_eventEmitter.emit("input",Y);if(this.keyParseState.incomplete){if(this.incompleteEscapeTimer)clearTimeout(this.incompleteEscapeTimer);this.incompleteEscapeTimer=setTimeout(this.flushIncomplete,this.keyParseState.mode==="IN_PASTE"?this.PASTE_TIMEOUT:this.NORMAL_TIMEOUT)}};handleReadable=()=>{let Z;while((Z=this.props.st | ... truncated 

TypeError: G.ref is not a function. (In 'G.ref()', 'G.ref' is undefined)
      at handleSetRawMode (/$bunfs/root/claude:666:164)


Bun v1.2.19 (macOS arm64)

Steps to Reproduce

# with echo
$ echo "/cost" | claude
# with cat
$ echo "/cost" > slash.txt
$ cat slash.txt | claude

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

1.0.109

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

VS Code integrated terminal

Additional Information

  • I'm using native install method
  • claude doctor shows a clean bill of health

View original on GitHub ↗

This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗