Set up a Claude Code routine
A flag can start one of your Claude Code routines
each time it is added to a note. Use it to hand a ticket to Claude: add a
task/claude flag, and your routine reads the note, does the work, and
comments back with the result.
Jade Note sends only the note ID and title and the flag’s ID, name, and purpose. It never sends the note body. The routine reads the note through the Jade Note connector, so your connector permissions and Hidden from MCP categories still apply.
Setup takes about five minutes. You move between Jade Note and claude.ai once: copy a prompt from Jade Note, create the routine at claude.ai, and paste two values back.
Before you start
- Jade Note Pro or a Trial. Flag webhooks and routines pause on other plans.
- A Claude plan with Claude Code on the web. Each run uses your Claude plan’s usage, not Jade Note’s.
- The Jade Note connector added at claude.ai (Settings → Connectors) and signed in.
- For code work, the Claude GitHub app installed on the repository the routine uses.
You do not need to create the flag first. You can connect the routine while creating the flag, or add it to an existing flag later.
Step 1. Copy the starter prompt
- In Jade Note, open Flags.
- Choose Create flag for a new flag, or Edit flag on an existing one.
- Expand Webhook & Email and find Claude Code routine.
- Choose Copy starter prompt.
The starter prompt is the same for every flag. It reads the flag from the request Jade Note sends, so you can paste it before the flag exists and reuse one routine for several flags.
Step 2. Describe the work
Paste the prompt into a text editor or straight into the routine in step 3, and replace the text in angle brackets under step 4 with what the routine should do. For example:
- “Implement the change described in the note in this repository, run the related tests, and open a pull request. Never push to or merge into the default branch.”
- “Research the question in the note and summarize the findings with sources.”
- “Draft a reply to the customer email quoted in the note. Do not send it.”
Keep the other steps as they are. They make sure each note is processed once and that note text is treated as a task description, not as instructions.
Step 3. Create the routine at claude.ai
Open claude.ai/code/routines and create a routine:
- Paste the prompt from step 2.
- Add the Jade Note connector. Limiting it to the tools the prompt needs, such as
get_notes,remove_note_flag, andadd_note_comment, is safer. - If the routine works on code, choose the repository and environment.
- Add an API trigger and save the routine.
- Copy the fire URL and the API token. The token is shown only once, when you save, so copy it before closing the dialog.
The fire URL looks like
https://api.anthropic.com/v1/claude_code/routines/trig_.../fire, and the
token starts with sk-ant-oat01-.
Step 4. Paste the fire URL and token into Jade Note
Back in the Jade Note flag dialog, paste the values into Fire URL and API token under Claude Code routine.
- New flag: choose Create flag. The flag and the routine connection are saved together. If either value is invalid, nothing is created and you can fix it.
- Existing flag: choose Connect. The connection is saved right away.
Saving never starts the routine. The token is encrypted at rest and is never shown again, in the app or in MCP responses.
Step 5. Try it
- Add the flag to a test note, from the app or from an AI agent connected through MCP.
- Within about a minute the routine starts once for that note. The starter prompt first removes the flag to claim the note.
- Open Edit flag and check Recent deliveries. The delivery should say Sent. Open the routine at claude.ai to watch the run.
- When the run finishes, the routine comments on the note with the result.
To run it again on the same note, add the flag again.
When the routine does not start
Jade Note does not start the routine when:
- the note is archived or deleted,
- the note is in a category hidden from MCP,
- the flag was removed before Jade Note sent the request, or
- Start the routine when this flag is added is cleared.
Recent deliveries in Edit flag lists the last 10 deliveries for the flag, for every channel, with their status:
| Status | Meaning |
|---|---|
| Sent | The routine accepted the request and started a run. Open the routine to see it. |
| Sending | Jade Note is sending or will retry shortly. |
| Skipped | Nothing was sent, for one of the reasons above or because your plan does not include webhooks. |
| No response | Jade Note sent the request but never got an answer. Check the routine’s runs before adding the flag again. |
| Failed | The request was rejected. Jade Note also emails you. |
Jade Note retries connection failures, rate limits (HTTP 429), and temporary server errors (500 and 503) up to three times. It never resends after a request may have reached Claude, because each request can start a new run.
Common failures:
- 401: the token is wrong or was regenerated. Generate a new token for the routine and choose Replace connection.
- 400: the routine is paused or the request was rejected. Check that the routine is enabled.
- 403: your Claude account cannot use routines. Check your Claude plan.
- 404: the routine was deleted. Connect a new one.
If the run starts but stops without doing anything, check that the Jade Note connector is added to the routine and signed in, and that the note is not in a category hidden from MCP.
Use one routine for several flags
Because the starter prompt reads the flag from the request, you can connect the same fire URL and token to more than one flag. Each flag then starts the same routine. Claude’s per-routine limit is shared across those flags.
Limits and safety
- Claude limits each routine to 30 runs an hour and each account to 100. Adding and removing a flag repeatedly uses your Claude usage.
- Anyone who can add the flag can start the routine, including AI agents connected to your workspace. Keep the routine’s work reviewable, for example by opening pull requests instead of pushing directly.
- The starter prompt tells Claude to treat note text as a task description, not as instructions. Keep that line when you edit the prompt.
- To stop, clear Start the routine when this flag is added. The saved connection stays. To revoke access completely, delete the token in the routine’s settings.