Agentic-Memory: Agent for Claude Code

.opencode/agents/test-writer.md

test-writer is an agent for Claude Code, OpenCode from ArkaAiAdmin/Agentic-Memory. It costs 23 tokens per session (1,876 once invoked), scanned C, original, Apache-2.0.

A testing specialist for the Agentic-Memory evaluation suite. TDD means writing tests before the code they check, and this agent follows that approach.

In plain words
What is it for?
Use it to write evaluation tests, choose the right fixtures, isolate test databases, and protect production database access.
Why use it?
It provides project-specific test patterns and safety rules, reducing the chance of inconsistent or unsafe tests.

Agent for Claude CodeOpenCode

Written for OpenCode and Claude Code: installed under .opencode/, but also a Claude Code subagent (agents/*.md). Also seen: mentions subagents.

This is ArkaAiAdmin/Agentic-Memory's own configuration. It tells Claude Code and OpenCode how to work on Agentic-Memory itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything Agentic-Memory configures →

Reuse

Borrowing it

Nothing to install: this file belongs to ArkaAiAdmin/Agentic-Memory. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/ArkaAiAdmin/Agentic-Memory/main/.opencode/agents/test-writer.md
Clone the repo
git clone --depth 1 https://github.com/ArkaAiAdmin/Agentic-Memory

Made for: Claude Code, OpenCode.

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 test-writer

README.md
[![agentmods](https://agentmods.dev/badge/agents/arkaaiadmin/agentic-memory/test-writer/github.svg)](https://agentmods.dev/agents/arkaaiadmin/agentic-memory/test-writer)
Your own site
<a href="https://agentmods.dev/agents/arkaaiadmin/agentic-memory/test-writer"><img src="https://agentmods.dev/badge/agents/arkaaiadmin/agentic-memory/test-writer/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 test-writer

Your own site · 80×15
<a href="https://agentmods.dev/agents/arkaaiadmin/agentic-memory/test-writer"><img src="https://agentmods.dev/badge/agents/arkaaiadmin/agentic-memory/test-writer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 23 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,876 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 2 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.00023 $0.01876
Opus 5.5 $0.00009 $0.00750
Sonnet 5.5 $0.00005 $0.00375
Haiku 4.5 $0.00002 $0.00188

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

Security

Grade C, and why

test-writer scanned grade C with 2 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.

Harvests environment variableshighData exfiltration

Enumerating or grepping the environment for keys collects credentials unrelated to what the mod says it does.

env = {k: v for k, v in os.environ.items() if not k.startswith("MEMORY_")}

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

result = subprocess.run(
.opencode/agents/test-writer.md · 189 lines

How it starts

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

You are a test writer for the agentic-memory eval/ suite.

Current state

  • 271 test files, 4346+ test functions in eval/
  • Subprocess-per-file runner for torch-safe parallelism
  • _ProdDBGuarded mixin for tests touching prod DB
  • conftest.py sets env overrides

Test file conventions

  • File pattern: eval/test_<name>.py
  • Class pattern: class Test<Name>(unittest.TestCase)
  • Method pattern: def test_<descriptive_name>(self)
  • Use tmp_path fixture for test databases
  • Use _ProdDBGuarded when test needs prod DB access

conftest.py autouse fixtures

Fixture Scope Purpose
_test_session_env session Sets env vars: MEMORY_LLM_EXTRACTION=0, MEMORY_KNOWLEDGE_GRAPH=1, MEMORY_ADAPTIVE_RETENTION=1, MEMORY_QUALITY_GATES=1, MEMORY_WRITE_JOURNAL_ENABLED=0, MEMORY_FAIL_ON_INTEGRITY_DRIFT=0
clear_pool_between_tests function Calls connection_pool.clear() before and after each test
reset_auto_save_state function Resets circuit breaker state, stops leftover daemon
reset_lazy_config_cache function Clears lazy-getattr cache, unsets MEMORY_RERANKER_DISABLED
_test_embedding_setup session Opt-in via marker — sets MEMORY_EMBEDDING_BACKEND=sentence-transformers, model intfloat/e5-small-v2
temp_db_path function Yields a fully-bootstrapped temp DB via bootstrap_temp_db()
project_root session Worktree root path
project_venv_python session Venv Python path
project_memory_dir session Memory directory path

Safety wiring (Hard Rule #8)

Tests hitting prod DB MUST use _ProdDBGuarded mixin:

from eval.test_safety_wiring import _ProdDBGuarded

class TestSomething(_ProdDBGuarded, unittest.TestCase):
    def test_thing(self):
        # This test is guarded against prod DB pollution
        ...

Test patterns

Unit test with tmp_path

def test_save_creates_markdown(self, tmp_path):
    db_path = tmp_path / "test.db"
    save_memory(content="test", category="lessons", db_path=db_path)
    md_path = tmp_path / "lessons" / "test.md"
    assert md_path.exists()

Read the full file on GitHub · 189 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 · 189 lines · 23 tokens per session scan C 65e616a39866

Subscribe to this mod's changes

test-writer is an agent published in the GitHub repository ArkaAiAdmin/Agentic-Memory (0 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 23 tokens to every session and 1,876 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it C with 2 findings (harvests environment variables, runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.