CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
What this repository is
A theological research project on tithe, stewardship, and ecclesiastical authority (Seventh-day Adventist context), organized as an Obsidian-/wiki-style Markdown knowledge graph. It is not a software project — there is no build, lint, or test tooling. The only "commands" are the data-sync scripts for the local EGW Writings database (below).
Entry point: 00_README.md — lists the primary source nodes, comparative nodes, and the working
principle ("Hermeneutical Distance") the research is organized around.
Source of truth
For paper content, ~/Downloads/Tithe_Hermeneutical_Comparison_REVISED_CONDITIONAL_2026-08-07.docx
is authoritative — not the live Google Doc and not
Tithe, Stewardship, and Hermeneutical Distance — Paper.md. Confirmed 2026-08-15: the live Google
Doc (fileId 1PUfLA2C1wBtqPSwV1BsikkfE4NC0Kogd9SOPGY8vC4U, published via ChatGPT) had drifted from
the Word doc in several places — a missing "Accuracy note" paragraph, a subtly reworded
"Plain-English note," an added "Conditional" qualifier not in the source, and an unverifiable Ellen
White citation detail. Reconcile content differences toward the Word doc, not the Google Doc.
For publishing/distribution, the live Google Doc is still the doc people are actually reading —
don't push local-only edits to it without explicit sign-off; use a test doc first (a patched
gdocs_update MCP tool converts markdown → native Docs formatting; see its dedicated notes below).
The local .md file tracks both: it should match the Word doc's content and the Google Doc's
YouTube-link formatting. Read/write the Google Doc via the gdrive MCP server (gdocs_update,
gdrive_read_file, gdrive_search).
Video citations (e.g. Vine's Entropy talk) are timestamped YouTube deep-links
(https://www.youtube.com/watch?v=<id>&t=<seconds>s), built by pulling the transcript with yt-dlp
and converting its timestamps into links — never cite a bare timestamp string.
Knowledge graph structure
Files link to each other with Wiki Link syntax and carry YAML frontmatter (title, type,
status). title should match the filename (minus .md) — Obsidian resolves Links by
filename regardless, but a mismatch breaks title-text search/linking; four files had drifted from
this and were fixed 2026-08-15. The actual type values in use as of 2026-08-15 (broader than this
list historically was — keep both loosely in sync, but don't force every node into one of these
categories if it genuinely doesn't fit; prefer a single hyphenated token like the others over a
multi-word free-text value):
index, concept, comparison, source, transcript, methodology, concept-cluster, exegetical-note,
primary-analysis, primary-document, bibliography, background, research-agenda, proposal
proposal (added 2026-08-15) is for non-theological project/tooling documents like
AWS Deployment Proposal — infrastructure planning for the project's own tools, not part of the
tithe/stewardship research itself. Keep these out of the theological node-type categories above.
Node types, by frontmatter type:
- Primary source nodes — one file per author/work being analyzed (e.g.
Rodriguez — Tithing in the Writings of Ellen White.md,Standish — Tithes and Offerings, Trampling the Conscience.md,Vine — Entropy.md). Full transcripts of video/audio sources live in separate*— Transcript.mdfiles. - Comparative/synthesis nodes — cross-cutting analysis, e.g.
Cross-Source Concept Matrix.md(a table scoring each source A/Q/— per concept),Shared Core Concepts.md,Independent and Source-Distinctive Concepts.md,Hermeneutical Distance.md. References.md— bibliography: primary sources, key video timestamps, biblical passages cited, Ellen White materials discussed. Update this when a new source or citation set is added.outstanding_questions.md— open research questions and next-reading-order notes; not a finished node, treat as a running scratch list.- Historical/biographical source files (Himes, Peck, Waggoner, Robinson, Haskell) are being pulled
in as secondary context on pioneer-era SDA practice, per the "read chronologically" note in
outstanding_questions.md. - PDFs at the repo root are primary-source scans (Standish, Ferrell, Hawley) kept alongside their Markdown notes/transcripts.
EGW Writings local database
data/egw-writings.db (SQLite, WAL mode) is a local mirror of the EGW Writings API, queried through
the egw-research-server MCP server (search_local, get_local_content, browse_by_reference,
etc.). Two Node scripts populate it, both must be run from the repo root and both need Node 22 (not
the machine's default) because the downloader's native better-sqlite3 build breaks on Node 24:
# full recursive catalog sync (the bundled `books` CLI caps at 100/folder, one level deep — these don't)
.claude/skills/egw-book/egw-downloader.sh books --lang en # or use catalog-sync.js directly:
node data/catalog-sync.js [lang] # default lang: en
# pull actual paragraph content for specific books (bypasses the broken /chapter/{id} endpoint
# by downloading each book's ZIP export instead)
node data/zip-sync.js <bookId> [<bookId> ...]
node data/zip-sync.js --all-downloaded # re-sync every book already catalogued
egw-downloader.sh is a thin wrapper that puts Node 22 on PATH and exports the OAuth client
credentials the EGW API requires (the official EGW mobile app's published credentials, not
personal ones) — use it instead of calling egw-downloader directly. data/tokens.json holds the
resulting access token that catalog-sync.js/zip-sync.js read directly via curl.
MCP servers in use
egw-research-server— local EGW Writings DB (see above). Key tools:search_local,get_local_content,get_local_book,list_local_books,browse_by_reference,get_context,get_database_stats. Two bugs found and fixed 2026-08-15, both only in the deployed package (not committed anywhere, so a reinstall silently reverts them — same watch-out asgdocs_updatebelow):search_localaliased a columnas group(an unquoted reserved word) causing every query to fail withnear "group": syntax error; fix: quote the alias.browse_by_referencetried to filter the FTS5 index onrefcode_short, a column that was never indexed into it (onlyparagraphs, the underlying table, has it); fixed by adding asearchByRefcode()method that queriesparagraphsdirectly (exact match first, falling through to a same-page paragraph listing when the exact match is just a blank page-boundary marker — a bare page ref like "PP 530" usually has real content one level down at "PP 530.1" etc.). Also worth knowing:search_local's FTS5 full-text search can produce false negatives on content that directrefcode_shortlookup finds immediately (happened on Patriarchs and Prophets p. 530 — see Second Tithe §6) — if asearch_localquery for a specific known passage comes up empty, trybrowse_by_referenceon its citation before concluding the citation is wrong.gdrive— reads/writes the canonical Google Doc and other Drive files. Key tools:gdrive_search,gdrive_read_file,gdocs_update,gsheets_read,gsheets_update_cell.gdocs_updateis a locally-patched addition (markdown → native Docs formatting) with known-fixed bugs of its own (leftover formatting bleed onreplace, a dropped table-marker character that desynced hyperlink ranges, missing paragraph spacing) — see git history / session notes on the deployed file at~/.local/share/mise/installs/node/*/lib/node_modules/@isaacphi/mcp-gdrive/dist/if it misbehaves again; the fixes are in the deployeddist/files, not committed anywhere, so a reinstall of the npm package will silently revert them.study-bible— free Strong's Concordance, Greek/Hebrew lexicons (BDB, LSJ, Abbott-Smith), morphology, and verse lookups (SSE,https://studybible-mcp.fly.dev/sse, added 2026-08-15 as a free alternative to buying Logos just for Strong's data). Key tools:word_study,search_by_strongs,lookup_verse,search_lexicon,get_cross_references,get_bible_dictionary,parse_morphology. Never callword_studywith a bare Englishwordparam — its auto-resolution is unreliable (tested: "tithe" wrongly resolved to H1288 "bless"). Instead calllookup_verseon a passage to get the word-by-word Strong's breakdown, then callword_study/search_by_strongswith the explicit Strong's number.logos-bible-software— Bible text and cross-references from Logos, live against whatever the user has open there. Key tools:get_bible_text,search_bible,get_cross_references,get_passage_context,compare_passages,search_all,get_user_highlights,get_user_notes,get_clippings,navigate_passage,open_resource/open_guide/open_word_study/open_factbook,get_library_catalog,get_reading_progress,get_favorites,scan_references,capture_panel_screenshot,get_logos_state,diagnose. Currently non-functional — as of 2026-08-14, Logos itself is not installed/set up on this machine (diagnoseshows every data path under~/Library/Application Support/Logos4/missing). Check withdiagnosebefore relying on it;study-biblecovers the same ground for Strong's/lexicon work in the meantime.
Together, egw-research-server and study-bible (or logos-bible-software, once/if it's set up) are
the primary research tools for this project: EGW writings quotes and Bible text/cross-references
should be pulled through these MCP servers rather than quoted from memory or re-typed from the PDFs
at the repo root.
Knowledge graph maintenance
Multiple sessions/agents sometimes work on this repo concurrently and don't see each other's edits (this happened 2026-08-15: two separate Claude sessions built out nodes in parallel with no coordination). Because the graph is just plain Markdown files with no build/lint/test step to catch drift, run a reconciliation pass after any period of multi-session or heavily-parallel (e.g. multiple forked-subagent) work touches the graph, and periodically otherwise. A pass should check:
- Cross-link integrity — every Wiki Link resolves to a file that actually exists.
- Overlap/contradiction between nodes — two nodes covering similar ground (e.g. two storehouse-themed files) making different claims or reaching different conclusions.
- Citation consistency — the same Bible passage or Ellen White quote cited with different references, wording, or interpretation across nodes.
- Frontmatter consistency —
title/type/statusfields present and matching the node-type conventions above.
Prefer running this as a read-heavy audit (a forked subagent, or Explore) that reports findings
back rather than one that edits directly — resolving a genuine contradiction between two nodes is an
editorial judgment call for the primary session (or the user) to make, not something to silently
auto-resolve.