SurfSense is an open-source desktop application that uses an AI agent to research, transform, and edit documents while keeping their index on the user's machine. It is intended for people working with documents they cannot upload, with a choice of local or remote models and no account required.
Borrowing it
Nothing to install: this file belongs to MODSetter/SurfSense. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/MODSetter/SurfSense/main/AGENTS.mdgit clone --depth 1 https://github.com/MODSetter/SurfSenseWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/instructions/modsetter/surfsense/agents-md)<a href="https://agentmods.dev/instructions/modsetter/surfsense/agents-md"><img src="https://agentmods.dev/badge/instructions/modsetter/surfsense/agents-md/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/instructions/modsetter/surfsense/agents-md"><img src="https://agentmods.dev/badge/instructions/modsetter/surfsense/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.02349 | $0.02349 |
| Opus 5.5 | $0.00940 | $0.00940 |
| Sonnet 5.5 | $0.00470 | $0.00470 |
| Haiku 4.5 | $0.00235 | $0.00235 |
Grade A, and why
SurfSense AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 144 lines — stays where its author put it; the contents beside it link to each section on GitHub.
AGENTS.md
Nearest AGENTS.md wins. Edit this file, not CLAUDE.md (CLAUDE.md is a symlink).
Overview
Desktop app plus SurfSense's own backend. Three trees:
| Tree | Role |
|---|---|
www |
Next.js site at www.surfsense.com, and the update feed and usage routes the desktop calls |
surfsense_local |
Electron desktop |
backend |
The one SurfSense backend, one process run by server/: the license portal in license/, its mailer/, and plugins/, which holds SurfSense's own plugin servers (plugin host) and the registry; plugins/bundles/ holds the earlier, local design's SDK and tooling, deferred |
The hosted service closed on 18 Oct 2026, when its user data was purged. The self-hosted stack, surfsense_backend, surfsense_web, surfsense_mcp and docker/, lives only on the legacy branch (legacy stack). Product direction is local + API.
Code organization
Applies to every new file. Existing code is not a template and not a cleanup ticket.
Must
- Organize by feature (vertical slice), not by technical layer.
- One responsibility per file. One responsibility per folder.
- If a responsibility grows sub-responsibilities, promote it to a folder. Each sub-responsibility is its own file.
- Names state what and why, not how.
- Comments and docstrings state intent only. Do not restate the code.
- Keep them short. A line or two. Write only what the code cannot say: a constraint, a rejected alternative, a number that justifies a threshold.
Must not
- Do not write essays in docstrings. If it explains how you arrived at the code rather than what the code must honour, delete it.
- Do not put new work in a nearby file because it is convenient. New responsibility, new file.
- Do not add catch-all folders (
utils,helpers,common,misc,shared) unless that name is the product concept. - Do not layer-split new work (
controllers/,services/,models/as the primary tree). - Do not rewrite existing code to this layout unless the task is that rewrite.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 3d ago Changed · +6 lines · +286 tokens per session 9d34e8a1e666
- 11d ago Changed · -18 lines · -149 tokens per session e1374b786239
- 21d ago Changed · +5 tokens per session ec0fee3065e2
- 23d ago Changed · +5 lines · +176 tokens per session 8c0dc59daf83
- 1mo ago Changed · +10 lines · +161 tokens per session ca67f24f54be
- 1mo ago Changed · +20 lines · +553 tokens per session fbc17b1ce53f
- 1mo ago Changed · +35 tokens per session 2bcbd9dd17f8
- 1mo ago First seen · 121 lines · 1,282 tokens per session scan A cbe3ac5284e0
SurfSense AGENTS.md is an instructions file published in the GitHub repository MODSetter/SurfSense (16,789 stars, last pushed today), licensed Apache-2.0. It adds 2,349 tokens to every session, about $0.0094 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-19.
SurfSense AGENTS.md compared with instructions from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| SurfSense AGENTS.mdMODSetter/SurfSense | Instructions file | 17k | today | Apache-2.0 | A | 2,349 | Codex, OpenCode |
| vscode buildNext.instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 9,719 | GitHub Copilot |
| next.js AGENTS.mdvercel/next.js | Instructions file | 143k | today | MIT | A | 7,461 | Codex, OpenCode |
| vscode oss-third-party-notices.instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 5,516 | GitHub Copilot |
| langchain AGENTS.mdlangchain-ai/langchain | Instructions file | 149k | today | MIT | A | 4,680 | Codex, OpenCode |
| vscode copilot-instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 3,093 | GitHub Copilot |
| deepseek-harness AGENTS.mddeepseek-ai/deepseek-harness | Instructions file | 274k | 2d ago | MIT | A | 4,313 | Codex, OpenCode |