---
title: Your First Reverse Engineering Investigation — REA
url: https://rea.tools/first-investigation/
---

[Home](https://rea.tools/) / Your first investigation

# Find out where exported notes go.

Use REA to inspect a small app, follow its Export notes button and
check one detail yourself.

A supplied example · Node.js and npm ·
Your coding agent

## 1. Connect your agent to REA

Use a coding agent such as Claude Code, Codex or Cursor. You’ll
need Node.js and npm; the
[setup guide lists supported versions](https://rea.tools/get-started/).

Your coding agent

Install REA and connect it to this coding agent using
npx rea-agents@latest setup. Show
me the setup plan for approval, then verify the
installation.

Or run this command in your terminal:

`npx rea-agents@latest setup`

Review the plan, approve the setup, then restart your agent.
Already connected? Continue below.

## 2. Ask where the CSV is written

The example is a six-file Electron app with an
**Export notes** button. Your agent can inspect its
code without installing or launching Electron.

Your coding agent

Download
https://rea.tools/examples/notes-example.zip
into a new example folder and unpack it. Use REA to find what
happens when I click Export notes. Show where
notes.csv is written, which fields
it contains, and the relevant files and lines.

Your agent downloads the files and gives the unpacked folder to
REA for inspection.

[Download example ZIP](https://rea.tools/examples/notes-example.zip)

If your agent can’t download files, unzip this archive yourself.
Give it the path to the `notes-example` folder and the
same export question.

## 3. Follow the answer back to the code

Look for a short explanation with file and line references:

> The button sends a `notes:export` message. The main
> process formats the notes as CSV and writes
> `notes.csv` in the user’s Downloads folder. The
> columns are `id` and `title`.

From the button to the file writer

1. Page · renderer.js

   Export notes

   Calls `notes.exportCsv()`.
2. Bridge · preload.js

   `notes:export`

   Sends a named message to the main process.
3. Handler · main.js

   Write notes.csv

   Calls the formatter in `csv.js` and writes the
   file.

REA’s static analysis pairs the message with its handler. The
destination is read from code.

main.js · lines 8–12[Source](https://rea.tools/examples/notes-electron/main.js)

```
ipcMain.handle("notes:export", () => {
  const destination = path.join(app.getPath("downloads"), "notes.csv");
  writeFileSync(destination, toCsv(notes), "utf8");
  return destination;
});
```

The file path, formatter and write call are together in this
handler. Ask your agent to show these lines if its answer leaves
them out.

[See the full code trace and recorded REA result](https://rea.tools/guides/javascript/#follow).

## 4. Check a prediction

A comma separates CSV columns. What happens when a note title
itself contains a comma or quotation marks?

Your coding agent

Predict the CSV for a note with id 1 and title
Hello, "REA". Then run the
example’s toCsv formatter with
Node.js to check it. Show the
prediction and actual output.

Expected formatter output

```
id,title
1,"Hello, ""REA"""
```

The title stays in one quoted field; each quotation mark is
doubled. This checks the formatter directly with
Node.js.

Run the check yourself

Open a terminal in the unpacked
`notes-example` folder:

macOS / Linux · Bash / Zsh

```
node <<'JS'
const { toCsv } = require('./csv.js');
process.stdout.write(toCsv([{ id: 1, title: 'Hello, "REA"' }]));
JS
```

Windows · PowerShell

```
@'
const { toCsv } = require('./csv.js');
process.stdout.write(toCsv([{ id: 1, title: 'Hello, "REA"' }]));
'@ | node
```

## 5. Ask another question

Try a follow-up in the same conversation:

> What happens if the file can’t be written? Follow the error back
> to the page.

Or give your agent an app of your own and ask about one button,
file or behavior.

- [How Notion copies text and HTML](https://rea.tools/showcase/notion/)Follow a clipboard feature in a packaged Electron app.
- [How DX-Ball calculates sound panning](https://rea.tools/showcase/dx-ball/)Read the original instructions and the reconstruction’s
  checks.
- [Troubleshoot setup or analysis](https://rea.tools/faq/#troubleshooting)Update REA and check the connection if you get stuck.
