Cairn

Unfamiliar code is terrain. Leave cairns.

A read-only
code reader
for macOS

Cairn marks the way through a codebase you didn’t write — symbols, callers, any commit in its history — shows the evidence for every step, and remembers the path so you can walk it again. When you want a second pair of eyes, a model you choose reads along through the same read-only tools. Nothing edits a line.

macOS 14+ · Apple silicon · Rust · Python · TypeScript · TSX · Go · MIT

Follow

Every jump shows its evidence

Click a symbol to see its callers, calls, implementations and references. Each result says how it was found — Cairn’s index or a language server such as rust-analyzer — and whether the file changed since.

Cairn reading harness.rs in knuth-rs, with three verified callers of after_tool_use in the Relations panel.

Overview

A file, distilled to its skeleton

Overview shows a Rust or Python file in source order: main-line functions keep their key statements, the rest shrink to one-line signatures. Line numbers stay the source’s; click one to land there. With a Jev key, TypeSafe’s Jev helps pick what stays.

Overview of harness.rs: a skeleton of its functions numbered with their source lines.

Ask AI

Ask the codebase, see what it read

Select code and press ⌘I, or ask in the AI panel. The model you configure reads only through Cairn’s read-only tools — files, search, symbols backed by the language server, Git history. Its steps fold into one line above the answer, and every cited line opens in the reader.

The AI panel answering a question about after_tool_use, with its eight reading steps expanded above the answer.

Guide

A guide to the file in front of you

The Guide panel writes how the open file is put together: its flows with step-by-step playback, the role of each part, a sequence diagram and questions worth asking next. Every code anchor is checked against the file’s real lines. Guides are kept locally and flagged when the file changes.

The Guide panel for hooks/registry.rs playing a flow; step 3 is selected in the reader.

Look back

Any commit, no checkout

Open a past commit as a read-only snapshot and compare it with the working tree side by side. Exact analysis follows you there, in a checkout Cairn owns; your repository is never touched.

hooks/types.rs in the working tree beside the same file at commit 864d216.

01 · Follow

Find callers and jump to definitions.

Most tools jump to a definition and hope. Cairn tells you who resolved it, whether the file changed since indexing — and says so plainly when it can’t know. Try it on real Rust code — pick a symbol.

knuth-rs⌥ main · fac975a Click an underlined symbol ↓
1060async fn handle_tool_finished(
1065) -> Result<(), AgentSessionError> {
1066 let Some((state, cancel)) = self.(&key) else {
⋯
1085 self.(
1086 key,
1087 InvocationState::Finalized {
1088 effective: effective.clone(),
1089 },
1090 )
1091 .await?;
⋯
1093 if cancel.is_cancelled() {
1094 let data = Err(HookError::Cancelled);
1095 return self.(key, data, ctx).await;
1096 }
⋯
1103 let hooks = Arc::clone(&self.config.hooks);
1104 let tool_call = effective.clone();
1105 let hook_ctx = self.(Some(key.invocation_id), cancel);
1106
1107 tokio::spawn(async move {
1108 let data = hooks.(&hook_ctx, tool_call, result).await;
⋯
1112 });
crates/knuth-agent/src/harness.rs:1108Exact: rust-analyzer · Safe mode

Real results from Cairn’s CLI and rust-analyzer on sonald/knuth-rs @ fac975a, Safe mode.

✓ Verified · Exact

Resolved by a language server

Optional rust-analyzer, Pyright, typescript-language-server and gopls results carry the provider and environment that produced them.

△ File changed since indexing

Drift is caught before the jump

Index-derived jumps check the target’s content identity first. If the file moved on, Cairn says so and offers Refresh Index.

○ deps unavailable (offline)

Gaps are shown, not smoothed over

When Safe Reading Mode blocks the network, that limitation is part of the result — not a silent miss.

02 · Look back

Browse Git commits
without checkout.

Every commit is a virtual snapshot. Open one and compare it side by side with the working tree — no checkout, no stash, no detached HEAD.

hooks/types.rs @ 864d216snapshot
hooks/types.rs @ mainfac975a

git status: clean — nothing was checked outReal history of HookContext in knuth-rs · ⌃⌘W closes a comparison

03 · Keep your bearings

Save and resume reading trails.

Reading code isn’t linear. Cairn keeps every branch of your exploration and brings it all back when the project reopens.

  1. ORIENT

    Jump anywhere

    ⌘P opens a file by name. Prefix @ for symbols in the file, # for the project, : for a line, > for a command.

  2. RETRACE

    A trail with branches

    ⌥⌘T shows the route you took. Restore an earlier node without discarding the sibling branches you explored.

  3. MARK

    Exact bookmarks

    ⌘⇧M anchors a line to its snapshot, with a note. Drifted content is labeled and re-anchored only when you say so.

  4. LEAVE A CAIRN

    Freeze a Reading Set

    Freeze results or a whole path. The Reading Set keeps its source and evidence, ready after a restart — next week, or for the next reader.

Leave no trace

Not an editor.
On purpose.

Point Cairn at code you don’t trust yet. It reads; it doesn’t write, build, or check out in your repo.

Base camp

Start with a codebase.
Leave with a mental model.

Download the 0.6.0 preview (macOS 14+, Apple silicon). It is ad‑hoc signed and not notarized, so on first launch right‑click Cairn.app and choose Open. Or build it yourself with Xcode 27.1, Homebrew’s libgit2 and a Rust toolchain from rustup.

RustPythonTypeScriptTSXGo

Read the build guide
# clone, build, open (Xcode 27.1 + rustup)
$ git clone https://github.com/sonald/cairn.git
$ cd cairn && brew install libgit2
$ CAIRN_LIBGIT2=brew bash scripts/make-app.sh
$ open .build/distribution/Cairn.app