Edit Your Story With Claude Code
Edit With AI

Edit Your Story With Claude Code

Four steps from a paid Claude plan to an AI that builds your story’s lore and triggers.

Updated

Claude Code is the part of the Claude desktop app that works with files on your computer. With your Mana API token in a folder, it can read your story, write new lore and triggers, and upload them to Mana for you to check. You need a paid Claude plan (Pro, Max, Team or Enterprise); the free plan doesn’t include Claude Code.

Have ChatGPT instead? Follow the Codex guide. Not sure what this is? Start with the overview.

Step 1: Install Claude

Once per computer. No terminal needed.

  1. Download and install the appGo to claude.com/download and download Claude for Windows or macOS (on Windows it’s also in the Microsoft Store). Windows: open the downloaded file. Mac: open it and drag Claude into Applications.
  2. Sign inOpen Claude and sign in with the account that has your paid Claude plan.
  3. Open the Code tabClick Code at the top of the left sidebar (if you only see icons, hover over them to find it). If Claude asks you to upgrade, that account isn’t on a paid plan.
Claude
Chat
Code
Sessions
New
What should we build?
Describe a task or ask a question
LocalSelect folderManual
The Code tab of the Claude desktop app (illustration: your version may look slightly different).

Step 2: Make a Story Folder

Your token file goes in, and Claude works in there.

  1. Open your story in ManaA new story: click New Story in Mana’s left menu. That page, where Mimi helps you write, is the Story Assistant. Before you can get a token, the story needs a description, a starting prompt, at least one character with art and one background: describe your idea to Mimi and she drafts them, or fill in the tabs yourself. A story you already made: open Your Stories, find it under Templates and click Edit.
  2. Click API TokenYour browser downloads a small text file named after your story, like “The Lantern Road_mana_api_token.txt”. A new story is saved as a private template at this moment, so nobody else can see it.
The Story Assistant for the story The Lantern Road, with the purple API Token button in the header highlighted.
The API Token button sits in the Story Assistant’s header, next to the model picker.
The API token downloaded pop-up: the file name, a Copy Link button for the instructions page, a warning not to share the file, and a link to this guide.
(1) The token file your browser just downloaded. (2) The instructions link. It’s also in the first message you send the AI, so you rarely need Copy Link.
The token works like a password for this one story: anyone who has the file can change its setup, triggers and media. Pasting it into your own Claude Code or Codex, as this guide shows, is fine. Don’t post it or send it to anyone else. If it leaks, click API Token again and confirm Generate new token: the old token stops working at once.
  1. Make a folder for the storyIn File Explorer (Finder on a Mac), open Documents and create a new folder named after your story, like “The Lantern Road”. Drag the token file from Downloads into it. Use one folder per story.
The Lantern Road
DocumentsThe Lantern Road
NameType
The Lantern Road_mana_api_token.txtText Document
One folder per story. Move the token file in from your Downloads folder.
  1. Open the folder in ClaudeIn the Code tab, click + New. Under the message box, set the first menu to Local (not Cloud: a cloud session can’t see your computer’s folders). Click the folder menu, choose Open folder…, and pick your story folder. Then set the mode menu to Accept edits: Claude changes files in the folder without asking each time, but still asks before it runs commands, including every one that connects to Mana. Auto (if your menu has it) asks less often, but it may block the steps that save or send your token; if it does, switch back to Accept edits. Never use Bypass permissions.
Claude
Chat
Code
Sessions
New
What should we build?
Describe a task or ask a question
LocalThe Lantern RoadAccept edits
Ready to go: Local, your story folder, and Accept edits.

Step 3: Ask Claude for Changes

Send one message, then say what you want.

  1. Paste this messageWith the token file in your story folder, start things off with this message. Click Copy, then paste it into Claude’s message box. You don’t need to open the token file: the AI finds it in the folder.
First message

