{
  "markdown": "<div align=\"center\">\n  <img src=\"demo/preflight-logo.svg\" alt=\"Preflight\" width=\"96\" height=\"96\" />\n  <h1>Preflight</h1>\n  <p><strong>Observability for AI Coding Assistants</strong></p>\n\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue)](LICENSE)\n[![Node 22+](https://img.shields.io/badge/Node-22%2B-brightgreen)](.nvmrc)\n[![Local First](https://img.shields.io/badge/Local%20First-Offline%20by%20default-brightgreen)](#quick-start)\n[![Dashboards Included](https://img.shields.io/badge/Dashboards-7%20Included-blue)](#dashboards)\n\n[**Docs**](https://newrelic-experimental.github.io/preflight/) • [**What's New**](https://newrelic-experimental.github.io/preflight/whats-new/) • [**Examples**](examples/) • [**Community**](https://support.newrelic.com/s/) • [**Contributing**](CONTRIBUTING.md)\n\n</div>\n\n---\n\n## Why Your AI Tool Needs Observability\n\nYour AI coding assistant makes hundreds of decisions every session — what to read, what to edit, when to run commands. But you can't see any of it. You know it was fast, but was it _efficient_? You got a PR merged, but how much did it cost? You fixed a bug, but did it get stuck in a loop first?\n\n**Preflight is observability for agentic coding** — the actions, cost, and efficiency of your AI coding assistant as it works. See exactly what's happening, how much it costs, and where your AI is wasting time.\n\n**Local-first by design.** Preflight runs entirely on your machine and sends your data nowhere by default. A live dashboard at `localhost:7777` shows your sessions in real time, fully offline. Connect a New Relic account only when you want more — team rollups, alerting, and cross-session history. You choose: **local-only**, **New Relic**, or **both**.\n\n---\n\n## Demo\n\n![Preflight dashboard animation](demo/preflight-readme.gif)\n\nSee cost breakdown, efficiency scoring, anti-patterns, and live session tracking in action.\n\n---\n\n## What You Get\n\n### Visibility\n\n- **Every action captured** — file reads, edits, commands, searches\n- **Live session dashboard** — see what's happening right now\n- **Historical trends** — analyze patterns over weeks and months\n\n### Cost Control\n\n- **USD spend tracking** — per session, day, and week\n- **Per-model and cache breakdown** — know which models cost most and how efficiently context is reused\n- **Budget alerts** — get notified before you overspend\n- **Forecasting** — project monthly burn rate\n\n### Efficiency Insights\n\n- **Efficiency score** — 0–100 score per task, based on how directly the AI worked\n- **Anti-pattern detection** — catches re-reads, blind edits, stuck loops\n- **Personalized recommendations** — optimize your AI workflow\n- **Weekly coaching reports** — narrative analysis vs. your historical baseline\n\n### Dashboards\n\n- **Local dashboard** — live session view at `localhost:7777`, no account required\n- **8 pre-built New Relic dashboards** — deploy in seconds _(New Relic mode)_:\n  - **Overview** — session stats, cost summary, top tools\n  - **Personal** — 30-day self-reflection scoped to you\n  - **Session Detail** — deep-dive into a single session's tool calls\n  - **Team View** — aggregated cost and efficiency across developers\n  - **Manager View** — high-level team metrics, no tool-call content\n  - **Adoption & Cost** — adoption momentum, spend, MCP usage, and per-developer outcomes for engineering managers\n  - **Platform Comparison** — Claude Code vs. Cursor vs. Windsurf, etc.\n  - **Security Audit** — audit trail of sensitive file access\n\n---\n\n## Quick Start\n\n### 1. Install\n\n```bash\nnpm install -g @newrelic/preflight\n```\n\n> **Using [Smithery](https://smithery.ai)?** Installing Preflight from the Smithery MCP registry wires up the MCP server for you, but Smithery has no mechanism to write Claude Code hooks. After install, ask Claude Code to call the `nr_observe_install_hooks` MCP tool (it will offer to do this automatically once `nr_observe_health` reports `setup_required: true`), then restart Claude Code to activate monitoring.\n\n### 2. Run setup\n\n```bash\npreflight setup\n```\n\nThe wizard defaults to **local mode** — press Enter through the prompts and you're set. It wires Preflight into your AI tool (hooks + MCP server) and writes config to `~/.newrelic-preflight/`. Takes under a minute, no account required.\n\n> **Using GitHub Copilot?** The wizard also asks to install Copilot hooks — saying yes configures both the Copilot CLI and VS Code Copilot Chat automatically (hooks, MCP registration, and the fix for VS Code's hook double-capture), so Copilot gets the same tool-call and cost metrics Claude Code does. Run it standalone anytime with `preflight install --copilot`. See [docs/ADAPTERS.md](./docs/ADAPTERS.md#github-copilot-copilot) for details.\n\nWhen prompted, pick a mode:\n\n| Mode                  | What it does                                                         | New Relic account? |\n| --------------------- | -------------------------------------------------------------------- | ------------------ |\n| **local** _(default)_ | Everything stays on your machine; live dashboard at `localhost:7777` | Not needed         |\n| **cloud**             | Ships telemetry to New Relic                                         | Required           |\n| **both**              | Local dashboard **and** New Relic                                    | Required           |\n\n### 3. Start coding\n\nRestart your AI tool — hooks and the MCP server load at session start. Every tool call is captured automatically. Open **http://localhost:7777** to watch your session live.\n\n> **Using Kiro?** Add Preflight as a [Kiro Power](docs/KIRO_POWER.md) for the\n> `nr_observe_*` query tools — see the doc for install steps and how to add\n> automatic tool-call capture on top.\n\n> **Using Claude Code?** You can skip the npm install above and add Preflight as a [Claude Code plugin](docs/PLUGIN.md) instead:\n>\n> ```\n> /plugin marketplace add newrelic-experimental/preflight\n> /plugin install newrelic-preflight@newrelic-preflight-marketplace\n> ```\n\n### Other ways to install\n\n**Cursor** — [Add to Cursor](https://cursor.com/en/install-mcp?name=newrelic-preflight&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBuZXdyZWxpYy9wcmVmbGlnaHQiLCItLXN0ZGlvIl19) installs the MCP server via a one-click deeplink; run `preflight setup` afterwards for hook capture.\n\n---\n\n## Works With\n\n**Claude Code** • **Cursor** • **Windsurf** • **GitHub Copilot** • **Zed** • **Continue.dev** • **Amazon Q Developer** • **Amazon Kiro**\n\nCoverage isn't uniform — some platforms capture every built-in tool call, others (Zed, Continue.dev) only see calls routed to Preflight's own MCP tools. See [ADAPTERS.md](docs/ADAPTERS.md) for what each platform can and can't observe, and per-platform setup steps.\n\n---\n\n## Connect New Relic (optional)\n\nLocal mode is fully featured on its own. Connect a New Relic account to unlock:\n\n- **Team & manager dashboards** across multiple developers\n- **Alerting** on cost spikes, low efficiency, and stuck loops\n- **Cross-session history**, trends, and weekly coaching reports\n\nRe-run `preflight setup` and choose **cloud** or **both**, or configure it non-interactively:\n\n```bash\npreflight install \\\n  --mode cloud \\\n  --license-key YOUR_LICENSE_KEY \\\n  --account-id YOUR_ACCOUNT_ID\n```\n\nEU accounts add `--eu`. FedRAMP accounts add `--fedramp`. Japan accounts add `--jp`.\n\nThen deploy the prebuilt dashboards:\n\n```bash\nNEW_RELIC_API_KEY=NRAK-... NEW_RELIC_ACCOUNT_ID=12345 \\\n  preflight deploy-dashboards --all\n```\n\nYou'll need a **license key** (telemetry ingest) and your **account ID**, plus a **user API key** (`NRAK-…`) to deploy dashboards and alerts. See [ADVANCED.md](docs/ADVANCED.md) for alerts, OTLP export to other backends, and Terraform.\n\n> **No dashboard until you run `deploy-dashboards`.** Cloud mode ships telemetry to New Relic as soon as it's configured, but nothing creates a dashboard automatically — that's the separate step above, and it needs a **different** credential (a user API key, not your license key). Until you run it, there's no UI to look at. In the meantime, query the raw events directly in New Relic's **Query Builder**, e.g.:\n>\n> ```sql\n> SELECT * FROM AiToolCall SINCE 1 hour ago\n> ```\n>\n> Once `deploy-dashboards` succeeds, find the dashboards under your New Relic account's **Dashboards** section.\n\n> **Data ingest note:** Telemetry sent to New Relic counts against your account's data ingest. On paid plans, standard ingest rates apply. Monitor your usage under **NR One → Data Management → Data Ingestion**.\n\n---\n\n## Requirements\n\n### Required\n\n- **Node.js v22 or higher** ([get it](https://nodejs.org) or use [nvm](https://github.com/nvm-sh/nvm))\n- **An AI coding tool** (Claude Code recommended for deepest integration)\n\n### Optional\n\n- **New Relic account** — only for `cloud`/`both` mode. Skip it to run local-only (the default).\n- **User API key** (`NRAK-…`) — only needed to deploy dashboards and alerts\n\n---\n\n## Other Commands\n\n```bash\npreflight doctor               # Run 10 diagnostic checks and print actionable fix commands\npreflight validate             # Check config for syntax errors and unknown keys\npreflight update               # Pull latest version, rebuild, and offer to restart a running dashboard (source installs only — npm installs: npm install -g @newrelic/preflight@latest)\npreflight local                # List running --local dashboard processes and live --stdio MCP processes\npreflight local --clean        # Kill orphaned --local processes and --stdio processes with a missing binary (prompts for confirmation)\npreflight uninstall            # Remove hooks and MCP config (prompts with a summary first)\npreflight uninstall --yes      # Skip the confirmation prompt (for scripts and CI)\npreflight uninstall --daemon   # Remove only the background dashboard daemon\n```\n\nAdd `--project` to `install`/`uninstall` to scope changes to the current directory only.\n\n**WSL users:** `preflight setup` will ask which Claude Code you're running. You can also set it explicitly:\n\n- `--windows-cc` — Windows Claude Code (the desktop app); uses `wsl.exe` hooks and Windows paths\n- `--linux-cc` — Linux Claude Code installed via npm inside WSL\n\n---\n\n## Documentation\n\n- [**ADVANCED.md**](docs/ADVANCED.md) — Configuration, dashboards, alerts, Terraform\n- [**SCORECARDS.md**](docs/SCORECARDS.md) — New Relic Scorecard rules for team attribution\n- [**ARCHITECTURE.md**](docs/ARCHITECTURE.md) — Data flow, component reference, and operating modes\n- [**ADAPTERS.md**](docs/ADAPTERS.md) — Per-platform integration mechanism, setup steps, and known gaps\n- [**TROUBLESHOOTING.md**](docs/TROUBLESHOOTING.md) — Common setup and connection problems, and how to fix them\n- [**CONTRIBUTING.md**](CONTRIBUTING.md) — Development, testing, submitting PRs\n- [**SECURITY.md**](./SECURITY.md) — Security guidelines and best practices\n- [**PRIVACY.md**](./PRIVACY.md) — Data collection inventory and pre-cloud checklist\n\n---\n\n## From Source\n\nDevelop, test, or run the latest unreleased version:\n\n```bash\ngit clone https://github.com/newrelic-experimental/preflight\ncd preflight\nnvm use              # Switch to Node v24\nnpm install          # Install dependencies\nnpm run build        # Compile TypeScript\nnpm link             # Register preflight on PATH\n```\n\nThen run `preflight setup` as usual.\n\n---\n\n## License\n\nPreflight is open source under the [Apache License 2.0](LICENSE).\n\n---\n\n## Contributing\n\nWe welcome contributions! See [CONTRIBUTING.md](CONTRIBUTING.md) for how to get started. Join the [New Relic Community](https://support.newrelic.com/s/) to share ideas, ask questions, or discuss features.\n\n---\n\n<div align=\"center\">\n  <p><strong>Built by New Relic • Designed for developers who use AI</strong></p>\n</div>\n",
  "bytes": 11722,
  "sha": "ccf65dfc8abd8e11b5ead2b17e104266fa475e4ec1c072248b9100b4817cfe1b",
  "repo_slug": "newrelic-experimental/preflight",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_newrelic_experimental_prefligh_93726194/readme"
}