Borrowing it
Nothing to install: this file belongs to alshyra/sherlock-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.
curl -O https://raw.githubusercontent.com/alshyra/sherlock-second-brain/main/AGENTS.mdgit clone --depth 1 https://github.com/alshyra/sherlock-second-brainWrote 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/alshyra/sherlock-second-brain/agents-md)<a href="https://agentmods.dev/instructions/alshyra/sherlock-second-brain/agents-md"><img src="https://agentmods.dev/badge/instructions/alshyra/sherlock-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.
<a href="https://agentmods.dev/instructions/alshyra/sherlock-second-brain/agents-md"><img src="https://agentmods.dev/badge/instructions/alshyra/sherlock-second-brain/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.01484 | $0.01484 |
| Opus 5.5 | $0.00594 | $0.00594 |
| Sonnet 5.5 | $0.00297 | $0.00297 |
| Haiku 4.5 | $0.00148 | $0.00148 |
Grade A, and why
sherlock-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 2mo 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 — 92 lines — stays where its author put it; the contents beside it link to each section on GitHub.
AGENTS.md
Sherlock's second brain MCP server: validated knowledge lives in fiches/ and skills/;
everything unvalidated lives in cases/ (JSON investigations — investigation files for
debugging and analysis) or memories/ (standalone MD notes with YAML frontmatter). A
resolved case is promoted into a fiche or skill via the MCP; a memory can also be
promoted into a fiche.
Repo language is English (code, docs, generated output) — the README.md is in English
because it is parsed by Glama (https://glama.ai). Some tests keep French content
(tests/test_vector.py, test_slugify) to exercise multilingual support.
Commands
uv run ruff check src/ tests/ # lint (Astral, E,F,I,W,UP,B,ANN,PYI + preview)
uv run ty check # type checking (Astral)
uv run pytest tests/ -v # all tests (no services needed, tmp_path fixtures)
uv run pytest tests/test_storage.py::test_slugify -v # single test
uv sync # installs deps (chromadb+fastembed inclus)
Required verification order: ruff check → ty check → pytest.
Run the server with uv run python -m sherlock_second_brain.server — this is a stdio MCP server,
it needs an MCP client to be useful (wired as ~/.config/opencode/opencode.json →
SHERLOCK_BRAIN_DATA_DIR=/opt/infra/kb).
Architecture (hexagonal)
src/sherlock_second_brain/:server.py— composition root: instantiates adapters+services,@mcp.tool()defsdomain/— rich aggregates enforcing their invariants:models/case.py(Casefactory + mutations +promote) andmodels/memory.py(Memoryfactory + setters +promote), one file per class (models/{case,hypothesis,step,evidence,memory,promotion}.py), pluserrors.py(StorageError hierarchy),rules.py(VALID_STATUS,VALID_PROMOTION_TARGETS) andtext.py(slugify,now_iso,CASE_ID_PATTERN,MEMORY_ID_PATTERN)application/— thin orchestration only (no business rules), depending onports.pyProtocols:case_service.py(CaseService),memory_service.py(MemoryService),promotion_service.py(PromotionService)adapters/— persistence/IO only, no domain policy:filesystem.py(Storagepersists by object:save_*/get/list/delete/next_*_id/write_evidence),chroma.py(VectorIndex+FastembedEmbeddingFunctionmultilingue),lexical.py(LexicalIndex),hybrid.py(HybridIndexRRF),dto/case_update.py(CaseUpdateFieldsfor thecase_updatefields),frontmatter.py(memory MD + YAML frontmatter render/parse),templates/(Jinja2:fiche.md.j2,skill.md.j2,memory_fiche.md.j2rendered byPromotionService)
- Data layout under
SHERLOCK_BRAIN_DATA_DIR(default~/sherlock-second-brain-data):cases/<case-id>/case.json+cases/<case-id>/evidence/*—case-id=case-YYYY-MM-DD-NNN(per-day counter)memories/<id>.md—id=mem-YYYY-MM-DD-NNN(per-day counter), YAML frontmatter + bodyfiches/<slug>.md,skills/<slug>/SKILL.mdvector/— derived ChromaDB index, always rebuildable via theindex_rebuildtool
src/sherlock_second_brain/schema/case.schema.jsonis the source of truth:Storage._save_casevalidates every case against it (SCHEMA_PATHprefers the schema bundled inside the package, falling back to walking up to the repo root). If you touch the schema, keep writes compatible ortest_written_case_matches_json_schemafails.- Search is hybrid:
server.pycomposesHybridIndex(VectorIndex, LexicalIndex)and fuses rankings by RRF. ChromaDB is a mandatory dependency (no fallback). The embedding model is multilingual (sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2, downloaded at firstindex_rebuild). Doc IDs arefiche:<slug>,case:<id>,skill:<slug>,memory:<id>. Document enumeration is shared inadapters/documents.py. CaseServicemaintains the index on every mutation (update/evidence/status/delete);MemoryServicemaintains it on every mutation including create (a memory must be immediately searchable).
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.
- 2mo ago First seen · 92 lines · 1,484 tokens per session scan A 746cb42643a2
sherlock-second-brain AGENTS.md is an instructions file published in the GitHub repository alshyra/sherlock-second-brain (0 stars, last pushed 3mo ago), licensed MIT. It adds 1,484 tokens to every session, about $0.0059 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.
sherlock-second-brain AGENTS.md compared with instructions from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| sherlock-second-brain AGENTS.mdalshyra/sherlock-second-brain | Instructions file | 0 | 3mo ago | MIT | A | 1,484 | Codex, OpenCode |
| vscode buildNext.instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 9,719 | GitHub Copilot |
| next.js AGENTS.mdvercel/next.js | Instructions file | 143k | yesterday | MIT | A | 7,461 | Codex, OpenCode |
| langchain AGENTS.mdlangchain-ai/langchain | Instructions file | 149k | yesterday | MIT | A | 4,680 | Codex, OpenCode |
| vscode oss-third-party-notices.instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 5,516 | GitHub Copilot |
| vscode copilot-instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 3,093 | GitHub Copilot |
| deepseek-harness AGENTS.mddeepseek-ai/deepseek-harness | Instructions file | 274k | 2d ago | MIT | A | 4,313 | Codex, OpenCode |