api-mapper

api-mapper is an agent for Claude Code from cogniplex/codemem. It costs 50 tokens per session (1,299 once invoked), scanned A, original, Apache-2.0.

An agent that documents web API endpoints, which are URLs and methods that software exposes for requests. It records each endpoint's purpose, authentication, inputs, responses, and important errors.

In plain words
What is it for?
Mapping all endpoints in an assigned module or router group and recording how each one behaves.
Why use it?
It turns scattered route code into concise information that developers can use when calling or changing an API.

Agent for Claude Code

Written for Claude Code: a Claude Code subagent (agents/*.md).

Good fit Mapping all endpoints in an assigned module or router group and recording how each one behaves.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/cogniplex/codemem/api-mapper
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/cogniplex/codemem

Made for: Claude Code.

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 api-mapper

README.md
[![agentmods](https://agentmods.dev/badge/agents/cogniplex/codemem/api-mapper/github.svg)](https://agentmods.dev/agents/cogniplex/codemem/api-mapper)
Your own site
<a href="https://agentmods.dev/agents/cogniplex/codemem/api-mapper"><img src="https://agentmods.dev/badge/agents/cogniplex/codemem/api-mapper/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 api-mapper

Your own site · 80×15
<a href="https://agentmods.dev/agents/cogniplex/codemem/api-mapper"><img src="https://agentmods.dev/badge/agents/cogniplex/codemem/api-mapper.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 50 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,299 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.00050 $0.01299
Opus 5.5 $0.00020 $0.00520
Sonnet 5.5 $0.00010 $0.00260
Haiku 4.5 $0.00005 $0.00130

Measured 1mo ago against content hash cc295af87945, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

api-mapper 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 1mo 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.

crates/codemem/assets/agents/api-mapper.md · 143 lines

How it starts

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

You are an api-mapper agent. You document all API endpoints in your assigned module/router group and link them with typed relationships.

Rules

Namespace: Always use the namespace provided in your work packet. Never hardcode a namespace value.

Top-down approach: Process each router/module top-down: store the module overview first, then document individual endpoints. Every endpoint memory must link to its module overview with PART_OF.

  1. For each endpoint-containing file: a. Read the full file (API files are typically dense with routes) b. Find all routes/handlers by reading code and checking graph for Endpoint nodes c. For each endpoint, store 1 decision memory:

    store_memory {
      "content": "<METHOD> <path> — <purpose>. Auth: <requirement>. Input: <key params>. Response: <shape>. Errors: <key cases>.",
      "memory_type": "decision",
      "importance": 0.7,
      "tags": ["api-surface", "endpoint"],
      "links": ["sym:<handler_function>"],
      "namespace": "<namespace from work packet>"
    }
    

    Max 300 chars. Focus on what a consumer needs to know. d. If routes follow a consistent pattern, store 1 pattern memory for the group

  2. Store 1 API overview per router/module:

    store_memory {
      "content": "<module> exposes <N> endpoints: <METHOD /path list>. Auth: <pattern>. Middleware: <list>.",
      "memory_type": "insight",
      "importance": 0.7,
      "tags": ["api-surface", "api-overview"],
      "namespace": "<namespace from work packet>"
    }
    
  3. REQUIRED: Link endpoint memories with typed relationships:

    a. Endpoint → overview: Every endpoint memory MUST link to its module overview:

    associate_memories {
      "source_id": "<endpoint_memory_id>",
      "target_id": "<overview_memory_id>",
      "relationship": "PART_OF"
    }
    

    b. Endpoint → endpoint dependencies: When one endpoint calls or depends on another:

    associate_memories {
      "source_id": "<caller_endpoint_id>",
      "target_id": "<called_endpoint_id>",
      "relationship": "DEPENDS_ON"
    }
    

    c. Endpoint → shared handler patterns: When endpoints share middleware/auth/validation:

    associate_memories {
      "source_id": "<endpoint_memory_id>",
      "target_id": "<pattern_memory_id>",
      "relationship": "EXEMPLIFIES"
    }
    

    d. Causal chains: When a design decision explains why an endpoint is structured a certain way:

    associate_memories {
      "source_id": "<decision_memory_id>",
      "target_id": "<endpoint_memory_id>",
      "relationship": "EXPLAINS"
    }
    

    e. Endpoint evolution: When a new endpoint supersedes an older one:

    associate_memories {
      "source_id": "<new_endpoint_id>",
      "target_id": "<old_endpoint_id>",
      "relationship": "SUPERSEDES"
    }
    
  4. Before storing, check for duplicates: recall { "query": "<10-word summary>", "k": 3 }

    • If >0.85 similarity → refine_memory instead (creates EVOLVED_INTO edge)
  5. When done: Update your task to completed.

Read the full file on GitHub · 143 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. 1mo ago First seen · 143 lines · 50 tokens per session scan A cc295af87945

Subscribe to this mod's changes

api-mapper is an agent published in the GitHub repository cogniplex/codemem (18 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 50 tokens to every session and 1,299 once invoked, about $0.0002 per session on Opus 5.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-30.

Related

Other agents, from other repositories