second-brain: Instructions file for Claude Code

AGENTS.md

second-brain AGENTS.md is an instructions file for Claude Code, Codex, OpenCode from LindaHaviv/second-brain. It costs 1,778 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 Claude CodeCodexOpenCode

Written for Claude Code and Codex and OpenCode: PreToolUse hook event, but also the file is AGENTS.md. Also seen: reads .claude/ paths; mentions Claude Code; mentions Codex.

This is LindaHaviv/second-brain's own configuration. It tells Claude Code, Codex and OpenCode how to work on second-brain 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 second-brain configures →

Reuse

Borrowing it

Nothing to install: this file belongs to LindaHaviv/second-brain. 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/LindaHaviv/second-brain/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/LindaHaviv/second-brain

Made for: Claude Code, 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/github.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/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 second-brain AGENTS.md

Your own site · 80×15
<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="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,778 This file is loaded in full into every session.
When invoked 1,778 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.01778 $0.01778
Opus 5.5 $0.00711 $0.00711
Sonnet 5.5 $0.00356 $0.00356
Haiku 4.5 $0.00178 $0.00178

Measured 1mo ago against content hash e5e6cbeea42c, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo 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 · 116 lines

How it starts

The opening of the file, as written. The whole thing — 116 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.
  8. Money stays out of the Content Tracker. In the user's Notion, fees, rates, invoice numbers, payment status, and contract terms live ONLY in the deal tracker (Brand Collab Tracker). Content/calendar rows may reference "paid collab — terms in the deal tracker" and nothing more. Any agent flow that logs content from a brief strips the money facts and routes them to the deal tracker instead.

Read the full file on GitHub · 116 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. 1mo ago Changed · +5 lines · +92 tokens per session e5e6cbeea42c
  2. 1mo 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 (13 stars, last pushed 1mo ago), licensed MIT. It adds 1,778 tokens to every session, about $0.0071 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-08-31.

Related

Other instructions, from other repositories