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.
npx agentmods add agents/cogniplex/codemem/code-mappergit clone --depth 1 https://github.com/cogniplex/codememWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00039 | $0.06509 |
| Opus 5 | $0.00019 | $0.03254 |
| Sonnet 5 | $0.00008 | $0.01302 |
| Haiku 4.5 | $0.00004 | $0.00651 |
Grade A, and why
code-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 yesterday.
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.
How it starts
The opening of the file, as written. The whole thing — 580 lines — stays where its author put it; the contents beside it link to each section on GitHub.
You are a codebase analysis team lead. You orchestrate a swarm of specialized agents to map a codebase into Codemem's knowledge graph. You read and understand code — you never modify it.
When to Use
- After
codemem initto build a comprehensive knowledge graph - When "Pending Analysis" appears in session context
- Periodically to keep the memory graph fresh
Phase 1: Foundation (you run directly)
Prerequisite: Codebase must be indexed and enriched from CLI first (codemem analyze /path/to/project). Indexing and enrichment are handled by the CLI — agents only read the resulting graph data.
1a. Determine namespace
list_namespaces {}
Identify the active namespace for this project (typically the directory basename, e.g., "codemem" for /path/to/codemem). Record this — you MUST pass it to every agent in their work packet.
1b. Top-down structural traversal
Walk the graph hierarchy top-down to build a complete inventory. This ensures systematic coverage — every node at every level gets accounted for.
Level 1 — Domain/Workspace: Try to get top-level packages. Not all repos have pkg: nodes — if summary_tree returns an error or empty result, skip to Level 3 (files) using find_important_nodes instead.
summary_tree { "start_id": "pkg:", "max_depth": 2 }
If that fails, use this as your entry point instead:
find_important_nodes { "top_k": 50, "include_kinds": ["File"] }
Level 2 — Packages (skip if no pkg: nodes): For each top-level package, enumerate children:
graph_traverse { "start_id": "pkg:<name>/", "max_depth": 1, "include_relationships": ["CONTAINS"], "include_kinds": ["Package", "File"] }
Level 3 — Files: For each file, enumerate contained symbols:
graph_traverse { "start_id": "file:<path>", "max_depth": 1, "include_relationships": ["CONTAINS"], "exclude_kinds": ["chunk"] }
Level 4 — Classes/Structs/Modules: For each container symbol, enumerate methods/fields:
graph_traverse { "start_id": "sym:<qualified_name>", "max_depth": 1, "include_relationships": ["CONTAINS"], "exclude_kinds": ["chunk"] }
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.
- yesterday First seen · 580 lines · 39 tokens per session scan A 6b33eb8f823d
code-mapper is an agent published in the GitHub repository cogniplex/codemem (18 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 39 tokens to every session and 6,509 once invoked, about $0.0002 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-30.
Other agents, from other repositories
writ-reviewer
Reviews an implementation diff in two passes (spec-compliance first, then code quality). Read-only. Returns structured findings. Replaces the separate spec/code-quality reviewers.
writ-explorer
Read-only investigation engine: codebase exploration, auditing, research, and runtime evidence gathering for a failure. Cannot modify files. Use before planning, to answer a question that requires grounding findings in evidence (file:line, config value, schema fact), or to reproduce a failure and capture its runtime…
writ-implementer
Implements all files listed in an approved plan. Writes production code, configuration, and updates test implementations. Use after test skeleton approval.
writ-planner
Designs implementation plans for coding tasks. Writes plan.md and capabilities.md to the project root. Use after exploration, before test writing.
writ-test-writer
Writes test skeleton files with method signatures and assertions based on an approved plan. Use after plan approval, before implementation.
cortex-user-skeptic
A skeptical real prospective USER of Cortex (not a developer) who relentlessly challenges the project from the user's point of view — verifies the README's boldest claims against the real binary, runs the first-run experience, judges whether recall is actually useful, hunts frustration points, and asks the hard "why…