# Where Did This Come From, and Why? Giving Agents the Computation and Intent Behind Every Output with marimo-lens

> marimo-lens traces a selected output to its producing cells and linked earlier requests. With Lens, agents found the producing cell in 99% of runs on 22 real requests; on 13 outputs with prior requests, they reported the asker and wording in 95%.

- arXiv: https://arxiv.org/abs/2612.05904
- Authors: Péter Ferenc Gyarmati, Trevor Manz, Dominik Moritz, Mennatallah El-Assady
- Published: 2026-12-04
- Topic: Agents
- Visual carousel: https://instaxiv.com/p/2612.05904
- Explanation by InstaXiv, a secondary educational summary. Cite the original paper for exact results. InstaXiv is not affiliated with or endorsed by arXiv or Cornell University.

## Your agent sees a chart. Can it find the code and why?

**99%** producing cell found vs 39% from question alone

## A compliant edit can erase an earlier decision

**Ana's request:** Ana points at 2012, far above the trend, and asks for a fit across all years.

**Ben's earlier request:** Ben had asked to exclude 2012 as an outlier. The filter records the exclusion, not his reason.

Without linked history, compliance can silently undo Ben's work.

## The output and its history split apart

![Figure 2](https://cdn.instaxiv.com/figures/2612.05904/figure2.webp)

Public Observable sample: 7,293 notebooks with histories; 17,328 comments used as request proxies. 60% of chart comments targeted the view; 86% of charts relied on other cells; 52% of dated output-feeding undos happened upstream. (Figure 2)

## A pointer needs both computation and intent

![Figure 1](https://cdn.instaxiv.com/figures/2612.05904/figure1.webp)

The Lens graph links view, computation and intent. A selection reaches its producer, upstream blocks and linked requests: the graph cut sent to agents. This paper implements it as marimo-lens for marimo. (Figure 1)

## From a pointed output to useful agent context

1. **Select a part**: Point at a chart region or report value; Lens anchors the selection to an output.
2. **Trace upstream**: It follows the producing block and upstream dependencies.
3. **Link earlier intent**: Earlier requests attach to changed blocks with their asker and wording.
4. **Point back**: Agents mark the view, show a trail and report status/standing; hosts need stable output IDs, dependencies, an edit stream and an agent channel.

## Present code does not mean still wanted

**Change status:** Lens derives present, reverted or unknown from the current cell implementation.

**Request standing:** Only a person sets confirmed, withdrawn or unset. A change can be present but unwanted, or reverted yet still wanted.

Check both before deciding whether to reverse earlier work.

## A pointer helps agents find the producing cell

![Figure 6](https://cdn.instaxiv.com/figures/2612.05904/figure6.webp)

Tiles aggregate three runs per request/input/agent. On 22 real requests, producing-cell identification rose from 39% (question alone; 95% interval 24–56) to 99% with Lens (97–100). (Figure 6)

## Text-only agents found more with fewer tokens

**Question alone:** Median input per run was 524k tokens for Beam 1.0 and 622k for GLM-5.3.

**With marimo-lens:** Their medians fell to 293k and 205k, respectively; cell-finding rose from 40% to 98%.

Token comparisons are within each agent.

## Intent needs a record, not just notebook history

![Figure 7](https://cdn.instaxiv.com/figures/2612.05904/figure7.webp)

Across four agents, Lens reported requester and wording in 95% of runs (95% interval 89–99) on 13 outputs with earlier requests. Figure 7 compares image-reading agents; comment rows are Experiment 1, other rows Experiment 2. (Figure 7)

## A policy helps, but some reversals remain

| Method | Undo on conflict (%) | Silent undo (%) | Asked on conflict (%) | Control stopped (%) |
| --- | --- | --- | --- | --- |
| Cell's name | 96 (90–99) | 69 | 3 | 0 |
| Rule + record | 3 (0–6) | 0 | 95 | 21 (6–38) |
| **marimo-lens (Agent Skill)** | **15 (9–20)** | **9** | **82** | **15 (5–24)** |

_Exp. 3: 10 outputs, 7 earlier requests; 120 runs per input/condition. Controls should not stop; 95% intervals are over requests._

## What these tests cannot settle

- **Reconstructed requests**: Real requests came from three public notebooks by two teams; records were rebuilt from older comment threads and histories.
- **One harness, one turn**: All agents ran in Claude Code; the conflict experiment covered one turn, not how a team responds to an agent's question.
- **Imperfect provenance**: In-place mutations may hide dependencies; comparison flips can hide undos, while reworded prose can look reverted.

Best used when: Best fit: hosts with stable outputs, dependency graphs, edit streams and agent channels.

## Key takeaways

- A pointed output is only half the context; the computation and the reasons behind it can change what a safe edit means.
- Record each asker, request and changed cells; for a present, unset request, ask before reversing if the new request omits its asker.
- How analysts use these trails and receipts in everyday work remains open beyond one-turn tests and early public use.

## Links

- arXiv: https://arxiv.org/abs/2612.05904
- PDF: https://arxiv.org/pdf/2612.05904
- Code: https://github.com/marimo-team/marimo-lens

## Citation

```bibtex
@article{gyarmati2026where,
  title   = {Where Did This Come From, and Why? Giving Agents the Computation and Intent Behind Every Output with marimo-lens},
  author  = {Gyarmati, Péter Ferenc and Manz, Trevor and Moritz, Dominik and El-Assady, Mennatallah},
  journal = {arXiv preprint arXiv:2612.05904},
  year    = {2026},
  url     = {https://arxiv.org/abs/2612.05904}
}
```
