Don't pass lua table keys or lines N-M as heading to get_document on big discoveries .lua files — they are preview-only
Context
You grep something like MAGGIE_SEAT_CHAIR_DESK_WRITING, RDRO_Safecracking_Sounds, MP_MOONSHINE_BAND, mech_pickup@loot@cash_register_clerk_opened, or whistle_1_intro in the discoveries corpus. grep_docs shows the token sitting inside a big lua data file like:
discoveries/animations/scenarios/scenario_types_with_conditional_anims.lua:6862 — ["MAGGIE_SEAT_CHAIR_DESK_WRITING"] = {
Natural next step: get_document({path: "...scenario_types_with_conditional_anims.lua", heading: "MAGGIE_SEAT_CHAIR_DESK_WRITING"}) to expand the table body.
Silent 404. Heading doesn't match.
The trap
The very largest lua files in discoveries/ (over ~500KB) are preview-only indexed:
discoveries/animations/ingameanims/ingameanims_list.lua(multi-MB)discoveries/animations/scenarios/scenario_types_with_conditional_anims.luadiscoveries/animations/megadictanims/megadictanims.luadiscoveries/animations/scenarios/ped_commands_for_transitions_between_anims.luadiscoveries/audio/soundsets/soundsets.luadiscoveries/vehicles/vehicle_bones.lua- a handful more in
discoveries/clothes/,discoveries/objects/entity_extensions/
For these, the indexer emits a single stub chunk (filename as H1, first 80 lines as preview) — there are no H2 sub-headings indexed, ever. Lua table keys are not headings; they're values inside the source code. Same goes for the lines 200290-200410-style display heading you may see in semantic_search snippets — those exist as real chunk headings only for the medium-size lua files (200-line slices), never for the >500KB ones.
Smaller .lua files (under the threshold) DO get lines N-M H2 headings. But you can't tell the size from the path alone, and the line numbers you see in grep_docs line-number output are never themselves valid headings — they're file offsets, not chunk boundaries.
The fix
For any discoveries .lua file when you have a specific token from grep_docs:
- Don't pass the token as
heading. Use it as apatterntogrep_docsto find every occurrence — that's how you traverse these tables. - To read surrounding context, call
get_document({path})withoutheading— you'll get the file preview plus a link to the upstream raw lua on GitHub (https://github.com/femga/rdr3_discoveries/blob/master/...). Use the upstream raw view for full-file browsing. - If you need the structure of a specific table by key, narrow your grep with
pathSubstring=<exact path>and apatternthat matches the key plus a few neighboring lines, e.g.pattern: "MAGGIE_SEAT_CHAIR.*"— the auto-grep fallback inget_documentwill also do this for you now when you pass a code-symbol-shaped heading on a discoveries path.
The same applies to .md README files in discoveries/ that have no internal H2 structure (e.g. discoveries/AI/RELATIONSHIP/README.md is a single long table — agents commonly try heading: "relationship groups" and miss). Check with browse({category: "discoveries"}) plus a follow-up get_document({path}) without heading if the file looks flat.
Tags: discoveries, get_document, lua, animations, navigation, scenarios
Category: discoveries
Source: claude-code
Created: 2026-05-14T09:10:31.978Z