DEV Community

Cover image for PotatoClaw: my friend's 8GB laptop kept freezing during lab submissions, so I built him a zero-dollar copilot
Abhishek Khanra
Abhishek Khanra

Posted on AI-assisted

PotatoClaw: my friend's 8GB laptop kept freezing during lab submissions, so I built him a zero-dollar copilot

Hacktoberfest Weekend Challenge: Build for a Friend Submission 🤝

This is a submission for the Hacktoberfest Weekend Challenge: Build for a Friend


Project Summary: PotatoClaw is a featherweight Windows desktop overlay built in Rust (Tauri v2) paired with an asynchronous cloud backend on Render. It shields 8 GB laptops from system freezes using native Win32 K32EmptyWorkingSet memory trims, while offloading multimodal reasoning and data validation to Google DeepMind's Gemma 4, Prior Labs' TabPFN, Backboard.io, ElevenLabs, Groq, and Sentry for $0.00 a month.

What I Built

I built PotatoClaw for Rudra, my hostel wingmate and fellow first-year computer science student.

Wednesday night, 11 PM. Our first graded C programming lab was due at dawn.

Rudra works on an entry-level HP 15s notebook powered by an AMD Ryzen 3 3250U with a single 8 GB RAM stick. The unadvertised trap with budget Ryzen APUs is the integrated Radeon Vega GPU. The hardware firmware allocates 2.1 GB of physical memory to video RAM the moment the machine powers on. Windows only gets 5.88 GB to divide between Chrome, the desktop window manager, background telemetry, and an IDE.

Rudra had spent two hours chasing an off-by-one pointer bug in a doubly linked list. His desktop was crowded: VS Code, an active compiler terminal, a 40-page lab PDF manual, GeeksforGeeks, and four StackOverflow tabs.

Then his cursor hitched. Rudra pressed Alt+Tab. His screen went pitch black. Seven seconds passed in silence. When the display finally blinked back to life, VS Code had terminated unexpectedly. Forty lines of unsaved C pointer logic were gone. Task Manager was a solid block of red: RAM pinned at 93%, disk usage stuck at 100%. Windows was furiously thrashing the pagefile against a budget SSD, freezing the entire operating system every time he touched a key.

He dropped his forehead directly onto his keyboard:

"Bhai, main is dabba ko balcony se phek dunga." ("Bro, I am throwing this toaster off the balcony.")

Standard developer advice is completely useless in an engineering college hostel:

  • "Just install Linux": He tried dual-booting Ubuntu during high school, accidentally formatted his EFI system partition, and his father had to carry the laptop to a repair shop in town to recover Windows.
  • "Buy a refurbished Mac": Our semester tuition is 45,000 rupees. A base M2 MacBook costs more than a full year of college.
  • "Run Ollama locally": Loading an 8B model requires 5.5 GB of RAM. Loading that into 5.88 GB of usable memory crashes the Windows Desktop Window Manager instantly.
  • "Keep ChatGPT open in Chrome": Spawning heavy Electron and web tabs was the exact thing that triggered pagefile thrashing in the first place.

We spent that weekend building PotatoClaw in Rust to solve his problem without spending a single rupee.

The desktop layer is an 18 MB standalone binary built in Tauri v2. It floats a tiny 72-pixel circular pill above active windows, consuming under 35 MB of resident memory. Double-clicking the pill calls native Win32 memory management APIs. It sweeps background processes, protects the active editor, and forces the Windows NT kernel to move dormant working set pages into the standby list. That single sweep drops physical RAM usage by 1.7 to 3.5 GB in 0.24 seconds. No applications close. No tabs reload. No unsaved code is lost.

To solve the rest of his coursework headaches without bogging down his CPU, the desktop pill connects to an asynchronous FastAPI cloud engine running on Render's free tier. When Rudra hits a cryptic compiler crash or needs to verify sensor readings from our physics lab, he presses Alt+Shift+2 to crop his screen, or drops the file directly onto the pill:

  • Google DeepMind's Gemma 4 parses the compiler error and inspects C syntax via an automated two-pass verification prompt.
  • Prior Labs' TabPFN 3.5 runs zero-shot tabular anomaly regression on lab sensor CSVs in 178 milliseconds, catching corrupt rows without needing local Python data science libraries.
  • Backboard.io preserves his debugging context across app reboots.
  • ElevenLabs Turbo v2.5 plays a quick 20-second spoken debrief through his headphones so he can rest his eyes at 1 AM.
  • Groq Whisper transcribes spoken debug queries in 80 milliseconds.
  • Sentry captures telemetry on every memory trim and cloud inference call.

