惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

J
Java Code Geeks
腾讯CDC
Jina AI
Jina AI
博客园 - 司徒正美
博客园 - 三生石上(FineUI控件)
Apple Machine Learning Research
Apple Machine Learning Research
GbyAI
GbyAI
WordPress大学
WordPress大学
Hugging Face - Blog
Hugging Face - Blog
T
The Blog of Author Tim Ferriss
小众软件
小众软件
M
MIT News - Artificial intelligence
MyScale Blog
MyScale Blog
D
Docker
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Google DeepMind News
Google DeepMind News
月光博客
月光博客
L
LangChain Blog
F
Fortinet All Blogs
Microsoft Azure Blog
Microsoft Azure Blog
博客园 - Franky
C
Check Point Blog
U
Unit 42
人人都是产品经理
人人都是产品经理

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
I Built a Chrome Extension to Sync AI Studio System Instr...
Muhammad Ahs · 2026-05-11 · via DEV Community

I use Google AI Studio on three machines. My laptop, my desktop, and occasionally a work machine.

Every time I switched devices, my system instructions weren't there. I'd carefully crafted a "Software Architect" prompt, a "Posts & Content" persona, a "YT Expert" context — and they existed on exactly one device. The others were blank.

Chrome sync handles bookmarks, passwords, even open tabs. Why not this?

The Obvious Solution That Doesn't Work

chrome.storage.sync looks like exactly the right tool. It's built into Chrome, it syncs across devices on the same Google account, and it has a reasonable quota.

There's one catch: Chrome only syncs extension storage for extensions installed from the Chrome Web Store.

Sideloaded extensions — installed via Developer Mode from a local folder — get a randomly generated ID on each device. Different ID = different sync namespace. Your data never overlaps, even with the same Google account signed in.

I spent longer than I'd like to admit trying to work around this with a pinned manifest key field before realizing the real problem: chrome.storage.sync simply wasn't designed for this use case.

The Actual Solution: Google Drive AppData

Every Google account has a hidden Drive folder called AppData. It's invisible in the Drive UI, private to the app that created it, and accessible via the drive.appdata OAuth scope. Crucially — it works identically for sideloaded and Web Store installs, because it's keyed to your Google account, not your extension ID.

This became the sync backend.

The architecture looks like this:

  • localStorage observer (injected into AI Studio) detects saves
  • Content script relays changes to the service worker
  • Service worker owns all merge logic and Drive I/O
  • Single JSON file in Drive AppData stores the full instruction registry

Component Layers

The Sync Design

A few decisions that made this work correctly:

UUID identity, not title identity. Each instruction gets a UUID on first save. Renames update the existing record — they don't create a new item. This prevents duplicate detection from breaking when a user renames something.

Tombstone-priority merge. Deletes are soft — a deletedAt timestamp is set rather than removing the record. When merging two registries, a delete wins over a live item when deletedAt > updatedAt. Without this, a stale live copy on device B would silently resurrect something deliberately deleted on device A.

Single batched Drive write per flush cycle. All pending changes accumulate in chrome.storage.local and are written to Drive in one read-modify-write call per alarm tick. Looping per-item would exhaust Drive API rate limits quickly and creates race conditions.

Push flow

Merge on pull, not replace. When device B polls Drive and finds new data, it snapshots its local state first, then merges remote into local. Items that exist locally but haven't flushed to Drive yet survive the pull instead of being clobbered.

Pull flow

Bootstrap union merge. On first install, the extension polls Drive before reading local state. This ensures a new device doesn't overwrite instructions already in Drive from another device.

Bootstrap flow

30-Second Polling

Drive AppData has no webhooks or push notifications. Each device polls every 30 seconds, comparing the Drive file's modifiedTime against the cached value. No change = no download. An edit on device A reaches device B in 30–60 seconds depending on alarm timing.

Not instant, but good enough for the use case.

Zero Infrastructure

There's no backend server. No telemetry. No third-party calls. The extension's test suite includes a static scan that fails the build if fetch() appears in any file other than drive-client.ts.

Your instruction data lives in your own Google Drive. The drive.appdata scope gives the extension access to its own private folder only — it cannot read, modify, or touch any other file in your Drive.

Try It

Chrome Web Store: https://chromewebstore.google.com/detail/opabdodcpedljaecmdjeggiojpbcopog

GitHub (MIT): https://github.com/AhsanAyaz/chrome-extension-aistudio-sysinstructions

First sync requires one manual Push Now or Pull Now to trigger the OAuth consent screen. Background sync is automatic after that.

If you've run into the same problem — or solved it differently — I'd love to hear about it in the comments.