Claude Code is excellent at working with files, but my projects rarely begin inside a core repository. Requirements, research, troubleshooting notes, article ideas, and half-formed plans usually live in AFFiNE, my note taker of choice.
This separation creates an annoying gap. Claude could understand the code in front of it, but it knew nothing about the decisions, experiments, and background information stored elsewhere. So I stopped repeatedly copying notes into the terminal and gave Claude Code direct access to my AFFiNE workspace.
Copy, paste, repeat, and now three versions of the truth
CLAUDE.md handles the project, not the whole knowledge base
Before this setup, using Claude Code alongside AFFiNE involved far more manual work than it should have. If I wanted Claude to follow an outline, I copied the relevant section from AFFiNE and pasted it into the prompt. If Claude produced a useful research summary or implementation plan, I copied that back into a note.
This worked, but it also created duplicate information. The note in AFFiNE would say one thing, a Markdown file in the project would contain a slightly newer version, and the Claude Code conversation would be in a completely different space.
Claude Code already offers persistent project instructions through files like CLAUDE.md, along with an automatic memory system. However, those mechanisms are primarily tied to a project or local machine rather than serving as a replacement for a broader knowledge base. I still wanted AFFiNE to remain the home for all my notes.
MCP beats logging into a browser Claude doesn’t fully control
Read-only by default, scoped, expiring, revocable
There are two main ways to connect Claude Code to AFFiNE. The first is via an MCP server where you can use either AFFiNE’s built-in MCP or third-party community made ones from GitHub. The other way is to log into your AFFiNE workspace from Claude Code’s built-in browser, but that can expose your AFFiNE credentials in a browser you don’t fully control and isn’t as reliable as an MCP connection.
Security is a major concern here. An MCP connection can expose sensitive notes and potentially modify them, so it should use limited, recoverable credentials. AFFiNE’s MCP implementation supports workspace-scoped credentials, expiration, and read-only access by default, making it possible to start cautiously before enabling broader permissions. Anthropic too recommends verifying that you trust an MCP server before connecting it.
Retrieval, not automation, was the actual unlock
A vague question now pulls exactly the right page
The immediate benefit post connection wasn’t automated note-taking. It was retrieval.
Instead of finding a document myself and pasting several paragraphs into the terminal, I could tell Claude to search AFFiNE for my notes about a particular project. Claude could locate the relevant pages, read them, and use that material while working on the code.
That made vague requests surprisingly effective. I could ask Claude something random like checking my ESP32 sensor notes and continue with the firmware plan and it would work. Since I also maintain an inventory of all my sensors and microcontrollers, Claude can now query it and suggest relevant parts for a new project from what I have on hand.
This is far more useful than stuffing everything into one enormous CLAUDE.md file. Anthropic notes that these files load into the context window when a session starts, so keeping them focused improves adherence and avoids spending context on information that may not matter to the current task. With AFFiNE connected, Claude could fetch detailed information only when it needed it.
Reading works today, writing is still catching up
The built-in MCP server AFFiNE has works great for read access, but write access is still rolling out progressively. At the moment, it’s great for searching or reading your notes, rather than have Claude create or edit documents.
One solution is to use a community server available on GitHub that talks to AFFiNE’s collaboration APIs over stdio or HTTP. But using it means trusting third-party code with your workspace credentials and running/maintaining it yourself.
Now I don’t want Claude meddling in my notes, but if I make a discovery or fix a particularly annoying bug, I’d like the findings to be recorded in the same place as the rest of my notes. Currently, I’m solving this by having Claude record everything in markdown files and then importing it into AFFiNE manually.
You can avoid this by using AFFiNE in Claude Code’s built in browser. But that means exposing your workspace credentials in a browser you don’t fully control.
AFFiNE stayed the notebook, Claude just learned to read it
Notes stay editable by hand, Claude just fetches on demand
This setup is not a substitute for Claude Code’s native project memory. I still use CLAUDE.md for repository-specific rules, commands, and coding conventions. AFFiNE handles the larger body of knowledge: research, project history, ideas, test results, and information shared across repositories.
The biggest improvement is that I no longer maintain an AI-friendly shadow copy of my workspace. My notes remain in AFFiNE, where I can organize and edit them normally, while Claude Code can retrieve or update them when the task calls for it. The AI did not replace my note-taking system, it just became a part of it.