Total monthly running cost: zero rupees.

PotatoClaw floating pill and Assistant HUD running alongside VS Code and Task Manager

Figure 1: PotatoClaw running on the desktop with under 35 MB of resident RAM alongside VS Code and Task Manager.

Demo

Windows Task Manager memory graph showing immediate downward drop after double-clicking the PotatoClaw pill

Figure 2: Native Win32 working set trim flushing background pages into standby memory in 0.24 seconds.

What happens during a typical late-night coding session:

  1. Windows Task Manager climbs toward 92% RAM under Chrome and an active build.
  2. Rudra double-clicks the floating pill; physical memory drops by 2.4 GB in 240 milliseconds as background working sets are trimmed.
  3. He presses Alt+Shift+2, drags crosshairs over an unhandled segmentation fault, and Gemma 4 pinpoints the uninitialized struct pointer in 780 milliseconds.
  4. ElevenLabs streams a spoken summary through his earphones so he can absorb the fix without squinting at terminal lines.

Code

GitHub logo IshekKhal / potatoclaw

A featherweight desktop companion and Win32 RAM shield for 8GB Windows laptops. Reclaims 1.5 to 3.5 GB of stale memory in 0.24s during heavy multitasking and offloads AI reasoning, document Q&A, and voice debriefs to the cloud for $0/month.

PotatoClaw

Featherweight desktop AI companion and Win32 anti-thrash memory shield for 8 GB RAM laptops.

License: MIT Release Backend Status Tests


What It Is

PotatoClaw is a native Windows desktop overlay built in Rust (Tauri v2) that protects memory-constrained PCs from lockups and freezes. When multitasking across browser tabs, IDEs, lab manuals, and PDFs, physical memory usage spikes past 90%. Windows drops into hard pagefile thrashing, freezing the desktop.

PotatoClaw addresses this with two components:

  1. A local Win32 memory shield: A floating desktop pill widget. Clicking it invokes native K32EmptyWorkingSet with active foreground process protection and a 60+ process whitelist, releasing 1.7 GB to 3.5 GB of physical memory in 0.24 seconds without closing open applications or dropping unsaved work.
  2. An asynchronous cloud brain: Heavy multimodal reasoning, screen snip OCR, tabular anomaly scanning, cross-session memory, and voice synthesis offload to a containerized FastAPI backend on Render. The local machine stays cool and draws under…

The repository is structured as a dual-stack monorepo:

  • src-tauri/: Native Rust desktop client, Win32 memory shield, GDI screen snipper, and in-HUD settings manager.
  • backend/: Containerized FastAPI service configured for Render deployment via render.yaml, integrating Gemma 4, TabPFN 3.5, Backboard.io, ElevenLabs, Groq, and Sentry.

How I Built It

1. The Win32 Working Set Mechanism (Native Rust)

When Windows reports 90% memory pressure on an 8 GB laptop, most of that RAM is not actively computing anything. Browsers, background updaters, and communication apps allocate heap pages, touch them during startup, and leave them mapped into physical memory. In the Windows NT kernel, this active physical mapping is called a process working set.

Windows exposes an internal API in kernel32.dll / psapi.dll: K32EmptyWorkingSet. Calling this function orders the Windows memory manager to strip unreferenced pages from a process working set and push them to the standby list. If the process later demands that memory back, the kernel retrieves it via a soft page fault without reading from the disk.

We wrote the memory shield in native Rust using the official windows crate:

