Creates and manages Anki flashcards via the AnkiConnect API. Guides setup of Anki desktop and AnkiConnect add-on, then provides curl-based workflows for adding, searching, updating, and managing cards and decks.
Ships in anki-flashcards. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Create, search, update, and manage Anki flashcards programmatically via the AnkiConnect HTTP API on localhost:8765. All operations use curl with JSON payloads — no SDK or library required.
Before using this skill, the user must have the following set up. Do not attempt to install these — guide the user through the steps.
Anki must be installed and running. Download from https://apps.ankiweb.net/
Install the AnkiConnect add-on inside Anki:
2055492159macOS — Disable App Nap to prevent Anki from being suspended in the background:
defaults write net.ankiweb.dtop NSAppSleepDisabled -bool true
defaults write net.ichi2.anki NSAppSleepDisabled -bool true
defaults write org.qt-project.Qt.QtWebEngineCore NSAppSleepDisabled -bool true
Windows — Allow Anki through Windows Firewall if connections to localhost:8765 are blocked.
curl -s localhost:8765 -X POST -d '{"action": "requestPermission", "version": 6}'
Expected response includes "permission": "granted". If the connection is refused, Anki is not running or AnkiConnect is not installed.
Always verify AnkiConnect is reachable before performing any operations:
curl -s localhost:8765 -X POST -d '{"action": "requestPermission", "version": 6}'
If this fails, tell the user to:
All requests use HTTP POST to localhost:8765 with this JSON structure:
{"action": "actionName", "version": 6, "params": {...}}
Responses return: {"result": <value>, "error": <null or string>}
Single card (Basic model):
curl -s localhost:8765 -X POST -d '{
"action": "addNote",
"version": 6,
"params": {
"note": {
"deckName": "Spanish Vocabulary",
"modelName": "Basic",
"fields": {"Front": "casa", "Back": "house"},
"tags": ["spanish", "beginner"]
}
}
}'
Batch create multiple cards:
curl -s localhost:8765 -X POST -d '{
"action": "addNotes",
"version": 6,
"params": {
"notes": [
{
"deckName": "Biology",
"modelName": "Basic",
"fields": {"Front": "What is mitosis?", "Back": "Cell division producing two identical daughter cells"},
"tags": ["biology", "cell-division"]
},
{
"deckName": "Biology",
"modelName": "Basic",
"fields": {"Front": "What is meiosis?", "Back": "Cell division producing four genetically diverse gametes"},
"tags": ["biology", "cell-division"]
}
]
}
}'
Cloze deletion card:
curl -s localhost:8765 -X POST -d '{
"action": "addNote",
"version": 6,
"params": {
"note": {
"deckName": "Programming",
"modelName": "Cloze",
"fields": {"Text": "In Python, {{c1::list comprehensions}} create lists from {{c2::iterables}} using a concise syntax."},
"tags": ["python", "syntax"]
}
}
}'
Card with media (image or audio):
curl -s localhost:8765 -X POST -d '{
"action": "addNote",
"version": 6,
"params": {
"note": {
"deckName": "Geography",
"modelName": "Basic",
"fields": {"Front": "Identify this country", "Back": "Japan"},
"tags": ["geography"],
"picture": [{
"url": "https://upload.wikimedia.org/wikipedia/commons/thumb/9/9e/Flag_of_Japan.svg/320px-Flag_of_Japan.svg.png",
"filename": "japan_flag.png",
"fields": ["Front"]
}]
}
}
}'
Search by deck and tag:
curl -s localhost:8765 -X POST -d '{
"action": "findNotes",
"version": 6,
"params": {"query": "deck:Spanish tag:beginner"}
}'
Get full card details from note IDs:
curl -s localhost:8765 -X POST -d '{
"action": "notesInfo",
"version": 6,
"params": {"notes": [1234567890, 1234567891]}
}'
Common search queries:
deck:DeckName — all notes in a decktag:tagname — all notes with a tagis:due — cards due for reviewis:new — cards never reviewedadded:7 — cards added in the last 7 days"front:casa" — search a specific fielddeck:Spanish tag:beginner is:due-: deck:Spanish -tag:advancedUpdate note fields:
curl -s localhost:8765 -X POST -d '{
"action": "updateNote",
"version": 6,
"params": {
"note": {
"id": 1234567890,
"fields": {"Front": "casa (noun)", "Back": "house, home"},
"tags": ["spanish", "beginner", "nouns"]
}
}
}'
Add tags to notes:
curl -s localhost:8765 -X POST -d '{
"action": "addTags",
"version": 6,
"params": {"notes": [1234567890, 1234567891], "tags": "reviewed important"}
}'
Remove tags from notes:
curl -s localhost:8765 -X POST -d '{
"action": "removeTags",
"version": 6,
"params": {"notes": [1234567890], "tags": "beginner"}
}'
Create a deck (supports :: hierarchy):
curl -s localhost:8765 -X POST -d '{
"action": "createDeck",
"version": 6,
"params": {"deck": "Languages::Spanish::Vocabulary"}
}'
List all decks:
curl -s localhost:8765 -X POST -d '{"action": "deckNames", "version": 6}'
Get deck statistics:
curl -s localhost:8765 -X POST -d '{
"action": "getDeckStats",
"version": 6,
"params": {"decks": ["Spanish Vocabulary"]}
}'
Returns new/learning/review counts per deck.
Use the multi action to execute multiple operations in a single request for efficiency:
curl -s localhost:8765 -X POST -d '{
"action": "multi",
"version": 6,
"params": {
"actions": [
{"action": "createDeck", "params": {"deck": "Chemistry"}},
{"action": "addNote", "params": {
"note": {
"deckName": "Chemistry",
"modelName": "Basic",
"fields": {"Front": "What is the atomic number of Carbon?", "Back": "6"},
"tags": ["chemistry", "elements"]
}
}},
{"action": "addNote", "params": {
"note": {
"deckName": "Chemistry",
"modelName": "Basic",
"fields": {"Front": "What is Avogadro'\''s number?", "Back": "6.022 × 10²³"},
"tags": ["chemistry", "constants"]
}
}}
]
}
}'
Use multi when creating a deck and populating it with cards, or when performing several independent operations.
Create a custom model when Basic and Cloze are insufficient:
curl -s localhost:8765 -X POST -d '{
"action": "createModel",
"version": 6,
"params": {
"modelName": "Vocabulary Card",
"inOrderFields": ["Word", "Definition", "Example", "PartOfSpeech"],
"css": ".card { font-family: arial; font-size: 20px; text-align: center; }",
"cardTemplates": [
{
"Name": "Word → Definition",
"Front": "<div class=\"word\">{{Word}}</div><div class=\"pos\">{{PartOfSpeech}}</div>",
"Back": "{{FrontSide}}<hr id=\"answer\"><div class=\"def\">{{Definition}}</div><div class=\"example\"><i>{{Example}}</i></div>"
}
]
}
}'
| Action | Description | Key Params |
|---|---|---|
addNote | Create a single card | note: {deckName, modelName, fields, tags} |
addNotes | Create multiple cards | notes: [{...}, ...] |
findNotes | Search for notes | query (Anki search syntax) |
notesInfo | Get note details | notes: [id, ...] |
updateNote | Update fields/tags | note: {id, fields, tags} |
addTags | Add tags to notes | notes: [id, ...], tags: "tag1 tag2" |
removeTags | Remove tags | notes: [id, ...], tags: "tag1" |
createDeck | Create a deck | deck: "Name" (use :: for hierarchy) |
deckNames | List all decks | (none) |
getDeckStats | Deck review stats | decks: ["Name"] |
deleteDecks | Delete decks | decks: ["Name"], cardsToo: true |
multi | Batch operations | actions: [{action, params}, ...] |
createModel | Custom note type | modelName, inOrderFields, cardTemplates |
storeMediaFile | Upload media | filename, data/url/path |
sync | Trigger AnkiWeb sync | (none) |
spanish::verbs::irregular for organizationFor comprehensive flashcard design principles, see references/card-design.md.
For complete API documentation covering all 100+ AnkiConnect actions, see references/api-reference.md.
For flashcard design principles and evidence-based learning strategies, see references/card-design.md.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/anki-flashcards:anki-flashcardsfrom anki-flashcards
npx claudepluginhub dashed/claude-marketplace --plugin anki-flashcardsOther plugins' skills for the same job