Read the instructions here https://mana.land/apis/v1/game-engine/instructions , my API token is already in this folder.

  1. Add what you wantRight after it, in the same message, describe the change in your own words, then press Enter. Need ideas? See What to Ask For below.
  2. Approve the Mana commandsClaude first downloads Mana’s guides, then reads your story and uploads the changes. Each time it wants to run a command, it stops and asks. Commands that talk to Mana contain mana.land: allow them. It may also ask to run commands that only read or convert files in your story folder (they mention mana/ or mana-docs/): allow those too. Say no to anything that sends data to a website other than mana.land. If you see an option to always allow a mana.land command, take it so Claude asks less often.
Claude — The Lantern Road
Chat
Code
Sessions
New
Lantern lore + /parcels

Read the instructions here https://mana.land/apis/v1/game-engine/instructions , my API token is already in this folder.

Add two lorebook entries: how the enchanted lanterns work, and the courier rules. Then add a /parcels command that shows how many parcels I have delivered, and count one every time I hand a parcel to its recipient.

I found your token file. I’ll start by downloading Mana’s three guides into mana-docs/ and reading them.

Allow this command?
curl -sSL https://mana.land/apis/v1/game-engine/instructions/api.md -o mana-docs/01-api.md
AllowAlways allowDeny
Reply to Claude
LocalThe Lantern RoadAccept edits
Claude asks before it connects to Mana (illustration: the buttons may be named slightly differently).

Reading the guides takes a few minutes the first time. If Claude asks you a question along the way (which character to change, or what to do when you edited the same thing in Mana), type your answer in the message box and press Enter. When it’s done, it lists what it changed and what you should check:

Claude — The Lantern Road
Chat
Code
Sessions
New
Lantern lore + /parcels
ReadThe Lantern Road_mana_api_token.txt
Rancurl -sSL https://mana.land/apis/v1/game-engine/instructions
Rancurl … /instructions/api.md -o mana-docs/01-api.md (and 2 more guides)
Rancurl … /template/setup -o mana/orig/setup.response.json
Editedmana/story-setup.json+24-1
Editedmana/triggers.json+61-3
Rancurl -X POST … /template/triggers/validate
Rancurl -X PUT … /template/setup and /template/triggers

Done. Both changes are staged in Mana, not saved yet:

  • Lorebook: added “Enchanted Lanterns” and “Courier Rules”.
  • Triggers: a new Deliveries folder with /parcels, a delivery check after every turn, and “Parcel delivered”, which adds 1 to parcels_delivered.

Open The Lantern Road in the Story Assistant, check the tabs marked Updated, then press Finalize → Save Changes. Start a new play to test /parcels.

Reply to Claude
LocalThe Lantern RoadAccept edits
The finished request: commands Claude ran, files it edited, and its summary.
Next time, start a new session in Claude’s Code tab, pick the same folder in the folder menu, and send the same first message with your new request after it. You don’t need a new token unless you generated a new one with API Token.

What to Ask For

Write what you want the way you’d explain it to a friend. The AI reads Mana’s guides, so you don’t need to know how triggers or the story setup work. Some ideas:

Lore“Add three lorebook entries about the river city of Vellmoor: its districts, its ferries and its guilds.”
Commands“Add a /parcels command that shows how many parcels I have delivered.”
Gold & shop“Start me with 50 gold. Add a /shop command with three lanterns to buy, and take the gold when I buy one.”
Goals“Add an objective list: deliver to the docks, then the forest road, then the castle. Tick each one off when it happens.”
Characters“After I deliver five parcels, make Captain Brann warmer toward me and have him offer me a promotion.”
Images“I put forest-road.webp in this folder. Upload it and show it the first time we reach the forest road.”
Story setup“Rewrite the starting prompt so the story opens at the misty docks at dawn, and add a new background for it.”
Check my work“Read my triggers and explain in plain words what each one does. Don’t change anything.”

Ask for one feature at a time, then check it in Mana. Small requests are easier to review than one huge one.

Not sure how to do something? Ask “How would you build this? Don’t change anything yet.” first.

The AI can change your story’s setup, triggers and media. It can’t save, publish, or change visibility, tags or thumbnails: that’s always your Save in Mana.

Step 4: Review and Save in Mana

Nothing changes for players until you press Save.

