Find functions sharing the same upvalue table (closure clusters)
find-upvalue-sharingScan Luau functions in the GC, inspect their upvalues, and report TABLE upvalues shared by multiple functions to cluster closures that likely belong to the same module or factory.
Instructions
Walk every Luau function in the GC and, for each function, inspect its upvalues. Whenever an upvalue is a TABLE, record the owning function under that table's identity. After scanning, report tables that are shared as an upvalue by several distinct functions — these are typically the shared state / private module table of a single closure family, so the functions that share it belong to the same module or factory. This is how you cluster functions that were defined together (a module's methods all close over the same private table). Each entry reports the table identity, how many functions share it, and a few sample functions. Requires getgc + getupvalues; caps the scan and flags truncation. Signature: { minGroup: any?, limit: any?, maxScan: any?, threadContext: number? }. Phase: observe; cost=medium; idempotency=read-only. Requires: active-client. Capabilities: debug closure primitives. Produces: bounded-candidates. Safety: read-only. On failure: inspect tool-schema for exact fields, defaults, constraints, and an invocation example.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Max shared tables to return, most-shared first (default 40). | |
| maxScan | No | Max GC functions to scan (default 9000). | |
| minGroup | No | Only report tables shared as an upvalue by at least this many distinct functions (default 3). | |
| threadContext | No | Optional Roblox thread identity for this call; omit it to use the server default. |