add-performance-monitoring

add-performance-monitoring is a command for Claude Code from davepoon/buildwithclaude. It costs 4 tokens per session (7,623 once invoked), scanned A, original, MIT.

A command for planning and setting up application performance monitoring, which collects information about an application's speed, errors, requests, and resource use. The supplied plan includes Node.js and browser monitoring examples using New Relic.

In plain words
What is it for?
Use it to define performance indicators and service targets, assess monitoring needs, and configure application, browser, error, logging, and request monitoring.
Why use it?
It helps turn vague performance concerns into monitored user journeys, bottlenecks, targets, and alerts. It also identifies existing monitoring and integration needs before setup.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the all-commands plugin — 23 commands shipped together

Good fit Use it to define performance indicators and service targets, assess monitoring needs, and configure application, browser, error, logging, and request monitoring.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/davepoon/buildwithclaude/add-performance-monitoring
About the project

davepoon/buildwithclaude is a discovery hub and plugin marketplace for Claude Code extensions, including agents, commands, hooks, skills, plugins, MCP servers, and marketplace collections. Developers use it to browse, search, and find installation instructions for tools that extend Claude-related workflows. Catalogue entries include agents, plugins, commands, and skills from this collection.

davepoon/buildwithclaude · 3,439 stars · on GitHub · buildwithclaude.com

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/davepoon/buildwithclaude

Made for: Claude Code.

Or install all-commands, the plugin that ships this one along with the rest of its 23 commands.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for add-performance-monitoring

README.md
[![agentmods](https://agentmods.dev/badge/commands/davepoon/buildwithclaude/add-performance-monitoring/github.svg)](https://agentmods.dev/commands/davepoon/buildwithclaude/add-performance-monitoring)
Your own site
<a href="https://agentmods.dev/commands/davepoon/buildwithclaude/add-performance-monitoring"><img src="https://agentmods.dev/badge/commands/davepoon/buildwithclaude/add-performance-monitoring/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for add-performance-monitoring

Your own site · 80×15
<a href="https://agentmods.dev/commands/davepoon/buildwithclaude/add-performance-monitoring"><img src="https://agentmods.dev/badge/commands/davepoon/buildwithclaude/add-performance-monitoring.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 4 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 7,623 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00004 $0.07623
Opus 5 $0.00002 $0.03811
Sonnet 5 $0.00001 $0.01525
Haiku 4.5 $0.00000 $0.00762

Measured 7d ago against content hash 68f7be874006, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

add-performance-monitoring scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/all-commands/commands/add-performance-monitoring.md · 1,173 lines

How it starts

The opening of the file, as written. The whole thing — 1,173 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Add Performance Monitoring

Setup application performance monitoring

Instructions

  1. Performance Monitoring Strategy

    • Define key performance indicators (KPIs) and service level objectives (SLOs)
    • Identify critical user journeys and performance bottlenecks
    • Plan monitoring architecture and data collection strategy
    • Assess existing monitoring infrastructure and integration points
    • Define alerting thresholds and escalation procedures
  2. Application Performance Monitoring (APM)

    • Set up comprehensive APM monitoring:

    Node.js APM with New Relic:

    // newrelic.js
    exports.config = {
      app_name: [process.env.NEW_RELIC_APP_NAME || 'My Application'],
      license_key: process.env.NEW_RELIC_LICENSE_KEY,
      distributed_tracing: {
        enabled: true
      },
      transaction_tracer: {
        enabled: true,
        transaction_threshold: 0.5, // 500ms
        record_sql: 'obfuscated',
        explain_threshold: 1000 // 1 second
      },
      error_collector: {
        enabled: true,
        ignore_status_codes: [404, 401]
      },
      browser_monitoring: {
        enable: true
      },
      application_logging: {
        forwarding: {
          enabled: true
        }
      }
    };
    
    // app.js
    require('newrelic');
    const express = require('express');
    const app = express();
    
    // Custom metrics
    const newrelic = require('newrelic');
    
    app.use((req, res, next) => {
      const startTime = Date.now();
      
      res.on('finish', () => {
        const duration = Date.now() - startTime;
        
        // Record custom metrics
        newrelic.recordMetric('Custom/ResponseTime', duration);
        newrelic.recordMetric(`Custom/Endpoint/${req.path}`, duration);
        
        // Add custom attributes
        newrelic.addCustomAttributes({
          'user.id': req.user?.id,
          'request.method': req.method,
          'response.statusCode': res.statusCode
        });
      });
      
      next();
    });
    

    Datadog APM Integration:

    // datadog-tracer.js
    const tracer = require('dd-trace').init({
      service: 'my-application',
      env: process.env.NODE_ENV,
      version: process.env.APP_VERSION,
      logInjection: true,
      runtimeMetrics: true,
      profiling: true,
      analytics: true
    });
    
    // Custom instrumentation
    class PerformanceTracker {
      static startSpan(operationName, options = {}) {
        return tracer.startSpan(operationName, {
          tags: {
            'service.name': 'my-application',
            ...options.tags
          },
          ...options
        });
      }
    
      static async traceAsync(operationName, asyncFn, tags = {}) {
        const span = this.startSpan(operationName, { tags });
        
        try {
          const result = await asyncFn(span);
          span.setTag('operation.success', true);
          return result;
        } catch (error) {
          span.setTag('operation.success', false);
          span.setTag('error.message', error.message);
          span.setTag('error.stack', error.stack);
          throw error;
        } finally {
          span.finish();
        }
      }
    
      static trackDatabaseQuery(query, duration, success) {
        tracer.startSpan('database.query', {
          tags: {
            'db.statement': query,
            'db.duration': duration,
            'db.success': success
          }
        }).finish();
      }
    }
    
    // Usage example
    app.get('/api/users/:id', async (req, res) => {
      await PerformanceTracker.traceAsync('get_user', async (span) => {
        span.setTag('user.id', req.params.id);
        
        const user = await getUserFromDatabase(req.params.id);
        span.setTag('user.found', !!user);
        
        res.json(user);
      }, { endpoint: '/api/users/:id' });
    });
    

Read the full file on GitHub · 1,173 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 7d ago First seen · 1,173 lines · 4 tokens per session scan A 68f7be874006

Subscribe to this mod's changes

add-performance-monitoring is a command published in the GitHub repository davepoon/buildwithclaude (3,439 stars, last pushed 3d ago), licensed MIT. It adds 4 tokens to every session and 7,623 once invoked, about $0.0000 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-05.