When rendering paragraphs in a theme, is there a way to look at the last rendered paragraph while rendering the current one? I have about two dozen paragraph types. One of them inserts an h2, and generates a jump menu at the top of the page (I am generating that myself). 

The pattern lab has the content that comes next (whatever the next Paragraph inserted may be) with a special CSS class on the container, because of the particular aforementioned type being used.

Is there a way in theme_preprocess_paragraph or theme_preprocess_field to 'look back' and add the CSS class if the current one is a certain paragraph type?
Yes, you can do something like this in preprocess:

    &lt;?php
    // Get entity reference revision item that points to this paragraph.
    /** @var \Drupal\entity_reference_revisions\Plugin\Field\FieldType\EntityReferenceRevisionsItem $item_reference */
    $item_reference = $paragraph-&gt;_referringItem;

    // Get entity reference revision field items list that holds all
    // paragraphs.
    /** @var \Drupal\entity_reference_revisions\EntityReferenceRevisionsFieldItemList $items_list */
    $items_list = $item_reference-&gt;getParent();

    // Get next index position of current paragraph in entity ref. revision
    // field items list.
    $next_delta = $item_reference-&gt;getName() + 1;

    // Check if there is a paragraph on the next delta.
    if ($items_list-&gt;offsetExists($next_delta) &amp;&amp; $items_list-&gt;get($next_delta)-&gt;entity) {


That special property is set in \Drupal\Core\Field\Plugin\Field\FieldFormatter\EntityReferenceFormatterBase::getEntitiesToView(). And because paragraphs themself are not render cached on their own and not used in multiple places means that you can actually rely on it. (It would also be set on a node, but due to render caching, you can not rely on it being there, at least not by default).