SurfSense: Instructions file for Codex

AGENTS.md

SurfSense AGENTS.md is an instructions file for Codex, OpenCode from MODSetter/SurfSense. It costs 2,349 tokens per session, scanned A, original, Apache-2.0.

Project instructions for coding agents working on SurfSense, covering its agent-instruction files, code organisation, commands, backend, and web parts.

In plain words
What is it for?
Use them when asking a coding agent to navigate, change, or run parts of the SurfSense project.
Why use it?
They give an agent project-specific rules and structure instead of making it infer them from the repository.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: reads .claude/ paths; mentions CLAUDE.md; mentions AGENTS.md.

This is MODSetter/SurfSense's own configuration. It tells Codex and OpenCode how to work on SurfSense itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything SurfSense configures →

About the project

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.

MODSetter/SurfSense · 16,789 stars · on GitHub · surfsense.com

Reuse

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.

Copy the file
curl -O https://raw.githubusercontent.com/MODSetter/SurfSense/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/MODSetter/SurfSense

Made for: Codex, OpenCode.

Wrote 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.

agentmods badge for SurfSense AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/modsetter/surfsense/agents-md/github.svg)](https://agentmods.dev/instructions/modsetter/surfsense/agents-md)
Your own site
<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.

agentmods 80×15 button for SurfSense AGENTS.md

Your own site · 80×15
<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>
Per session 2,349 This file is loaded in full into every session.
When invoked 2,349 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce 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

Measured 3d ago against content hash 9d34e8a1e666, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

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.

AGENTS.md · 144 lines

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.

Read the full file on GitHub · 144 lines

Changes

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.

  1. 3d ago Changed · +6 lines · +286 tokens per session 9d34e8a1e666
  2. 11d ago Changed · -18 lines · -149 tokens per session e1374b786239
  3. 21d ago Changed · +5 tokens per session ec0fee3065e2
  4. 23d ago Changed · +5 lines · +176 tokens per session 8c0dc59daf83
  5. 1mo ago Changed · +10 lines · +161 tokens per session ca67f24f54be
  6. 1mo ago Changed · +20 lines · +553 tokens per session fbc17b1ce53f
  7. 1mo ago Changed · +35 tokens per session 2bcbd9dd17f8
  8. 1mo ago First seen · 121 lines · 1,282 tokens per session scan A cbe3ac5284e0

Subscribe to this mod's changes

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.

Related

SurfSense AGENTS.md compared with instructions from other repositories

SurfSense AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
SurfSense AGENTS.mdMODSetter/SurfSenseInstructions file17ktodayApache-2.0A2,349Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143ktodayMITA7,461Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA5,516GitHub Copilot
langchain AGENTS.mdlangchain-ai/langchainInstructions file149ktodayMITA4,680Codex, OpenCode
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode