Put your view tree under the scope β SwiftUI included.
An open-source runtime view inspector for UIKit, AppKit and SwiftUI. Your app serves a browser viewer over loopback β browse the unified tree, inspect properties, see snapshots and an exploded 3D view, and edit live.
A free, open alternative to Lookin β with first-class SwiftUI inspection.
Everything you need to inspect a running app
Unified hierarchy tree
UIKit/AppKit views, SwiftUI nodes and CALayers in one tree, colour-coded by framework, with search, filtering and keyboard navigation.
Open SwiftUI inspection
Recovers the real declaration tree β VStack, Text content, modifiers, @State β using only public reflection.
Exploded 3D canvas
Wireframes + rendered snapshots, drag-to-orbit 3D with angle & depth controls, zoom/pan, and click-to-select synced with the tree.
Live editing
Change alpha, hidden, corner radius, colours, text and layer properties β on views and CALayers β and watch the app update.
Zero-install viewer
The app hosts the viewer itself over loopback HTTP + WebSocket. Open a URL in any browser β nothing to install, easy to share.
Debug-only, no deps
The embedded server is built on Network.framework + CryptoKit only β no third-party code enters your app, and it's excluded from Release.
CLI, Python & MCP for agents
treescope screenshot lets a coding agent see the whole screen; tree/find/inspect/set drive the hierarchy. Ships as an npm CLI, a pip install treescope-cli Python client, an MCP server, and a ready Claude Code skill.
See the layers, literally.
Toggle the exploded 3D view to fan the hierarchy out in depth. Drag to orbit, tune the X/Y angle and layer spacing, and the selected node stays in sync with the tree and inspector.
- β Drag to orbit Β· β₯-drag to pan Β· β-scroll to zoom
- β Per-axis angle sliders + depth control
- β Rendered snapshots layered in 3D
Let an agent see your UI
The same in-app server powers a CLI, a Python client and an MCP server. Claude Code and friends can screenshot the screen, walk the hierarchy, find views and live-edit β no browser needed.
Register the MCP server
One line β Node or Python, no local build:
# Node (npm)
claude mcp add treescope -- npx -y treescope-cli mcp
# Python (PyPI)
pip install treescope-cli
claude mcp add treescope -- treescope mcp
Tools: screenshot Β· get_tree Β· find_nodes Β· inspect_node Β· get_snapshot Β· set_attribute Β· status.
β¦or drive the CLI directly
A typical agent loop:
treescope status # is the app reachable?
treescope screenshot -o ui.png # SEE the whole screen
treescope tree --depth 3 # token-friendly hierarchy
treescope find LoginButton # locate a node β #obj:42
treescope inspect obj:42 # properties + editable keys
treescope set obj:42 alpha 0.5 # live-edit, then re-screenshot
π οΈ A ready-made Claude Code skill
Drop .claude/skills/treescope/ into your project and your agent learns the whole loop β
status β screenshot β tree/find β inspect β set β plus how to start the server and recover
when the app isn't running.
Quick start
Three steps to inspect your running app.
-
1
Add the package (Debug only)
Add Treescope to your
Package.swiftdependencies:.package(url: "https://github.com/everettjf/treescope", from: "0.1.0") // target dependency: .product(name: "TreescopeServer", package: "treescope") -
2
Start the server early
Guard it for Debug builds so it never ships in Release:
import TreescopeServer #if DEBUG Treescope.start() // serves http://127.0.0.1:50067 #endif -
3
Open the viewer
Run your app (Simulator or Mac), then open the URL in any browser:
open http://127.0.0.1:50067The iOS Simulator shares the host network stack, so loopback reaches the app.
On a physical device? Forward over USB
The server listens on 127.0.0.1 only. On a real iPhone/iPad that loopback is the
device, not your Mac β so tunnel it over USB with iproxy
(from libimobiledevice):
brew install libimobiledevice
# with the device plugged in over USB and the app running:
iproxy 50067 50067 # Mac:50067 β device 127.0.0.1:50067
open http://127.0.0.1:50067 # inspect it from your Mac browser
iproxy tunnels through usbmuxd to the device's loopback, so no app changes
are needed. Leave it running for the session.
Try it in 30 seconds
Clone and run the bundled demo:
git clone https://github.com/everettjf/treescope
cd treescope
swift run TreescopeDemo # a sample app that embeds the server
open http://127.0.0.1:50067 # inspect it
How it works
Capture
A debug-only engine walks UIWindow/NSWindow β views β layers, and reflects SwiftUI by opening any View with Mirror.
Serve
A tiny loopback HTTP + WebSocket server streams the tree, snapshots and edits β built on Apple frameworks only.
Inspect
A React viewer renders the tree, 3D canvas and property inspector β in any browser, no install.
Read more in the README Β· contribute via CONTRIBUTING.md
Open source. Built from scratch.
MIT licensed. Built from scratch β no code copied from other inspectors. Contributions welcome.
Star Treescope on GitHub