Anki Card Manager
Manage Anki flashcards from Claude Code — create, update, delete, and browse. Scripts are bundled in ./scripts/. Full AnkiConnect API reference is in Anki-Connect.md.
Available operations
Create a card
./scripts/create_card.sh \
--deck "CS" \
--front "What guarantee does a WAL provide?" \
--back "Durability — changes are written to a log before being applied, so committed transactions survive crashes." \
--tags "databases,durability"
Create a card with an image on the front
Image is centered with text above it. Use for diagrams, screenshots, visual concepts.
# Local file
./scripts/create_card.sh \
--deck "CS" \
--front "What does this diagram show?" \
--back "B-tree node split" \
--image-path "/path/to/diagram.png" \
--tags "algorithms"
# Remote URL (AnkiConnect downloads it)
./scripts/create_card.sh \
--deck "CS" \
--front "What pattern does this show?" \
--back "CQRS" \
--image-url "https://example.com/cqrs.png" \
--tags "architecture"
Update a card
./scripts/update_card.sh --id NOTE_ID --front "Better question?" --back "Cleaner answer"
./scripts/update_card.sh --id NOTE_ID --tags "algorithms,trees" # retag only
Delete a card
./scripts/delete_card.sh --id NOTE_ID
List cards (check for duplicates before creating)
./scripts/list_cards.sh --query "tag:algorithms added:7"
./scripts/list_cards.sh --deck "CS" --tag "algorithms"
List decks (discover deck names)
./scripts/anki_connect.sh
Card quality rules
Quality over quantity. Bad cards — vague fronts, bloated backs, trivia — create leeches that waste review time without building real knowledge.
- Atomic — one fact per card. If the answer has "and", split it.
- Short, specific front — few words, one unambiguous answer. Not open-ended.
- Minimal back — no unnecessary text. If a structure speaks for itself, don't add explanation below it.
- Visual over prose — prefer file trees, code blocks, or diagrams over sentences when the answer is structural.
- No trivia — only things worth remembering long-term (concepts, gotchas, mental models).
- Tag consistently — use lowercase, comma-separated (e.g.
algorithms,trees).
Good card
- Front:
What guarantee does a WAL provide? - Back:
Durability — changes are written to a log before being applied, so committed transactions survive crashes
Bad card
- Front:
Explain CAP theorem, PACELC, and distributed consistency models - Back: (four paragraphs) — too many facts, split into separate cards.
Workflow
- Propose the card: show front, back, deck, and tags in a formatted block.
- Wait for user approval. Never create without explicit confirmation.
- Check duplicates with
list_cards.sh --query "<relevant keywords>"before creating. - Create the card only after approval.
- Confirm with the note ID from the output.
Troubleshooting
If the connection fails, Anki desktop must be running with the AnkiConnect addon installed (addon code: 2055492159). Full AnkiConnect API reference is in Anki-Connect.md.