second-brain AGENTS.md

second-brain AGENTS.md is an instructions file for Codex, OpenCode from LindaHaviv/second-brain. It costs 1,686 tokens per session, scanned A, original, MIT.

Repository instructions for AI coding agents working on a private, searchable knowledge system called a second brain. They explain what to read, how to set it up, and how to protect stored data.

In plain words
What is it for?
Use them when setting up, adapting, extending, or adding data sources to this second-brain project. They also guide security checks and common maintenance tasks.
Why use it?
They give agents a fixed setup and change process, reducing guesswork and preventing secrets or private information from being exposed.

Instructions file for CodexOpenCode

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/lindahaviv/second-brain/agents-md
Clone the repo
git clone --depth 1 https://github.com/LindaHaviv/second-brain

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 second-brain AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/lindahaviv/second-brain/agents-md.svg)](https://agentmods.dev/instructions/lindahaviv/second-brain/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/lindahaviv/second-brain/agents-md"><img src="https://agentmods.dev/badge/instructions/lindahaviv/second-brain/agents-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 1,686 This file is loaded in full into every session.
When invoked 1,686 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
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 $0.01686 $0.01686
Opus 5 $0.00843 $0.00843
Sonnet 5 $0.00337 $0.00337
Haiku 4.5 $0.00169 $0.00169

Measured 4d ago against content hash cec99115c1c8, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

second-brain 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 4d 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 · 111 lines

How it starts

The opening of the file, as written. The whole thing — 111 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Instructions for AI coding agents

You (an AI coding agent — Claude Code, Cursor, Codex, or similar) have been handed this repo to set up, adapt, or extend a second brain: one Oracle database holding your user's content, searchable by meaning, with a self-compiling wiki, agent memory, and an MCP server. Everything below is what a maintainer would tell you on day one.

What to read first

  • README.md — the build, in order. The Quickstart IS the setup procedure; run it top to bottom rather than improvising your own.
  • README.md → "Build yours with your AI" — if your user wants THEIR version (their sources, their questions), start from those three prompts: interview → plan first.
  • docs/EXPORT_GUIDE.md + any loader in scripts/ — the pattern for adding a source.
  • SECURITY.md — before anything touches real data or the internet.

The rules (non-negotiable)

  1. Secrets never enter files or chat. Credentials live in oracle/.env (gitignored) or the OS keychain (keychain:<item> values — see oracle/agent/keychain_secrets.py). Never print token values, never commit .env, never paste keys into your transcript.
  2. Privacy is structural — keep it that way. Every read path filters visibility='content'. If you write a new query over posts/content_chunks, include the visibility filter. Private/business items must stay out of search, the wiki compiler, memory consolidation, AND anything you add. The column's values: 'content' = searchable everywhere; anything else ('business', 'archived', or a label of the user's choosing) is excluded from every read path, and the cloud-copy script ships only 'content'. If the user's most valuable questions are ABOUT their private data, plan a local-only query path for that scope — don't widen the default filters. The memory layer carries the same contract: agent_memory and conversations have a visibility column too, tagged at write time by the deterministic deny-list (oamp_memory.violates_privacy) and filtered to 'content' on every read — so a private detail the agent saw never resurfaces in its recall, a shared memory view, or the working-memory window. Any new memory write/read keeps that filter. (Semantic and procedural memory need no column: the consolidator distills only from content-scope posts, and tool definitions hold no private data.)
  3. Run the tests after any change: ./.venv/bin/python tests/test_brain.py (needs the local DB from the Quickstart running). All green before you call it done.
  4. Run the matching eval when you touch quality-bearing code:
    • retrieval/search changes → tests/eval_retrieval.py
    • agent answer/verify changes → tests/eval_grounding.py, tests/eval_verify.py
    • privacy classifier changes → tests/eval_classifier.py
    • memory backend changes → tests/eval_oamp.py The golden sets in tests/*.json work on the sample data; encourage your user to grow their own once real content is loaded.
  5. Every loop earns its keep. A new source, agent, or scheduled job ships with an eval that proves it works or a report your user will actually read (see docs/LOOP_ENGINEERING.md). Don't add silent automation.
  6. No self-modification patterns. Agents here never rewrite their own prompts or code at runtime; scheduling stays deterministic (scripts/sync.py + cron/launchd). Keep that property — it's what makes the system auditable with plain SQL.
  7. Don't scrape platforms. Loaders use official APIs and user-requested exports only. If a platform has neither, the answer is "not yet," not a headless browser.

Read the full file on GitHub · 111 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. 4d ago First seen · 111 lines · 1,686 tokens per session scan A cec99115c1c8

Subscribe to this mod's changes

second-brain AGENTS.md is an instructions file published in the GitHub repository LindaHaviv/second-brain (10 stars, last pushed 10d ago), licensed MIT. It adds 1,686 tokens to every session, about $0.0084 per session on Opus 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-08-31.

Related

Other instructions, from other repositories

inkwell-memory CLAUDE.md

Instructions for veronchenko/inkwell-memory, covering claude.md — inkwellmemory, layout, multi-tenant mode (inkwellmultitenant=1), conventions and testing.

veronchenko/inkwell-memory · 2,378 tokens

context-keeper CLAUDE.md

Claude Code instructions for jarmstrong158/context-keeper, covering context keeper mcp server, project resolution, capture loop, when to record and record a decision when.

jarmstrong158/context-keeper · 4,969 tokens

mcp-light-memory AGENTS.md

AGENTS.md instructions for PeterPirog/mcp-light-memory, covering agent operating contract and persistent agent memory: mcp light memory (internalrag).

PeterPirog/mcp-light-memory · 248 tokens

server-memory AGENTS.md

AGENTS.md instructions for MK-986123/server-memory, covering repository instructions for coding agents, objective, initial setup, safe test environment and before editing.

MK-986123/server-memory · 808 tokens

create-vkm-kit copilot-instructions.md

Copilot instructions for Vahlame/create-vkm-kit, a project described as: Cross-platform kit that gives AI agents (Claude Code, Codex, Cursor) persistent memory: Markdown vault + git + MCP. Local-first, hybrid search optional.

Vahlame/create-vkm-kit · 4 tokens

create-vkm-kit CLAUDE.md

Claude Code instructions for Vahlame/create-vkm-kit, a project described as: Cross-platform kit that gives AI agents (Claude Code, Codex, Cursor) persistent memory: Markdown vault + git + MCP. Local-first, hybrid search optional.

Vahlame/create-vkm-kit · 3 tokens