Skip to content

Instantly share code, notes, and snippets.

@davidar
Created December 28, 2025 12:31
Show Gist options
  • Select an option

  • Save davidar/4f7ade68f40bbb5700b4dcf920341ebe to your computer and use it in GitHub Desktop.

Select an option

Save davidar/4f7ade68f40bbb5700b4dcf920341ebe to your computer and use it in GitHub Desktop.
Fix Claude Code Chrome extension with Flatpak Chrome (Fedora Silverblue, etc.)

Fix Claude Code Chrome Extension with Flatpak Chrome

If you're using Chrome installed via Flatpak (common on Fedora Silverblue, immutable distros, etc.), the Claude Code browser automation won't work out of the box. Here's how to fix it.

The Problem

Claude Code installs the native messaging host to the standard Chrome location, but Flatpak Chrome:

  1. Looks for native messaging hosts in a different directory
  2. Has a sandboxed /tmp that isolates the Unix socket used for communication
  3. Doesn't have access to ~/.claude/ or ~/.local/share/claude/ by default

The Fix

Step 1: Copy the native messaging host manifest

cp ~/.config/google-chrome/NativeMessagingHosts/com.anthropic.claude_code_browser_extension.json \
   ~/.var/app/com.google.Chrome/config/google-chrome/NativeMessagingHosts/

Step 2: Grant Flatpak access to Claude directories

flatpak override --user com.google.Chrome \
  --filesystem=~/.claude:ro \
  --filesystem=~/.local/share/claude:ro

Step 3: Share host /tmp with Flatpak

This is needed because Claude Code's MCP server and the native messaging host communicate via a Unix socket in /tmp. Without this, the socket created inside Flatpak's sandbox isn't visible to Claude Code.

flatpak override --user com.google.Chrome --filesystem=/tmp

Step 4: Restart Chrome

Fully quit Chrome (not just close the window) and relaunch it:

pkill -9 -f '/app/extra/chrome'
pkill -9 -f 'bwrap.*chrome'
# Then reopen Chrome

Step 5: Test the connection

Run claude --chrome or use /chrome in an existing Claude Code session.

Verify permissions

You can check your Flatpak overrides with:

flatpak override --user --show com.google.Chrome

Expected output should include:

[Context]
filesystems=~/.local/share/claude:ro;/tmp;~/.claude:ro;

Security Note

Sharing /tmp with Flatpak has some security implications as it breaks part of the sandbox isolation. A better long-term fix would be for Claude Code to use a socket path in a user-accessible directory like ~/.claude/ or $XDG_RUNTIME_DIR instead of /tmp.

Related Issues


Tested on Fedora Silverblue with Chrome Flatpak (com.google.Chrome) and Claude Code 2.0.76.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment