api

An API and data-flow debugging command for tracing information from a user interface through caching, server routes, services, and SQLite or JSONL files. API means the interface through which parts of a program exchange data.

In plain words
What is it for?
Use it to investigate data problems across the application, including message sessions, by following a shared dispatch ID through logs and checking live session state.
Why use it?
It helps locate where requests fail, data becomes incorrect, cached results go stale, or service errors occur instead of checking each layer separately.

Command for Claude Code

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.

agentmods
npx agentmods add commands/dork-labs/dorkos/api
Clone the repo
git clone --depth 1 https://github.com/dork-labs/dorkos

Made for: Claude Code.

Per session 24 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,164 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00024 $0.03164
Opus 5 $0.00012 $0.01582
Sonnet 5 $0.00005 $0.00633
Haiku 4.5 $0.00002 $0.00316

Measured 2d ago against content hash 3a5035dfe743, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

api 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 2d 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.

.claude/commands/debug/api.md · 366 lines

How it starts

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

API & Data Flow Debugging

Debug data-related issues by systematically tracing through the project's data flow layers. This command helps with API failures, data mismatches, stale cache, and service errors.

For anything on the messaging path — a room, a session turn, a task run, a chat integration — read contributing/observability.md and start from dispatchId. One dsp_<ULID> joins every hop of one message's life, so jq -c 'select(.dispatchId=="dsp_…")' gives you the whole chain in order rather than a layer at a time. If the server is still up, dorkos debug session <id> answers what is only in memory: the lifecycle, the write lock, and what the turn is parked on.

Project Data Flow Architecture

+-------------------+
|  React Component  |  <- UI displays data (FSD layers)
+-------------------+
|  TanStack Query   |  <- Client-side caching & fetching
+-------------------+
|  Transport Layer  |  <- HttpTransport (REST/SSE) or DirectTransport (Obsidian)
+-------------------+
|  Express Route    |  <- HTTP endpoints (Zod validation, boundary checks)
+-------------------+
|  Service Layer    |  <- Business logic (agent-manager, binding-router, etc.)
+-------------------+
|  Data Store       |  <- SQLite (dork.db) + JSONL transcripts + JSON state files
+-------------------+

Key Differences from Typical Projects

  • SQLite, not PostgreSQL — Drizzle ORM (packages/db) over SQLite (WAL mode), plus JSON state files
  • No server actions — All mutations go through Express REST endpoints
  • Transport abstraction — Client uses Transport interface, not direct fetch
  • SDK transcripts — Sessions are derived from JSONL files on disk, not a database
  • Feature-flag guarded — Relay/Mesh/Pulse endpoints return 503 when disabled

Arguments

Parse $ARGUMENTS:

  • If --url <url> flag provided, navigate to that URL
  • Remaining text describes the endpoint or feature with issues
  • If empty, prompt for details

Read the full file on GitHub · 366 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. 2d ago First seen · 366 lines · 24 tokens per session scan A 3a5035dfe743

Subscribe to this mod's changes

api is a command published in the GitHub repository dork-labs/dorkos (9 stars, last pushed 2d ago), licensed MIT. It adds 24 tokens to every session and 3,164 once invoked, about $0.0001 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-08-31.