uisnap - UI state snapshot for coding agents

Pulling in the full DOM and console logs is not a good use of tokens. Capture the browser state once, then let your agent write queries against it.

npm install -g uisnap

The package offers two sets of commands: capture commands and analyze commands.

Capture Commands

Captured data is stored in timestamped snapshot directories for later analysis.

Analyze Commands

Why?

Context efficiency, basically. I got tired of copying from the console. Tried Playwright MCP, which worked great, but super wasteful on tokens. Why read the whole thing when the agent can grep/jq or write SQL?

Manual


User: There was an error.

Agent: What's the stack trace?
User: [copies stack trace from browser]

Agent: Can you check if analytics.js loaded?
User: [checks Network tab, reports back]

Agent: What's the order of script tags?
User: [inspects DOM, copies HTML]

→ User is stuck in the loop, manually gathering data.

Playwright MCP

User: "Fix the console errors on myapp.com"

Agent: Let me fetch the page...
  → Loads full DOM (15,000 tokens)
  → Parses all console logs (8,000 tokens)
  → Analyzes network tab (5,000 tokens)

  ... that's a lot of tokens

With uisnap

User: "Fix the console errors on myapp.com"

Agent: Capturing page state...
  $ uisnap snapshot https://myapp.com
  $ uisnap-analyze-console snapshots/myapp.com/latest/console.jsonl

→ Agent sees: ERR_BLOCKED_BY_CLIENT in tracker.js

Agent: Let me check the script load order...
  $ grep -A5 "tracker.js" snapshots/myapp.com/latest/network.jsonl

Agent: And find the analytics script tag...
  $ grep "analytics" snapshots/myapp.com/latest/a11y.yaml

Agent: Found the issue. Script order is wrong.
  [Makes edit to index.html]

Agent: Verifying the fix...
  $ uisnap snapshot https://myapp.com
  $ uisnap-analyze-console snapshots/myapp.com/latest/console.jsonl


→ Agent used grep/jq/CLI tools autonomously
→ Each query: ~200 tokens (local files)
→ Total: ~2,000 tokens