// src-tauri/src/memory_shield.rs
pub fn trim_process_working_set(pid: u32) -> Result<u64, String> {
    unsafe {
        let handle = OpenProcess(
            PROCESS_QUERY_INFORMATION | PROCESS_SET_QUOTA,
            false,
            pid,
        ).map_err(|e| e.to_string())?;

        let mut before = PROCESS_MEMORY_COUNTERS::default();
        K32GetProcessMemoryInfo(
            handle,
            &mut before,
            std::mem::size_of_val(&before) as u32,
        );

        // Signal Windows NT kernel to move idle pages to standby list
        let success = K32EmptyWorkingSet(handle);

        let mut after = PROCESS_MEMORY_COUNTERS::default();
        K32GetProcessMemoryInfo(
            handle,
            &mut after,
            std::mem::size_of_val(&after) as u32,
        );

        CloseHandle(handle);

        if success.as_bool() {
            Ok(before.WorkingSetSize.saturating_sub(after.WorkingSetSize) as u64)
        } else {
            Err("EmptyWorkingSet call rejected by kernel".to_string())
        }
    }
}
Enter fullscreen mode Exit fullscreen mode

The first night we tested this, I simply looped across every active PID on the machine. It freed 4 GB instantly, but VS Code hitching for 50 milliseconds every time Rudra touched a key made it unusable. Windows was evicting the editor's font cache and syntax tokens along with everything else.

To fix that stutter, the trim function checks the active desktop state before touching any memory handles. It queries GetForegroundWindow and GetWindowThreadProcessId to identify whatever program currently holds the user's focus, strictly exempting that PID from the trim. A second whitelist filter checks process basenames against PROTECTED_PROCESS_NAMES, completely bypassing PID 0, PID 4, and over 60 essential OS services like dwmapi.exe, explorer.exe, audio hosts, and graphics display drivers.

During automated benchmark sweeps, a single trim reclaims 1,719 MB (1.72 GB) on an idle desktop. Under active compilation workloads with browser tabs open, it routinely recovers between 2.8 GB and 3.5 GB in 0.24 seconds. On startup, PotatoClaw also trims its own working set, locking its resident memory footprint below 35 MB.


2. The Native Desktop Shell: Why Electron Was Excluded

Building an Electron app to rescue an 8 GB laptop from memory starvation is counterproductive. A standard Electron hello-world window pulls between 150 MB and 250 MB of RAM before executing a single line of application code.

PotatoClaw uses Tauri v2 in Rust. The UI binds directly to the Microsoft Edge WebView2 runtime already built into Windows 10 and 11. The entire frontend runs on vanilla HTML5, CSS3, and modern JavaScript with zero Node.js runtime overhead.

The desktop client splits responsibilities across three focused native surfaces. The DropBox Pill (ui/dropbox.html) stays permanently on top as a transparent 72x72 circular widget. Clicking it toggles the assistant, double-clicking fires the memory sweep, and dragging any file onto it stages the path directly into context. Pressing Alt+Shift+P slides open the Assistant HUD (ui/hud.html), a 540x680 card that streams answers, formats copyable code blocks, renders TabPFN anomaly breakdowns, and hosts an in-HUD settings modal for backend URL and access PIN management. When text alone cannot describe a bug, Alt+Shift+2 summons the GDI Snipper (ui/snipper.html), which overlays a borderless crosshair canvas and grabs screen pixels through direct Win32 BitBlt and CreateCompatibleBitmap calls to write a clean PNG directly to disk without browser canvas lag.

