claude-code - 💡(How to fix) Fix [BUG] --dangerously-skip-permissions -c combination causes "F1H is not a function" crash on session restore [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#53752Fetched 2026-04-28 06:48:09
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
0
Timeline (top)
labeled ×5commented ×1

Error Message

Error Messages/Logs

ERROR F1H is not a function. (In 'F1H(q)', 'F1H' is undefined)

Fix Action

Fix / Workaround

Workaround: Use the flags separately until resolved.

Code Example

ERROR  F1H is not a function. (In 'F1H(q)', 'F1H' is undefined)                                                                                                                                         

  /$bunfs/root/src/entrypoints/cli.js:9251:5663                                                                                                                                                             
   
   - <anonymous> (/$bunfs/root/src/entrypoints/cli.js:9251:5663)                                                                                                                                            
   - WR (/$bunfs/root/src/entrypoints/cli.js:492:63749)  
   - UY (/$bunfs/root/src/entrypoints/cli.js:492:76948)                                                                                                                                                     
   - j5 (/$bunfs/root/src/entrypoints/cli.js:492:76827)                                                                                                                                                   
   - UY (/$bunfs/root/src/entrypoints/cli.js:492:77745)                                                                                                                                                     
   - j5 (/$bunfs/root/src/entrypoints/cli.js:492:76827)  
   - UY (/$bunfs/root/src/entrypoints/cli.js:492:76926)                                                                                                                                                     
   - j5 (/$bunfs/root/src/entrypoints/cli.js:492:76827)                                                                                                                                                   
   - UY (/$bunfs/root/src/entrypoints/cli.js:492:77745)                                                                                                                                                     
   - j5 (/$bunfs/root/src/entrypoints/cli.js:492:76827)                                                                                                                                                   
   - async <anonymous> (/$bunfs/root/src/entrypoints/cli.js:18808:11089)
RAW_BUFFERClick to expand / collapse

Preflight Checklist

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

What's Wrong?

Running claude --dangerously-skip-permissions -c crashes immediately without launching the REPL. The onSessionRestored callback (F1H) is undefined when the F2q hook is initialized with enabled: false, but the -c flag triggers session restoration and calls the callback without a null guard, resulting in a TypeError.

What Should Happen?

Using --dangerously-skip-permissions and -c together should resume the most recent session while bypassing permission prompts. Both flags work correctly in isolation, so the combination should work as
well.

Error Messages/Logs

ERROR  F1H is not a function. (In 'F1H(q)', 'F1H' is undefined)                                                                                                                                         

  /$bunfs/root/src/entrypoints/cli.js:9251:5663                                                                                                                                                             
   
   - <anonymous> (/$bunfs/root/src/entrypoints/cli.js:9251:5663)                                                                                                                                            
   - WR (/$bunfs/root/src/entrypoints/cli.js:492:63749)  
   - UY (/$bunfs/root/src/entrypoints/cli.js:492:76948)                                                                                                                                                     
   - j5 (/$bunfs/root/src/entrypoints/cli.js:492:76827)                                                                                                                                                   
   - UY (/$bunfs/root/src/entrypoints/cli.js:492:77745)                                                                                                                                                     
   - j5 (/$bunfs/root/src/entrypoints/cli.js:492:76827)  
   - UY (/$bunfs/root/src/entrypoints/cli.js:492:76926)                                                                                                                                                     
   - j5 (/$bunfs/root/src/entrypoints/cli.js:492:76827)                                                                                                                                                   
   - UY (/$bunfs/root/src/entrypoints/cli.js:492:77745)                                                                                                                                                     
   - j5 (/$bunfs/root/src/entrypoints/cli.js:492:76827)                                                                                                                                                   
   - async <anonymous> (/$bunfs/root/src/entrypoints/cli.js:18808:11089)

Steps to Reproduce

  1. Navigate to a directory with an existing Claude Code session
  2. Run the following command:
    claude --dangerously-skip-permissions -c
  3. Reproducibility: 100%

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

Unknown

Claude Code Version

2.1.119

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Warp

Additional Information

  • claude -c alone: works correctly

    • claude --dangerously-skip-permissions alone: works correctly
    • Crash only occurs when both flags are used together

    Analysis of the minified source reveals the problematic call site:

    // onSessionRestored (F1H) is undefined when F2q is initialized with enabled: false
    let { onSessionRestored: F1H } = F2q({ enabled: false, ... })

    useEffect(() => {
    if (q && q.length > 0) {
    F1H(q) // ← no null guard; TypeError when F1H is undefined }
    }, [])

    Suggested fix: Add a null guard at the call site — F1H?.(q) — or ensure F2q returns a no-op function when enabled: false.

    Workaround: Use the flags separately until resolved.

    claude -c # resume session (with permission prompts)
    claude --dangerously-skip-permissions # new session (permissions bypassed)

extent analysis

TL;DR

The issue can be fixed by adding a null guard to the onSessionRestored callback call site or ensuring F2q returns a no-op function when enabled is false.

Guidance

  • The error occurs because onSessionRestored (F1H) is undefined when F2q is initialized with enabled: false, causing a TypeError when trying to call it.
  • To fix this, add a null guard at the call site: F1H?.(q).
  • Alternatively, ensure F2q returns a no-op function when enabled: false.
  • As a temporary workaround, use the flags separately: run claude -c to resume the session with permission prompts, and then run claude --dangerously-skip-permissions to start a new session with permissions bypassed.

Example

// Add a null guard at the call site
useEffect(() => {
  if (q && q.length > 0) {
    F1H?.(q) // Add a null guard to prevent TypeError
  }
}, [])

Notes

The provided analysis of the minified source code suggests that the issue is due to the missing null guard. However, without access to the full codebase, it's difficult to provide a more comprehensive solution.

Recommendation

Apply the workaround by using the flags separately until a permanent fix is implemented, as it allows users to still utilize the functionality of both flags, albeit in two separate steps.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING