The chat
Hatch has a chat panel in the right sidebar. It answers questions about your notes and proposes changes to them. This page says how it works, where your keys live, and what it can and can't do.
Opening it
- The chat icon in the side panel,
Mod-J, or "Open chat" in the command palette. - On a phone it opens as a full screen sheet.
- Settings are at Settings, AI (
/settings/ai).
What it can do
- Read any note in the open vault. Hidden folders (
.hatch,.obsidian) are left out. - Search notes, list a folder, and look up which notes link to a note.
- Propose a change to a note, or a new note.
What it can't do
- Change a note on its own. Every change shows as a diff with Accept and Reject. Nothing is written before you accept.
- Overwrite a note that changed after the change was proposed. The card says "This note changed since" and offers to run again.
- Delete, move or rename notes (through an API key provider).
- See your API keys. They are sent to the service as a request header, never as part of a message.
Accepting a change
- If the note is open, the change goes in as an edit in the editor. Undo takes it back, and it saves and syncs like typing.
- If the note is not open, it is written through the vault.
- The text from before is kept in History. The new text is kept too, marked "AI edit".
- With several changes waiting, "Accept all" accepts each in turn. Each one is still checked against the note as it is now.
Providers
You pick the provider and the model at the top of the panel.
Anthropic (API key)
- Works on web, phone and desktop.
- Requests go straight from your device to
api.anthropic.com. There is no Hatch server in between. - Plain
fetchwith streaming. No SDK. - The model list comes from Anthropic once a key is saved.
OpenAI-compatible (API key and address)
- Works on web, phone and desktop.
- Covers OpenAI, OpenRouter, Ollama, LM Studio and anything else that speaks Chat Completions.
- Leave the address empty for OpenAI. For Ollama on your computer use
http://localhost:11434/v1. It needs no key. - A local server has to allow requests from the page. For Ollama, set
OLLAMA_ORIGINS. - The model list comes from the server's
/models. If it has none, type the model's name.
Agents on this computer (desktop only)
- Hatch can talk to an agent you installed and signed in to yourself: Claude Code, Codex or Gemini CLI.
- Hatch starts the agent as a child process in your vault folder and talks to it over the Agent Client Protocol (ACP).
- Hatch never sees, stores or passes on your sign-in. It never offers a login. If the agent says it is signed out, run it in a terminal and sign in there (
claude,codex login,gemini). - Settings, AI shows which agents were found, and the command to install one. Hatch shows the command as text. It never runs it.
- The agent also gets Hatch's own MCP server, read-only, so it can search notes and read the component guide.
Programs Hatch looks for:
| Agent | Program | Install |
|---|---|---|
| Claude Code | claude-agent-acp | npm install -g @anthropic-ai/claude-code @agentclientprotocol/claude-agent-acp |
| Codex | codex-acp | npm install -g @openai/codex @agentclientprotocol/codex-acp |
| Gemini CLI | gemini --acp | npm install -g @google/gemini-cli |
The subscription credit note: using Claude Code from Hatch counts as programmatic use. It draws from your plan's monthly Agent SDK credit, billed at API rates. Settings, AI says this in one line.
How an agent's changes reach you:
- When the agent writes a file through Hatch (ACP
fs/write_text_file), nothing is written. It becomes a proposed change with Accept and Reject, like any other. - When the agent asks permission to use one of its own tools, the request shows in the chat with "Allow once" and "Reject". If the request carries a file change, you see it as a diff first.
- After you allow it, the agent writes the file itself, straight to disk. A tool you allowed does not go through Hatch, so there is no Accept step for it and Hatch can't stop it.
- Hatch saves what you are typing before each message to an agent. When the agent reports a changed file, the open note takes the new text at once and History gets an "AI edit" version. If you typed in that note meanwhile, both texts are kept: yours in the note, the agent's next to it as a conflict copy.
- An agent that asks for a file or a permission between messages gets an error at once, so it never hangs waiting.
- A command the agent wants to run shows as the command text. Hatch can't turn what a command does into a diff. Reject it if you are not sure.
- Hatch never picks "always allow" for you. It only offers once or reject.
Ask AI on selected text
- Select text in a note and press Ask AI, the first button of the toolbar over the selection.
- Pick one of the asks (Improve writing, Fix spelling and grammar, Make shorter, Make simpler) or type your own, then Enter.
- The new text shows under the field as it arrives. Nothing in the note changes until you press Replace or Insert below. Undo takes either back in one step.
- Try again asks the same again. Discard or Escape closes it. Stop ends an answer still on its way.
- It uses the provider and model picked in the chat. With an agent picked there, it uses a service you added a key for, because an agent edits files itself. With no key it says where to add one.
- What goes along: the selected text, up to 600 characters on each side of it in the same block, the note's name and your ask. No tools, nothing else from the vault.
- If the text changed while the answer was written (someone else typing), Replace says so instead of writing over it.
- Turning AI chat off in Settings, Features takes the button away too.
Where keys live
- Never in the vault. Never synced. Never in a log.
- Desktop: the system keychain, through Electron
safeStorage. The file is in Hatch's own data folder. - Web and phone: this device's browser storage (IndexedDB). The key stays on this device.
- Linux without a keychain (no GNOME Keyring or KWallet): Electron would fall back to a fixed password, which protects nothing. Hatch keeps the key in memory until you close it, and the settings page says so.
- If the browser won't store anything, the key is kept until you close Hatch, and the settings page says so.
- "Remove key" deletes it from the device.
- A saved key is never shown again. Paste a new one to replace it.
Where conversations live
- On this device, in IndexedDB. Not in the vault, and not synced.
- The last 30 per vault are kept. "Earlier chats" at the top of the panel lists them.
- A conversation with an agent picked up after a restart starts a new agent session. Hatch passes along the earlier messages as text.
What goes with a message
- The open note, by default. Remove its chip to leave it out.
- The text you selected in the note, when there is some.
- Notes you add by typing
@. - With an API key provider the text of these notes is sent along. An agent gets their paths and reads them itself.
In the panel
Thinking. While the model thinks, a "Thinking" line shows what it is thinking about. It folds to "Thought for 6s" once it moves on. Open or close it yourself and it stays that way. Claude 4.6 and later (Haiku from 5) are asked for a summary of their thinking (adaptive thinking). The signed thinking goes back to Anthropic unchanged with the tool results, as the API requires. OpenAI-compatible servers that send
reasoning_contentorreasoning, and agents that share their thoughts, show the same way.Steps. Two or more tool calls in a row fold into one line, like "Read 3 notes, searched twice". While they run, the line says what is happening now ("Reading Cabin"). Open it to see each step. A step that failed says why.
Notes used. Under an answer, "Used 3 notes" opens into links to the notes it read to answer. An agent's own reads count too.
Copy, try again, edit. Under each answer, copy it as Markdown. Under the last one, try again (the same message, with what went with it) or edit your message. Sending the edit replaces your message and the answer after it. Changes that were still waiting go with it. Accepted ones stay in their notes and in History.
Scrolling. The panel scrolls only when you ask it to. A new message starts near the top, with a little of the turn before it still showing, and the answer grows into the space below. Text that arrives out of view stays there, and "Jump to latest" takes you to it. Once you're at the end, the newest text stays in view. Selecting text holds it still. An earlier chat opens at your last message.
Starter questions. An empty chat offers a few questions you can ask with one press. With the open note going along they are about that note (summarize it, find related notes, turn it into slides).
For developers
packages/aiis the core, with no UI in it.types.tshas the message and stream event shapes and theChatProviderinterface.anthropic.tsandopenai.tsare the HTTP providers.sse.tsreads server-sent events.tools.tshas the vault tools.proposals.tsholds proposed edits and the "changed since" check.runner.tsloops model calls and tools.acp/node.tsruns agents (Node only, exported as@hatch/ai/node).acp/provider.tsis the provider the app uses.acp/protocol.tsis what crosses the IPC bridge.
packages/app/src/aiis the panel, the settings page, key storage and saved conversations.apps/desktop/main/ai.tsexposes agents and the keychain to the window.apps/desktop/main/mcp.tsis the bundled MCP server.store.applyProposalis the one way a change you accepted in the chat is written. An agent's own tools, once allowed, write to disk directly.ChatController.changedOnDisktakes those in throughstore.takeFromDisk.- An answer is drawn with
remoteImages: 'link': a picture on another server becomes a plain link, so nothing in an answer is fetched without a click. Notes themselves still show remote pictures, which is why the app's content security policy keepshttps:for images. - Tests:
packages/ai/src/*.test.ts,packages/app/src/ai/keys.test.tsandscripts/e2e-ai.py. None of them call a real service.