Track, display, filter, and analyze Claude Code agent activity.

Install

/plugin install agentarium@tbosak

Run it inside Claude Code after adding the marketplace with /plugin marketplace add TBosak/cc-marketplace.

Contents

Discovered from source

Agents 2

Default to using Bun instead of Node.js.

  • Use bun <file> instead of node <file> or ts-node <file>
  • Use bun test instead of jest or vitest
  • Use bun build <file.html|file.ts|file.css> instead of webpack or esbuild
  • Use bun install instead of npm install or yarn install or pnpm install
  • Use bun run <script> instead of npm run <script> or yarn run <script> or pnpm run <script>
  • Bun automatically loads .env, so don't use dotenv.

APIs

  • Bun.serve() supports WebSockets, HTTPS, and routes. Don't use express.
  • bun:sqlite for SQLite. Don't use better-sqlite3.
  • Bun.redis for Redis. Don't use ioredis.
  • Bun.sql for Postgres. Don't use pg or postgres.js.
  • WebSocket is built-in. Don't use ws.
  • Prefer Bun.file over node:fs's readFile/writeFile
  • Bun.$ls instead of execa.

Testing

Use bun test to run tests.

import { test, expect } from "bun:test";

test("hello world", () => {
  expect(1).toBe(1);
});

Frontend

Use HTML imports with Bun.serve(). Don't use vite. HTML imports fully support React, CSS, Tailwind.

Server:

import index from "./index.html"

Bun.serve({
  routes: {
    "/": index,
    "/api/users/:id": {
      GET: (req) => {
        return new Response(JSON.stringify({ id: req.params.id }));
      },
    },
  },
  // optional websocket support
  websocket: {
    open: (ws) => {
      ws.send("Hello, world!");
    },
    message: (ws, message) => {
      ws.send(message);
    },
    close: (ws) => {
      // handle close
    }
  },
  development: {
    hmr: true,
    console: true,
  }
})

HTML files can import .tsx, .jsx or .js files directly and Bun's bundler will transpile & bundle automatically. <link> tags can point to stylesheets and Bun's CSS bundler will bundle.

<html>
  <body>
    <h1>Hello, world!</h1>
    <script type="module" src="./frontend.tsx"></script>
  </body>
</html>

With the following frontend.tsx:

import React from "react";

// import .css files directly and it works
import './index.css';

import { createRoot } from "react-dom/client";

const root = createRoot(document.body);

export default function Frontend() {
  return <h1>Hello, world!</h1>;
}

root.render(<Frontend />);

Then, run index.ts

bun --hot ./index.ts

For more information, read the Bun API docs in node_modules/bun-types/docs/**.md.

Agentarium

Track, display, filter, and analyze Claude Code agent activity.

Features

  • Agent Activity Tracking: Automatically tracks all tool uses, agents, and subagents via Claude Code hooks
  • SQLite Database: Persistent storage of all activity data
  • MCP Server: Query agent activity programmatically from Claude Code
  • Web Dashboard: React-based UI with filterable timeline and analytics

Usage

Installation

  1. Install Bun: https://bun.sh/
  2. In Claude Code, enter "/plugin marketplace add TBosak/cc-marketplace" to add the marketplace plugin.
  3. Then enter "/plugin install agentarium@tbosak" to install Agentarium.
  4. Install tracking hooks and initialize database by starting a session with the plugin enabled.
  5. Restart Claude Code to ensure hooks are active and that dashboard is accessible.

Dashboard

Start the web dashboard:

bun run dashboard

Or run the dev server:

bun run dev

Quick Stats

View statistics in terminal:

bun run stats

Architecture

agentarium/
├── hooks/           # Claude Code hooks for tracking
│   ├── pre-tool.ts      # Tracks tool use starts
│   ├── post-tool.ts     # Tracks tool use completions
│   ├── session-start.ts # Tracks session starts
│   ├── session-end.ts   # Tracks session ends
│   ├── stop.ts          # Tracks turn completions
│   └── subagent-stop.ts # Tracks subagent completions
├── lib/             # Shared libraries
│   ├── database.ts      # SQLite database operations
│   └── context.ts       # Runtime context management
├── mcp/             # MCP server
│   └── server.ts        # MCP tools for querying data
├── ui/              # React dashboard
│   ├── server.ts        # Hono server
│   └── src/
│       └── index.tsx    # Dashboard UI
├── commands/        # CLI commands
│   ├── open-dashboard.ts
│   └── show-stats.ts
└── plugin.json      # Claude Code plugin manifest

MCP Tools

Hook Management

  • agentarium_install_tracking - Install all tracking hooks to project settings
  • agentarium_uninstall_tracking - Remove Agentarium hooks from project
  • agentarium_check_tracking - Check if tracking is installed
  • agentarium_list_project_hooks - List all hooks in project settings

Data Queries

  • agentarium_get_sessions - List tracked sessions
  • agentarium_get_agents - Get agents/subagents
  • agentarium_get_tool_uses - Query tool usage with filters
  • agentarium_get_events - Get tracked events
  • agentarium_get_analytics - Get usage statistics
  • agentarium_get_timeline - Unified timeline view
  • agentarium_query_db - Custom SQL queries (read-only)

Database Schema

The SQLite database stores:

  • sessions: Claude Code sessions
  • agents: Agents and subagents with parent relationships
  • tool_uses: All tool invocations with timing and results
  • events: Custom events (agent start/stop, etc.)

License

MIT

MCP servers 1

Sponsors

Details

Marketplace
TBosak/cc-marketplace
Source
plugins/agentarium
Category
Community