We also built a multi-source drag-and-drop extractor (extractDropPayload) in JavaScript. It parses raw Explorer file paths, VS Code editor tab drags (text/uri-list with file:/// URIs), web URLs, and recursive directory folders up to 50 files.

PotatoClaw Assistant HUD showing staged C code file badge ready for multi-document reasoning

Figure 3: Staging code files, PDFs, or CSV lab datasets directly into the assistant context via drag-and-drop.

3. Google DeepMind Gemma 4 (Universal Reasoning & Vision)

All memory-intensive AI operations are delegated to our FastAPI container on Render. This architecture completely shields the student's local CPU and RAM from inference spikes while providing frontier-grade reasoning.

We run gemma-4-26b-a4b-it through Google AI Studio's API. Early tests showed that single-pass prompts occasionally hallucinated non-existent POSIX headers or invented pointer syntax when debugging low-level C. To stop bad code from reaching the student, the backend executes a two-pass pipeline. The first pass diagnoses the compiler trace and drafts a proposed code fix. Before that answer leaves the server, a second audit pass feeds the draft back into Gemma 4 alongside the original compiler log, verifying declared variables, checking pointer dereferences, and stripping unsupported claims. Both passes finish in 680 to 920 milliseconds over standard broadband.

Assistant HUD displaying Gemma 4 two-pass C pointer diagnosis and ElevenLabs audio playback player

Figure 4: Gemma 4 isolates the null pointer dereference with commented C code and a streaming voice debrief.

4. Prior Labs TabPFN (Zero-Shot Tabular Anomaly Engine)

Our physics and electronics labs demand endless manual data logging: Hall Effect voltages, diode curves, and RC circuit charging intervals. Plotting and validating those numbers locally is painful on a budget machine. Installing Python, pandas, and scikit-learn eats over 3 GB of disk space, and just importing them pushes RAM consumption past 1 GB before you even touch a CSV row.

PotatoClaw solves this by routing tabular files (.csv and .tsv) directly to Prior Labs' TabPFN 3.5 engine (backend/app/services/tabpfn_engine.py) hosted on our cloud backend. TabPFN is an in-context foundation model trained on synthetic tabular datasets. It executes non-linear regression across numerical columns in 178 milliseconds without requiring any local model training, iterative gradient descent, or hyperparameter tuning.

Here is how our tabular anomaly detection works in code:

# backend/app/services/tabpfn_engine.py
# 1. Regress dependent feature against independent columns
X = clean_df[feature_names].values
y = clean_df[target_name].values

regressor = TabPFNRegressor()
regressor.fit(X, y)
preds = regressor.predict(X)

# 2. Compute non-linear residuals and normalized z-scores
residuals = np.abs(y - preds)
res_mean = np.mean(residuals)
res_std = np.std(residuals)

if res_std > 1e-8:
    res_z = (residuals - res_mean) / res_std
    # Flag rows where prediction error exceeds 2.5 standard deviations
    flagged_idx = clean_df.index[res_z > 2.5].tolist()
Enter fullscreen mode Exit fullscreen mode

When Rudra dropped hall_sensor_run2.csv (15 rows of calibration readings with an injected 24.85V spike caused by a slipped oscilloscope probe) onto the PotatoClaw pill:

  1. TabPFN computed column baselines and fitted the voltage-to-time curve in 178 ms.
  2. The residual error at index 10 hit a z-score of 3.42 sigma, immediately isolating the bad sensor row while confirming the remaining 14 rows were within normal experimental tolerance.
  3. Gemma 4 executed a two-pass audit on TabPFN's metrics, returning a clean summary in the HUD detailing the exact timestamp, the outlier reading, and the calculated baseline mean (3.30V).

Rudra verified his lab dataset in under a second without installing a single Python package on his laptop.


5. Persistent Memory with Backboard.io

PotatoClaw integrates Backboard.io to maintain assistant context across desktop reboots. When Rudra asks a follow-up question on Tuesday about a linked list bug he worked through on Sunday, Backboard retrieves the relevant historical debug session without storing heavy vector embeddings on his local drive.

To prevent timeout spikes on unreliable hostel Wi-Fi, semantic recall lookups are strictly capped at 500 characters, while session memory updates (capped at 3,500 characters) execute as non-blocking background tasks, keeping the primary HTTP response immediate.


6. ElevenLabs Voice & Groq Whisper

Debugging late at night causes severe screen fatigue. Clicking the audio button in the HUD or pressing Alt+Shift+V streams a natural voice debrief generated by ElevenLabs Turbo v2.5 (George voice) in 295 milliseconds. Rudra can lean back, close his eyes, and listen to Gemma 4 explain the pointer bug without staring at dense terminal text.

For hands-free queries, audio captured from the laptop microphone is compressed into a compact mono WAV buffer and sent to Groq Whisper Large V3 Turbo, transcribing spoken queries in approximately 80 milliseconds.


7. Render Cloud Backend & Access Code Gatekeeper

The cloud service runs inside a multi-stage Docker container deployed on Render via render.yaml.

To prevent unauthorized consumption of our API keys while keeping the cloud backend accessible for Rudra, we implemented an X-Access-Code security gatekeeper in FastAPI. The client stores a 6-digit numeric PIN in the in-HUD Settings panel and attaches it to every request header. Public probes to /health remain open for zero-downtime healthcheck monitoring.


8. Sentry Telemetry & Automated Verification

Every network call, memory trim duration, and model inference span is instrumented via Sentry. Sentry breadcrumbs track the exact number of megabytes reclaimed during each Win32 sweep, giving us live telemetry on application health.

Our automated pytest test suite verifies all cloud integrations, document parsers, security headers, and TabPFN anomaly routines. All 27 tests pass cleanly across both mock fixtures and live API calls:

============================= 27 passed in 166.65s =============================
tests/test_access_code.py ................ [PASSED]
tests/test_backboard_memory.py ........... [PASSED]
tests/test_document_ingestion.py ......... [PASSED]
tests/test_elevenlabs_voice.py ........... [PASSED]
tests/test_gemma_brain.py ................ [PASSED]
tests/test_groq_stt.py ................... [PASSED]
tests/test_network_integration.py ........ [PASSED]
tests/test_sentry_telemetry.py ........... [PASSED]
tests/test_tabpfn_engine.py .............. [PASSED]
Enter fullscreen mode Exit fullscreen mode

Why Does Open Innovation Matter?

When building tools for students, price is not an afterthought. If an AI coding assistant requires a $20 monthly subscription, an Indian college student with a ₹1,000 monthly food allowance cannot use it.

At the same time, entry-level 8 GB laptops cannot run frontier models locally without triggering disastrous pagefile thrashing. Open-weight models like Gemma 4, coupled with free developer cloud tiers, level the playing field. A student working on a second-hand Ryzen 3 laptop gets access to the exact same reasoning capabilities as an engineer on an expensive M3 Max workstation.

Every service powering PotatoClaw operates within permanent free developer tiers:

Component Platform / Technology Tier Monthly Cost
Desktop Client Native Rust / Tauri v2 Open Source (MIT) ₹0.00
Reasoning & Vision Google DeepMind Gemma 4 Google AI Studio Free Tier ₹0.00
Tabular Anomaly Engine Prior Labs TabPFN 3.5 Developer Free Tier ₹0.00
Persistent Memory Backboard.io Developer Free Tier ₹0.00
Voice Transcription Groq Whisper Large V3 Turbo Free Developer Tier ₹0.00
Spoken Audio Synthesis ElevenLabs Free Tier (10,000 chars/mo) ₹0.00
Cloud Service Hosting Render Free Tier Web Service ₹0.00
Telemetry & Monitoring Sentry Developer Free Tier ₹0.00
Total Monthly Cost ₹0.00 / $0.00

No credit cards required. No trial expiration dates.


My Agent Session

PotatoClaw was built over one weekend using agentic pair programming:

  • The native Win32 K32EmptyWorkingSet memory shield logic and process exclusion filters were designed and validated in Rust.
  • The containerized FastAPI service on Render, including the TabPFN anomaly regression pipeline and two-pass Gemma 4 verification prompt, were tested and deployed with automated health monitoring.
  • The complete 27-case pytest test suite was authored to verify end-to-end reliability before the release binary was compiled.

The Hand-over

On Friday evening, after our backend test suite passed and the Tauri release binary compiled cleanly, I copied potatoclaw.exe onto a USB drive and walked over to Rudra's room.

We fired up his buggy C linked list code in VS Code, opened twelve Chrome tabs, and brought up the 40-page lab PDF until Task Manager hit 91% RAM. His cooling fan started whining right away.

He clicked the PotatoClaw pill.

In Task Manager, the memory graph plummeted from 91% down to 51% in a quarter of a second. The cooling fan wound down immediately. He tapped Alt+Shift+2, dragged the crosshairs over his compiler error, and Gemma 4 delivered the corrected struct pointer syntax with working C code in under a second.

Rudra leaned back in his plastic chair, scrolled his code editor with zero lag, and looked at me:

"Bhai... yeh kal lab exam mein pakka chalega na?" ("Bro... are you sure this is going to work tomorrow during the lab exam?")

I smiled: "Haan bhai. Bilkul chalega." ("Yes bro. Absolutely.")

He saved his file, uploaded his lab submission to the college portal, and closed his laptop lid.


Prize Categories

Google DeepMind (Gemma), Render, Prior Labs (TabPFN), Backboard, ElevenLabs, Sentry.

Top comments (0)