Build an app from Claude Code

Ask Claude Code to create a Studio app with a database, a server route and an API key. You approve the key, and later any change that deletes data, in SeeMyNotes.

Goal: a Studio app that Claude Code creates and builds for you: a guestbook page, a database, and a server route that uses an AI provider with your key. Time: about thirty minutes. Plan: Studio. Before you start: you have Claude Code, and an API key from OpenAI (or another provider you want to call).

1. Create an agent for app work

  1. Open Settings and choose AI agents.

  2. Choose Add an agent and name it "Claude Code, apps".

  3. Set Studio apps to Read and edit. Set Notes to Read and edit too, because the agent makes the note that holds the app. Leave Publish and sell off.

  4. Save the agent.

2. Connect Claude Code

Follow Connect Claude Code: you paste one prompt into Claude Code, then sign in from its /mcp menu and choose the agent you just made. A personal token also works as a last resort.

3. Ask for the app

In Claude Code, send:

Create a Studio app called Guestbook: a page where visitors leave a message, stored in SQLite, with a server route that summarises the last messages using OpenAI. Use the endpoint named openai for the call and OPENAI_API_KEY for the key.

The agent works through these tools, which you can follow in its output:

  1. note_create makes a private note titled "Guestbook". The title becomes the app's address.

  2. app_create creates the app on that note and returns an editor link.

  3. app_data_execute runs CREATE TABLE for the messages. It runs at once: creating a table deletes nothing.

  4. app_operation_set defines the operations: add_message (a write, which is how visitors save a message) and list_messages (a read). The page calls smn.db.run('add_message', ...).

  5. app_version_upload uploads the code: a React page (kind jsx) and server/api.ts with the summary route.

  6. app_secret_request asks for OPENAI_API_KEY, with its purpose.

4. Approve the secret

The agent stops and gives you a link to a page in SeeMyNotes. Open it, signed in. You see "Claude Code, apps" asking to add a secret to Guestbook, the name OPENAI_API_KEY and what it is for. Paste your key in the value field and choose "Save secret". The agent never sees the key, and nobody can read it again. If you change your mind, decline; you can add a note for the agent.

A secret request as you see it in SeeMyNotes (here for another app, Workshop sign-up).

You can also find the waiting request under Settings, AI agents ("Waiting for your approval"), in a notification, and as a banner in the app's editor. It expires after 24 hours.

Back in the terminal the agent checks the request (agent_request_get) and sees it is executed.

5. Add the endpoint for your AI provider

A secret can only be used inside an endpoint's headers, and adding an endpoint stays with you in SeeMyNotes. Open the app note in the editor, open its configuration (Configuration) and add the endpoint as in App configuration: name openai, base URL https://api.openai.com/v1, the POST method, and the header Authorization set to Bearer {{OPENAI_API_KEY}}.

6. Preview it

Open the editor link the agent gave you. It is the note in SeeMyNotes, with the preview, the code and the settings. Leave a message in the preview and try the summary route. While the note is private only you can open the app.

7. Later: a change that deletes data

Ask: "Remove the email column from the messages table of Guestbook." Dropping a column would lose data, so app_data_execute does not run it. The agent gets a waiting answer with a link, and you open that page. It shows what would be lost: the table, the column, how many rows, and whether visitors entered that data, plus the statements. To go ahead, tick "I understand..." and choose "Delete and apply". To keep the data, decline, optionally telling the agent why.

Before an approved change SeeMyNotes keeps the database as it was for 30 days. To get it back, restore it under Database history in the app's settings; see Undo a change to an app's database.

If the database changed after the request (for example more rows would be deleted than shown), the request is stale: nothing is done and the agent sends it again.

If the change would touch a table that visitors write to (for example the messages), the page also shows a box "Uses what visitors entered" naming it, and Claude Code never learns the rows or counts of that table.

Result

A working app that an agent created and built, with its key and any deleting change decided by you.

Next steps

Related pages