morankor/theorist-toolbox/second-brain
Claude Code and agent skill by morankor/theorist-toolbox
- community
Checking that the SKILL.md file is still in the repository.
Set up and use an academic "second brain" — agentic RAG over a local library of theoretical papers (LaTeX-aware ingestion, theorem/proof tools, hybrid search). Use when the user wants a second brain for papers in a folder, says "/second-brain", "set up a second brain here", "ingest this paper into my second brain", or asks questions against an existing second-brain library (a directory containing config.toml with a [paths] section and an index/ folder).
Install
npx vskill@latest install morankor/theorist-toolbox/second-brainSKILL.md
Second Brain — setup and usage
Author: Moran Koren, Ben-Gurion University of the Negev (korenmor@bgu.ac.il). Part of the Theorist Toolbox.
Sets up a self-contained agentic-RAG library in a target directory: papers are ingested from LaTeX source (preferred), HTML, or PDF-OCR into a chunked, QA-gated index; an agent (or Claude Code itself via MCP) answers questions by reading exact theorems/proofs with custom macros and prerequisite definitions auto-bundled. Full design: package/ in this skill contains the complete brain Python package.
Throughout, $SKILL means this skill's base directory (shown in the message that loaded this file) and $TARGET means the directory the user wants the second brain in (default: the current working directory; ask only if the cwd is clearly wrong for a paper library, e.g. a code repo).
Step 0 — detect state
$TARGET/config.toml exists AND $TARGET/.venv/bin/brain runs → already initialized: skip to Usage. Otherwise run Init.
Init
Then register the MCP server for Claude Code by writing $TARGET/.mcp.json (absolute paths, no ~):
Verify the install with the bundled fixture, then remove the test entry:
Finish by telling the user: (1) init is done and verified; (2) restarting Claude Code in $TARGET and approving the "second-brain" MCP server lets them ask about their library in any session, billed to their Claude subscription; (3) the standalone CLI default (claude-code provider) also uses the subscription — keep ANTHROPIC_API_KEY unset for that; and (4) offer to ingest papers right away (see below). If the directory already contains PDFs or .tex sources, list them and offer to ingest them.
Usage
All commands run from $TARGET with .venv/bin/brain:
- Ingest —
brain ingest <arxiv-id | tex-dir | file.tex | url | file.pdf> - Prefer arXiv ids / LaTeX source (Tier 0: exact math, no OCR). PDFs need
pip install "$SKILL/package[ocr]" and are QA-flagged by default.
- Idempotent; add
--forceto re-ingest,--no-llmto skip metadata
enrichment (use --no-llm when the user wants speed or determinism).
- After a batch, run
brain statusand report any ⚠ needs_review papers. - Search (no LLM) —
brain search "query" -v - Ask —
brain ask "question" -v(orbrain replfor multi-turn).
Inside Claude Code, prefer the MCP tools directly instead of shelling out to brain ask — same backend, no nested agent.
- Health —
brain status; run.venv/bin/pytest "$SKILL/package/tests" -q
if something seems broken.
When answering from MCP tools yourself, follow the library's grounding rules: search first; use read_theorem_or_proof for any formal statement; record notation with write_to_scratchpad after reading a Model section; cite [paper_id, Item] for every mathematical claim; flag needs_review sources.
Updating the bundled package
If the canonical copy in papers_2nd_brain evolves, refresh this skill with: rsync -a --exclude __pycache__ --exclude '*.egg-info' <canonical>/pyproject.toml <canonical>/src <canonical>/tests "$SKILL/package/" — then existing brains pick it up via .venv/bin/pip install -q --force-reinstall "$SKILL/package[dev,providers,mcp,web]".
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/second-brain/SKILL.md
Popularity
- Repository stars
- 81
- Repository forks
- 23
- 7-day trend score
- 22
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/morankor/theorist-toolbox/second-brain)