02 / Beginner tutorial / 8 min read
How to use REA: follow an app’s Export button
You click “Export notes”, but where does the CSV file go? Use REA to follow the button through a small Electron app, then test the code that formats the file.
Last verified: November 2, 2026 · REA version 6.8.0
On this page
Before you start
Not connected yet? Install REA and verify the connection →
Choose Claude Code, Codex or Cursor, finish setup, restart the client and verify that it can call REA.
REA connected? Start here.
Download and extract the kit, open notes-example in your coding agent, then send the analysis prompt.
1. Get the practice kit · 2. Copy the analysis prompt · 3. Check the result
How a REA investigation works
- Connect REA. Install it, restart your client, and verify a tool call.
- Choose a target. Open the extracted notes-example folder in your coding agent.
- Ask one question. Find where Export notes saves the CSV file.
- Read the evidence. Follow the cited files and lines; separate observed code from assumptions.
- Verify the result. Run the included CSV checks for commas, quotation marks and empty input.
01. Choose one question
“Explain this app” is a large request. Start with a behavior you can name and an answer you can check:
When I click Export notes, where does the CSV file go, and what happens if a note title contains commas or quotation marks?We use the official REA Notes example: six small files representing an Electron app. This is a teaching sample, not a production application. Its static analysis needs no Electron installation.
02. Get the sample
Start with the practice kit
The kit includes the official six-file sample, a ready-to-run CSV check, expected output and instructions in eight languages. Extract it, open the notes-example folder in your coding agent, and copy the analysis prompt below. No npm install or Electron launch is needed.
Open a terminal in the extracted folder and run the check:
node check.cjsA successful run ends with PASS: 3 CSV checks. It checks commas, quotation marks, empty input and a multiline title. This tests the CSV formatter; it does not click the app’s export button.
Find your folder on Windows
In File Explorer, extract the ZIP first, open the notes-example folder, then right-click and open a terminal there. In PowerShell, the following prints the full path. Keep spaces inside quotes when using that path in a command.
(Get-Location).PathIf you only want the upstream sample, Download notes-example.zip from rea.tools and extract it into a new folder. Keep the folder path handy. You should see:
notes-example/
package.json
index.html
renderer.js
preload.js
main.js
csv.jsIf REA is not connected yet, follow the installation guide. This sample can be inspected without launching a desktop window.
03. Ask your agent to inspect it
Open the extracted notes-example folder in your coding agent before sending this prompt. If the agent is working elsewhere, give it the full folder path.
Use REA to statically inspect the notes-example folder open in this workspace. Trace the Export notes button through the renderer, preload bridge and main process. Show the output file path, CSV columns, and the files and lines that support your answer. Do not launch Electron. Separate observed code from assumptions.You can also collect REA’s static evidence directly from the terminal:
npx -y rea-agents@6.8.0 analyze-javascript-application "/absolute/path/to/notes-example" --json > notes-analysis.jsonIn Windows PowerShell, use this command from inside the extracted notes-example folder:
npx.cmd -y rea-agents@6.8.0 analyze-javascript-application . --json > notes-analysis.jsonThe command pins rea-agents 6.8.0, the npm release these pages document. The JSON is analysis evidence, not a natural-language explanation. The local static analysis recorded below was run with REA 6.4.0 on October 12, 2026, and was not repeated on 6.8.0.
Since REA 6.5.0, repeated --source-path analyzes only those exact application-relative files. Imports are not added automatically. REA 6.8.0 also accepts --source-paths-json as an inline JSON array or a JSON file. This sample is small, so the command above still analyzes the whole folder. Unselected files would remain in the inventory with unknown relationships.
04. Follow the export path
The answer: the app is written to save notes.csv in the operating system’s Downloads folder. The setting is in main.js. Here is how the button reaches that code.
In Electron, the page and the main app run separately. Preload exposes a method the page can call. IPC is the message that carries the request to the main app, which can write the file.
| Location | What the code does |
|---|---|
renderer.js | The click handler calls window.notes.exportCsv(). |
preload.js | The exposed method invokes the notes:export IPC channel. |
main.js | The matching handler builds a Downloads path and writes notes.csv. |
csv.js | The formatter writes id,title, quotes each title and doubles embedded quotes. |
The code uses Electron’s app.getPath("downloads"). That establishes the intended destination; it does not prove a file was actually written on your machine. This walkthrough checks the formatter directly below.
05. Check a prediction
Give the formatter a note whose title is Hello, "REA". The predicted CSV row is:
id,title
1,"Hello, ""REA"""The kit already includes check.cjs. If you downloaded only the upstream sample, save the following as check.cjs in the notes-example folder:
const assert = require("node:assert/strict");
const { toCsv } = require("./csv.js");
const actual = toCsv([{ id: 1, title: 'Hello, "REA"' }]);
const expected = 'id,title\n1,"Hello, ""REA"""\n';
assert.equal(actual, expected);
console.log(actual);
console.log("PASS: comma and quotes stay in one field.");node check.cjsVerified locally on October 12, 2026, with REA 6.4.0. The formatter check output matched that static analysis. We did not launch the Electron UI or test filesystem permissions through its export button. That run was not repeated on REA 6.8.0.
If the check fails
If Node cannot find check.cjs or csv.js, make sure you extracted the whole kit and opened the notes-example folder. If an assertion fails, compare the output with expected.csv and start again with a fresh extraction before changing any code.
06. Continue with a sharper question
Now try a follow-up that tests the explanation rather than asking for more general description:
If writing notes.csv fails, how would that error travel back to the page? Trace the error handling in the supplied files. Identify any missing handler, but do not modify the app.Keep three things in every report: the finding, its source location, and what you actually tested. This makes it easier to catch a plausible explanation that goes beyond the evidence.
Next / Real package exampleFind why a generated URL still contains “!”.Sample and workflow: REA’s official first investigation. This page is an independent walkthrough, with an additional local analysis and formatter check. Download the analysis summary.
New to the tool? What is REA? · How we check our guides