Attach sources

Shell tee, Chromium CDP, and observe-only Cursor / Claude hooks into one hub.

mzp attach <target> feeds sources into the same ring buffer as stdin pipes. Capture once; browse in the UI and let agents search without re-running the underlying work.

Bare mzp attach is shell (backward compatible).

TargetMechanismDefault service
shellShell rc hooks tee stdout/stderr from new interactive zsh/bashabsolute cwd / --service
browserForeground CDP session (console, exceptions, network)page location.host
cursorMerge observe-only hooks into ~/.cursor/hooks.jsoncursor
claudeMerge observe-only hooks into ~/.claude/settings.jsonclaude / --service
mzp attach
mzp attach shell --service my-project
mzp attach browser --launch
mzp attach cursor
mzp attach claude --service agents
mzp detach                 # shell
mzp detach cursor          # or: claude | all
mzp hub start|stop|restart

Shell

Installs markers in ${ZDOTDIR:-$HOME}/.zshrc, ~/.bashrc, and a bash login file (# >>> mizpah >>># <<< mizpah <<<). Starts a background hub if needed. New interactive shells tee stdout/stderr to /api/ingest/batch.

Enriched fields:

Constraints
  • Captures inherited stdout/stderr only (not /dev/tty TUIs, not typed input)
  • Children see pipes instead of a TTY (colors, buffering, interactivity may change)
  • If the hub is down, capture is best-effort; the shell stays responsive
  • Shells already open at first attach need a new tab/window
  • mzp detach leaves hooks installed but makes __shell-init a no-op; delete the marker blocks to remove entirely

Browser

mzp attach browser (alias mzp browser attach) connects to Chromium DevTools Protocol and forwards:

mzp attach browser --launch          # separate Mizpah Chrome profile
mzp browser attach --cdp-port 9222   # existing debug port

Example CEL:

source == "browser" && kind == "console" && level == "error"
kind == "network" && status >= 400
service == "localhost:5173"
Constraints
  • Needs a debugging port, or --launch (not your default profile cookies/extensions)
  • Cannot inject into an already-running normal Chrome without restarting with --remote-debugging-port
  • --all-network includes static asset metadata
  • Bodies/headers may contain secrets; hub is local but treat the stream as sensitive (storage security)
  • Foreground; Ctrl-C stops forwarding (launched browser stays open). No detach browser.

Cursor / Claude hooks

Observe-only lifecycle hooks. Always exit 0 with empty stdout (never block or mutate the agent). Events are JSON with source, kind, level, msg, plus original hook fields. Strings larger than 64 KiB are truncated.

mzp attach cursor
mzp attach claude
# use the agent…
mzp detach cursor
mzp detach claude
source == "cursor" && kind == "afterShellExecution"
source == "claude" && kind == "PreToolUse"
source == "claude" && level == "error"
Constraints
  • Prompts, file contents, shell output, and thoughts may be ingested
  • Cursor cloud agents ignore ~/.cursor/hooks.json (project .cursor/hooks.json only)
  • Re-run attach after moving the mzp binary so absolute hook paths stay valid
  • Intentionally skipped: Cursor Tab hooks; Claude MessageDisplay, WorktreeCreate, FileChanged