Everything you need to set up and use AgentLens.
AgentLens is an audit trail for AI agents. It captures every tool call your agent makes and explains it in plain English in real time.
Works with Claude Desktop, Claude Code, Cursor, Cline, and any MCP-compatible agent. See every file read, every command run, every file written — as it happens.
Sign up at agentlens.dev
Copy your API key from Settings
Run the setup command:
npx agentlens-cli setup-all --api-key YOUR_KEY --app-id YOUR_IDRestart your agents
Done — check your dashboard
AgentLens sits between your AI agent and its tools. When your agent calls a tool (read a file, run a command, write code), AgentLens captures the call, sends it to the dashboard, and an AI explainer generates a plain-English summary with a severity rating.
npx agentlens-cli setup \
--api-key YOUR_KEY \
--app-id YOUR_APP_IDThis automatically edits your claude_desktop_config.json file. Restart Claude Desktop after running.
Mac: ~/Library/Application Support/Claude/
Windows: %APPDATA%\Claude\
Linux: ~/.config/Claude/
npx agentlens-cli setup-hooks \
--api-key YOUR_KEY \
--app-id YOUR_APP_ID \
--agent claude-codeInstalls a PostToolUse hook that logs every tool call. Restart Claude Code after running.
POST directly to the AgentLens API from any language or framework. No SDK installation needed.
POST https://agentlens.vercel.app/api/ingest
Header: x-api-key: YOUR_KEY{
"tool_name": "write_file",
"arguments": { "path": "/src/app.js" },
"result": { "success": true },
"session_id": "your-session-uuid",
"app_id": "your-app-uuid",
"ai_model": "gpt-4",
"llm_reasoning": "optional context"
}{ "success": true, "event_id": "uuid" }await fetch(
'https://agentlens.vercel.app/api/ingest',
{
method: 'POST',
headers: {
'x-api-key': 'YOUR_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
tool_name: 'write_file',
arguments: { path: '/src/app.js' },
result: { success: true },
session_id: crypto.randomUUID(),
app_id: 'YOUR_APP_ID',
ai_model: 'gpt-4'
})
}
)import requests, uuid
requests.post(
'https://agentlens.vercel.app/api/ingest',
headers={'x-api-key': 'YOUR_KEY'},
json={
'tool_name': 'write_file',
'arguments': {'path': '/src/app.js'},
'result': {'success': True},
'session_id': str(uuid.uuid4()),
'app_id': 'YOUR_APP_ID',
'ai_model': 'gpt-4'
}
)npx agentlens-cli setup-all --api-key YOUR_KEY --app-id YOUR_IDAuto-detects and configures all AI agents on your machine. Supports Claude Desktop, Claude Code, Cursor, Cline, Windsurf, Antigravity.
npx agentlens-cli listShows which agents are connected to AgentLens with configured hooks or MCP entries, along with masked API key previews.
npx agentlens-cli detectScans your machine for installed AI agents and shows what's found.
npx agentlens-cli setup --api-key KEY --app-id IDConfigure Claude Desktop only (MCP interceptor).
npx agentlens-cli setup-hooks --api-key KEY --app-id ID --agent claude-codeConfigure a specific agent's hooks manually.
npx agentlens-cli daemon startStart background watchdog. Auto-heals config, flushes offline queue every 5 minutes.
npx agentlens-cli daemon stopStop the background watchdog.
npx agentlens-cli daemon statusCheck watchdog health, configured agents, and queue status.
npx agentlens-cli queue statusSee how many events are queued while offline.
npx agentlens-cli queue flush --api-key KEY --app-id IDManually send all queued events to the dashboard.
npx agentlens-cli queue clearDelete all queued events without sending.
npx agentlens-cli verifyCheck all config files and test API key connectivity. Useful for debugging setup issues.
npx agentlens-cli uninstallRemove AgentLens from all agents, stop daemon, clean up local files.
AgentLens is configured through CLI flags at setup time. There is no separate config file to manage.
--api-key Your AgentLens API key (from Settings page)
--app-id Your app UUID (from Settings page)
--agent Target agent (claude-code, cursor, cline) — only for setup-hooks
You can also set credentials via environment variables instead of CLI flags:
export AGENTLENS_API_KEY=your-key
export AGENTLENS_APP_ID=your-app-id{
"tool_name": "string", // tool that ran
"arguments": {}, // tool input
"result": {}, // tool output
"before_snapshot": {}, // file state before
"session_id": "string", // groups events
"app_id": "string", // your app UUID
"ai_model": "string", // which AI ran this
"seq": 0, // event order
"llm_reasoning": "string" // optional context
}The main endpoint for sending events to AgentLens.
Endpoint
POST https://agentlens.vercel.app/api/ingestRequired Header
x-api-key: YOUR_KEYBody Fields
tool_name — required, string
arguments — tool input, object
result — tool output, object
session_id — groups events (auto-generated if missing)
app_id — your app UUID
ai_model — e.g. gpt-4, claude-code, gemini
All API requests require an x-api-key header. Get your API key from the Settings page after creating an app.
API keys are tied to a specific app. Each app has its own key. You can regenerate a key at any time — the old key is immediately revoked.
| Limit | Value |
|---|---|
| Requests per minute | 100 per API key |
| Rate limit response | 429 |
| Retry after | 60 seconds |
Read operations, information gathering — list_directory, read_file, search
Write operations, new file creation — create_file, write_file (new file), move_file, install_package
Overwrites, deletions, irreversible changes — write_file (overwrite existing), delete_file, run_command with rm/drop/truncate
Explanation failed or timed out. You can retry from the event card.
The Sessions page shows all captured agent sessions. Each session is a group of tool calls from a single agent run.
Click a session to see the event timeline — a chronological list of every tool call with plain-English explanations, severity badges, and expandable before/after diffs.
Use the filter bar to search by keyword, severity level, or date range. The stats bar shows total sessions, events today, destructive events, and active apps at a glance.
Every session has a unique URL. Click the "Share session" button on any session detail page to copy the link.
Session URLs use unguessable UUIDs, so they act as share tokens. Anyone with the link can view the session — no login required.
| Feature | Free | Pro ($29/mo) | Enterprise ($99/mo) |
|---|---|---|---|
| Apps | 1 | 5 | Unlimited |
| Events / month | 500 | Unlimited | Unlimited |
| History | 7 days | 90 days | 365 days |
| Email alerts | No | Yes | Yes |