vercel

Detect Agent — Development skill for Claude Code

Development community

Agent detection definitions and lightweight utility.

How to install Detect Agent

This entry records only its repository, not the path inside it, so there is no exact command to give. Open vercel/detect-agent and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Detect Agent does

Agent detection definitions and lightweight utility.

Alternatives in Development

  • Crypto Research Haiku Command — Execute lightweight cryptocurrency research by calling only haiku versions of crypto analysis agents in parall 3.4k ★
  • Zerostack — Lightweight coding agent written in Rust, optimized for memory footprint and performance 1.7k ★
  • Claude Auto Resume — A shell script utility that automatically resumes Claude CLI tasks when usage limits are lifted 732 ★

README

detect-agent

A lightweight utility for detecting if code is being executed by an AI agent or automated development environment.

Installation

**JavaScript / TypeScript**

npm install detect-agent

**Go**

go get github.com/vercel/detect-agent

Usage

**JavaScript / TypeScript**

import { determineAgent } from 'detect-agent';

const { isAgent, agent } = await determineAgent();

if (isAgent) {
  console.log(`Running in ${agent.name} environment`);
  // Adapt behavior for AI agent context
}

**Go**

import (
    "errors"
    detectagent "github.com/vercel/detect-agent"
)

agent, err := detectagent.Detect()
if errors.Is(err, detectagent.ErrAgentNotFound) {
    // not running inside an agent
} else if err != nil {
    log.Fatal(err)
} else {
    fmt.Printf("Running in %s environment\n", agent.Name)
}

Agent Definitions

The agent detection rules live in [`agents.json`](https://raw.githubusercontent.com/vercel/detect-agent/main/agents.json), validated against [`agents.schema.json`](https://raw.githubusercontent.com/vercel/detect-agent/main/agents.schema.json).

[!NOTE] You can use these definitions two ways: install the [npm package](https://www.npmjs.com/package/detect-agent) for a ready-to-use API, **or** consume the JSON file directly from GitHub if you're not in a JavaScript environment or want to build your own detection logic:

https://raw.githubusercontent.com/vercel/detect-agent/main/agents.json

Supported Agents

This package can detect the following AI agents and development environments:

  • Cursor (Anysphere)
  • Claude Code (Anthropic)
  • Claude Cowork (Anthropic)
  • Kimi Code (Moonshot AI)
  • Grok Build (xAI)
  • Devin (Cognition Labs)
  • Gemini CLI (Google)
  • Codex (OpenAI)
  • Antigravity (Google DeepMind)
  • Augment
  • Cline
  • OpenCode
  • OpenClaw
  • Goose (Block)
  • Junie (JetBrains)
  • Kiro (AWS)
  • Pi
  • **GitHub Copil