Anchor is built around one split: a coding agent writes the cards, and the app only quizzes you. The cards are Markdown files in your own GitHub repository, and the agent reads and writes them with that repository as its working directory.
This chapter walks through the flow with Claude Code and Codex, two agents many people use. Both are other companies’ products; Anchor is an independent personal project with no connection to them. Any agent that can read and write a repository and commit works the same way.
Either way: put the templates at the repository root
At the root of your card repository, put AGENTS.md and CLAUDE.md from templates/ in the public format repository.
| File | What it holds |
|---|---|
AGENTS.md | An instruction to read the specification (SPEC.md) before writing any card, and what never to do (change an id, delete a card, write under data/). It repeats none of the format itself |
CLAUDE.md | For Claude Code. It pulls in AGENTS.md and is where you write the lint command |
SPEC.md is the only place the format is written down. The templates only point at it, so they do not need updating when the spec changes — and the next agent that enters the repository reads the spec again first.
The shortest first step is to give your agent the one line on the Anchor page. It reads https://www.ura-logi.com/anchor/start.txt (instructions written for AI agents), creates the repository, puts the templates in place, writes and lints the cards, and commits them.
For Claude Code there is also a plugin in the public format repository (the card-writing procedure, and a lint right after each write). How to install it is in the repository’s README. The templates alone are enough.
Claude Code + the Mac app: tell the agent which card is on screen
The Mac app (0.1.28 or later) has an AI agent link section in Settings. It is off by default, and it is not in the web app.
- Settings → AI agent link → turn on Write the current card to a local file
- Pick When the agent builds a summary page (see the table below)
- Open Claude Code with your card repository as the working directory
- Press Copy the start prompt and paste it into the Claude Code session
- Review in Anchor as usual
With it on, each time a card is shown, flipped or graded, Anchor writes the card’s ID, title, file path, your grade and when to build a summary to ~/.anchor/now.json. It does not write the card’s text. The file is written only on this Mac and never sent anywhere; turning the setting off deletes it.
The start prompt contains a command that watches this file and what to ask of the agent, so there is no skill or hook to install. Once pasted, the agent works like this:
- When the chosen moment comes, it reads that card’s file and returns a one-page summary: the question, the answer, the outline in the order to recall it, the definitions it uses, memory hooks and pitfalls, and related cards. It overwrites the same page each time
- When you ask about “this” or “this card”, it takes that to mean the card on screen, reads its file and answers, adding the Q&A to the summary
| When the agent builds a summary page | When |
|---|---|
| When a card is shown | As you move to the next card. The summary is ready while you are still recalling, so the prompt asks for anything that gives the answer away to be collapsed |
| Every time you flip a card (default) | When you reveal the answer |
| Only when you grade “Again” | Only for cards you forgot |
| Never | No summary; it only answers your questions |
Anchor only writes “which card” and “when you would like a summary”. Whether and how to build one is up to the agent reading the file. The point of the link is that you no longer copy a card’s ID across.
Codex: write cards in the repository, fix them through pull requests
With an agent like Codex that works in a GitHub repository and opens pull requests, the exchange goes through pull requests.
- In your card repository, have it write cards on what you want to learn, lint them and commit
- While reviewing, when an explanation looks wrong, copy the card’s ID in the app and give it to the agent
- The agent fixes that card and opens a pull request
- In Anchor’s Changes tab, read the
.mdfiles in that pull request, rendered as cards (Changes) - If it reads right, merge it on GitHub. The next sync brings it down
The Changes tab needs Anchor to have Pull requests: read-only on GitHub (getting started).
If the agent cannot read the specification, do not let it write cards. Codex CLI may start without network access in its default setup. Then it cannot fetch the spec and writes cards from memory instead. The instructions (start.txt) tell the agent to stop and ask you when it cannot read the spec; when it does, allow network access for that session, or download SPEC.md and put it in the repository.
The same flow works with Claude Code. You can also have the agent commit directly instead, but with a pull request you get to read the fixed card in the Changes tab before it goes in.
Related
- Having your cards written: writing good cards, and the lint-and-fix loop
- Card format: the format in brief (SPEC.md is the source of truth)
- Changes: the screen that reads cards inside a pull request