The AI’s changes are staged: Mana holds them for this story, but they aren’t saved and players don’t see them yet. Keep the story open in the Story Assistant in a browser tab you can see. The page picks up each change within a few seconds, marks the changed tabs Updated, and Mimi posts a note in the chat.

The Story Assistant after an API update: the Lorebook tab is marked Updated and Mimi says the story setup was updated through the API.
(1) The AI changed the Lorebook, so it’s marked Updated (tabs Mimi changed earlier stay marked too). (2) Mimi names the tabs that came in through the API.

Open each Updated tab and read what changed. Here, the two new lorebook entries are in the Lorebook tab:

The Lorebook tab with the two new entries, Enchanted Lanterns and Courier Rules, and their trigger words.

Trigger changes show up in the Mana Game Engine tab. Click Edit Triggers to look through them in the trigger editor, and change anything by hand there.

The Mana Game Engine tab, switched to Enabled, showing 3 triggers configured and an Edit Triggers button.
The trigger editor with a banner saying the triggers were updated from the API, showing the Parcel delivered trigger that sets parcels_delivered to itself plus one.
For a story opened from Your Stories, the trigger editor also marks the AI’s changes with a banner. If you have unsaved edits of your own there, it asks first: Load update takes the AI’s version, Keep mine keeps yours.

Happy with it? Open Finalize and press Save Changes. That’s the moment the changes become part of your story. (If you changed triggers by hand in the trigger editor, press Save there first.) Don’t want a change? Change it back by hand or ask the AI to undo it before you save: the page keeps the AI’s version until you do, and your next Save would include it.

The Finalize tab with visibility set to Private, Update Template selected and the Save Changes button highlighted.
To test, start a new play of the story after saving (a play-through keeps the version it started with). Type /triggers in the game chat to see your variables and which triggers ran.

Do I need Git, Node.js or the terminal?

No. The Claude desktop app includes everything Claude Code needs. On Windows, installing Git for Windows is optional: Claude then runs its commands in Bash instead of PowerShell.

Claude says it can’t find my token file.

Check the menus under the message box: the first one must say Local (not Cloud), and the folder menu must show your story folder. Start a new session after changing them.

Can I use Claude Code in the terminal instead?

Yes. On Windows, open PowerShell and run irm https://claude.ai/install.ps1 | iex. On a Mac, open Terminal and run curl -fsSL https://claude.ai/install.sh | bash. When it says Claude Code successfully installed!, open a new PowerShell or Terminal window, go to your story folder (cd), type claude, sign in, and answer “Yes, I trust this folder”. Press Shift+Tab until it shows “accept edits on”. Everything else in this guide stays the same.

Claude stopped and says I reached my usage limit.

Claude Code shares your plan’s usage limits with Claude chat. Wait for the limit to reset, or use a smaller request. The Max plan has higher limits than Pro.

Do I need to know how to code?

No. You describe what you want in plain words. The AI reads Mana’s guides, writes the changes and uploads them. You review and save them in Mana like any other edit.

My changes don’t show up in Mana. What now?

Open the story in the Story Assistant and keep that browser tab visible: the page only picks up changes while you can see it, and it catches up within a few seconds when you switch back to it. A trigger editor you opened with Edit Triggers on a story you’re still creating doesn’t update by itself: close it and click Edit Triggers again. The older story edit form doesn’t show AI changes.

Can the AI break my story?

Nothing reaches players until you press Save in Mana, so you can always look first. If a change is wrong, change it back by hand or ask the AI to undo it before you save: the page keeps the AI’s version even if you don’t save, so your next Save would include it. Let the AI finish before you edit by hand, because an upload replaces the story setup on the page.

I clicked API Token again. Do I need to do anything?

Only if you confirmed Generate new token. That makes a new token, and the old one stops working: put the new file in your story folder (you can delete the old one) and tell the AI to use the new token file. If you pressed Cancel, nothing changed.

Does this cost Mana coins?

No. The AI runs on your own Claude or ChatGPT plan, so its work counts toward that plan’s usage limits. Mana doesn’t charge coins for reading or uploading with your token. Big requests use more of your plan’s limits than small ones.

Edit Your Mana Story With Claude Code | Mana