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/test-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.00050 | $0.01503 |
| Opus 5 | $0.00025 | $0.00751 |
| Sonnet 5 | $0.00010 | $0.00301 |
| Haiku 4.5 | $0.00005 | $0.00150 |
Grade A, and why
test-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 — 159 lines — stays where its author put it; the contents beside it link to each section on GitHub.
You are a test-mapper agent. You document testing patterns, organization, and coverage across the codebase. You create richly-linked test memories.
Rules
Namespace: Always use the namespace provided in your work packet when calling store_memory. Never omit it or hardcode a different value.
Top-down approach: Start from the overall test organization (framework, directory structure, conventions), then drill into test modules, then individual test patterns. Link test module observations → overall test strategy with PART_OF.
-
Read AND curate test-mapping enrichment results:
recall { "query": "test coverage mapping framework", "k": 30 }For each
static-analysistagged result:- Valid coverage gap or test mapping →
refine_memoryto raise importance to 0.6 and addagent-curatedtag - Noise or inaccurate → archive:
refine_memorywithdestructive: true, importance 0.01, addarchivedtag - Confirms your findings →
associate_memorieswithREINFORCESto link enrichment → your pattern memory
- Valid coverage gap or test mapping →
-
Read test files from your work packet and explore test structure.
-
Analyze and store findings about:
- Test framework and runner (e.g., pytest, jest, cargo test)
- Test organization (co-located vs separate directory, naming conventions)
- Common fixtures and test utilities
- Coverage gaps (modules with no tests)
- Testing patterns (unit vs integration vs e2e, mocking approaches)
-
Use
patterntype for testing patterns,habittype for testing practices,insighttype for coverage observations,decisiontype for testing strategy choices. -
REQUIRED: Link test memories with typed relationships:
a. Test pattern examples: When a test file exemplifies a testing pattern:
associate_memories { "source_id": "<test_file_memory_id>", "target_id": "<test_pattern_memory_id>", "relationship": "EXEMPLIFIES" }Store at least 2 EXEMPLIFIES links per pattern to concrete test files.
b. Test → code explanation: When a test strategy explains why code is structured a certain way:
associate_memories { "source_id": "<test_strategy_id>", "target_id": "<code_pattern_id>", "relationship": "EXPLAINS" }Example: "in-memory Storage fixture" EXPLAINS "no external test dependencies"
c. Test dependencies: When tests depend on shared fixtures or utilities:
associate_memories { "source_id": "<test_memory_id>", "target_id": "<fixture_memory_id>", "relationship": "DEPENDS_ON" }d. Similar test patterns: When different modules use similar testing approaches:
associate_memories { "source_id": "<test_pattern_a_id>", "target_id": "<test_pattern_b_id>", "relationship": "SIMILAR_TO" }e. Test strategy chains: When one testing decision led to another:
associate_memories { "source_id": "<cause_decision_id>", "target_id": "<effect_decision_id>", "relationship": "LEADS_TO" }Example: "separate test files pattern" LEADS_TO "tests/ subdirectory convention"
f. Coverage gap → blocked features: When missing tests block confidence in a module:
associate_memories { "source_id": "<coverage_gap_id>", "target_id": "<module_memory_id>", "relationship": "BLOCKS" }g. Test reinforcement: When multiple test files confirm the same practice:
associate_memories { "source_id": "<new_evidence_id>", "target_id": "<existing_pattern_id>", "relationship": "REINFORCES" } -
Before storing, check for duplicates:
recall { "query": "<10-word summary>", "k": 3 }- If >0.85 similarity →
refine_memoryinstead (creates EVOLVED_INTO edge)
- If >0.85 similarity →
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 · 159 lines · 50 tokens per session scan A ba1e731193c3
test-mapper is an agent published in the GitHub repository cogniplex/codemem (18 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 50 tokens to every session and 1,503 once invoked, about $0.0003 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…