---
title: "Code Lens by example: four apps, one click to the line"
description: "Code Lens over a Python page, a zsh script, a Mac app and an iPhone app. What it labels, what repository search finds for the same text, and what the labels did and didn't change for Claude Code."
url: https://www.bigshot.pics/blog/code-lens-example
---
# Code Lens by example: four apps, one click to the line

*2026-11-10*


You see something on screen you want to change: a label, a badge, a line
in a status report. The work starts with finding the code that draws it.
[Code Lens](https://www.bigshot.pics/docs/code-lens) does that step. Drag over the part of the
screen you mean, and each component Bigshot finds gets a label with its
file and line. Click a label and your editor opens on that line.

This post walks through one session over four small apps, written in
Python, zsh and Swift, and compares what Lens opens with what a text
search finds.

![Code Lens over four apps: a Python page in Chrome, a zsh script in Terminal, a SwiftUI Mac window and a SwiftUI iPhone app in the Simulator. Each selection gets labels with the component, file and line.](https://www.bigshot.pics/video/lens-apps-web.mp4)

The video is real footage of the app, not a mockup. The four apps are in
Bigshot's repository under `demo/code-lens`. They share one Project, with
the Code map turned on:

- **Pantry**, a page in the browser, served by one Python file.
- **shipcheck**, a release check that runs in Terminal, written in zsh.
- **Standup**, a SwiftUI window on the Mac.
- **Trailhead**, a SwiftUI iPhone app in the Simulator.

## What Lens labels

Each selection gets one label per component, such as
`expiring_section pantry.py:95`, `check_version shipcheck:40`,
`UpdateRow.body StandupView.swift:80` or `Hike.Difficulty Hike.swift:16`.
The text Lens matched is outlined in the label's color, so you can see
which words it read and which it left alone.

Lens works the same way in all three languages. It doesn't run the apps or
attach a debugger. It reads the text on screen and matches it against the
Code map, an index of the Project's source that Bigshot keeps on your Mac.

## Lens against a text search

The usual way to find this code is to search the repository for the words
on screen. Here is what `grep -rnF` finds in the demo folder for four lines
from the video, next to what Lens opens:

| On screen | Text search finds | Code Lens opens |
|---|---|---|
| "Release notes still mention the previous version" (shipcheck) | `shipcheck:42`, the right line | `check_version`, `shipcheck:40` |
| "Waiting on the signing certificate" (Standup) | `Team.swift:17`, the list the text is kept in | `UpdateRow.body` in `StandupView.swift`, where the row draws it, and `Team.swift` as where the text is kept |
| "Hard" (Trailhead) | 4 lines in 2 files: 3 are a variable named `showHardOnly`, 1 is the badge's text | `Hike.Difficulty` in `Hike.swift`, the badge's enum |
| "Expires in 2 days" (Pantry) | Nothing | `expiring_section` in `pantry.py` |

When the text is written in the code in one piece, as in shipcheck, a
search is as good as Lens. The other three are the common ways it falls
short:

- **The text is data.** A search finds the list the text is kept in, not
  the view that draws it. To change how the row looks, you need the view.
- **The text is short.** A one-word badge matches variable names and
  other words.
- **The text is built in code.** "Expires in 2 days" is an f-string with
  a number in it, so those words never appear in the source.

Across our larger benchmark of 20 apps in 20 stacks, the first search
match is the right line 34% of the time, and 16% of screen lines have no
literal match at all. Lens opens the right line, or the one next to it,
82% of the time. [The benchmarks post](https://www.bigshot.pics/blog/code-lens-benchmarks) has the
details.

## What the labels changed for Claude Code

We also wanted to know whether handing an agent the label speeds it up.
We gave Claude Code (Sonnet, headless, in a fresh copy of the demo folder)
two tasks, three runs each, with and without the label pasted under the
request:

- Standup: *make "Waiting on the signing certificate" bold.* With the
  label `UpdateRow.body StandupView.swift:90 (text kept in Team.swift:17)`.
- Pantry: *change "Expires in 2 days" to "2 days left", and "Expires
  tomorrow" to "1 day left".* With the label
  `expiring_section pantry.py:92`.

| Task | Tool calls | Time | Cost |
|---|---|---|---|
| Standup, request only | 3, 3, 3 | 14–16 s | $0.10 |
| Standup, with the label | 6, 6, 5 | 20–23 s | $0.11–0.12 |
| Pantry, request only | 3, 3, 3 | 13 s | $0.10 |
| Pantry, with the label | 3, 2, 2 | 10–14 s | $0.09–0.10 |

All twelve runs made the right edit. In a folder this small, Claude Code
finds the line on its own with one or two searches, so the label saves it
little. On Standup it cost time: the pointer to `Team.swift` led it to
read the data file and check which person was blocked before editing the
view.

We think this is the honest result for small projects. The label helps
an agent where a search doesn't: text that is built in code, short
words that match everywhere, and translations, in a repository too large
to read around in. That is the same split the benchmark shows. We haven't
measured agents on a large repository yet.

## What you get

- **One click from the screen to the line.** No search, no picking
  between matches. Set the editor in Settings › Code map, and a label
  opens that file at that line.
- **The line that draws the text.** For data lists and translations, Lens
  opens the component that renders the text and shows where the text is
  kept.
- **Any language with source on your Mac.** Web pages, Mac and iPhone
  apps, and scripts in a terminal. The video shows Python, zsh and
  SwiftUI.
- **Quiet on other apps.** Lens labels only code in the Active Project.
  On screens from 14 unrelated apps it labeled nothing, in 280 tests.
- **Local.** The Code map and the matching stay on your Mac.
- **Copy for Agent.** The result card puts the matches, with files and
  lines, on the clipboard as Markdown, ready to paste into Claude Code or
  Codex.

To see how the components on a page connect, [X-ray](https://www.bigshot.pics/blog/code-lens-xray)
draws the code behind each line of text under a loupe.

## Trying it

Code Lens is in the free version of Bigshot, with one Project. Add the
folder with your app's source as a Project, turn on **Map the code for
Code Lens**, and click **Lens** on the island. The
[Code Lens docs](https://www.bigshot.pics/docs/code-lens) cover the rest.
