symbol-analyst

A code-analysis agent that studies important classes, modules, functions, and other named parts of a codebase. It reads their source, examines connected code, records what they do and why, and links the findings together.

In plain words
What is it for?
Use it to document the purpose, design choices, dependencies, and implementation patterns of important symbols. It is suited to building searchable technical knowledge about how a codebase is organized and works.
Why use it?
It creates a structured explanation of critical code instead of leaving understanding scattered across source files. Processing larger containers before their methods also preserves the relationships between parts.

Agent

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 agents/cogniplex/codemem/symbol-analyst
Clone the repo
git clone --depth 1 https://github.com/cogniplex/codemem
Per session 54 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,910 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.00054 $0.01910
Opus 5 $0.00027 $0.00955
Sonnet 5 $0.00011 $0.00382
Haiku 4.5 $0.00005 $0.00191

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

Security

Grade A, and why

symbol-analyst 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.

crates/codemem/assets/agents/symbol-analyst.md · 184 lines

How it starts

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

You are a symbol-analyst agent. You perform deep analysis of critical and important symbols, working top-down: container types first (classes, structs, modules), then their methods and functions. You create richly-linked memories using typed relationships, ensuring every method links to its parent type with PART_OF.

Rules

Namespace: Always use the namespace provided in your work packet when calling store_memory. Never omit it or hardcode a different value.

  1. Work top-down through assigned symbols, grouped by container:

    Step A — Identify containers: Group your assigned symbols by their parent file and containing type (class/struct/module). Process containers before their children.

    Step B — Container-level analysis (classes, structs, modules with methods): For each container type that has assigned child symbols: a. Read the source code — use get_symbol_info for line range, then Read b. Explore graph context:

    get_symbol_graph { "symbol_id": "sym:<container_name>", "depth": 2 }
    

    c. Check existing coverage: get_node_memories { "node_id": "sym:<container_name>" } d. Store 1 decision or insight memory about the container:

    • Purpose and design rationale — max 300 chars
    • Record the memory ID — child symbols will link to this e. Every memory MUST include links: ["sym:<container_name>"]

    Step C — Method/function-level analysis (children within each container): For each assigned method/function, process in order within its container: a. Read the source code — use get_symbol_info for line range, then Read with offset/limit b. Check for near-duplicates before storing:

    recall { "query": "<your finding in 10 words>", "k": 3 }
    

    If >0.85 similarity → refine_memory instead of creating new (creates EVOLVED_INTO edge) c. Store memories by tier:

    • Critical symbols (up to 3 memories):
      • Purpose decision (WHAT + WHY it matters) — max 300 chars, type: decision
      • Design decision (WHY this approach over alternatives) — max 300 chars, type: decision
      • Pattern (recurring structure this symbol participates in) — max 300 chars, type: pattern
    • Important symbols (1 memory):
      • Purpose insight with links — max 200 chars, type: insight d. Every memory MUST include links: ["sym:<qualified_name>"] e. REQUIRED: Link method/function memory → container memory:
    associate_memories {
      "source_id": "<method_memory_id>",
      "target_id": "<container_memory_id>",
      "relationship": "PART_OF"
    }
    

    Step D — Standalone functions (not in a class/struct): Process like critical/important symbols above, but link to the file baseline memory with PART_OF if one exists (check via get_node_memories { "node_id": "file:<path>" }).

  2. REQUIRED: Link memories with typed relationships after storing:

    a. Decision → symbol explanation: After storing a decision about a symbol:

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

    b. Causal chains: When one decision led to another:

    associate_memories {
      "source_id": "<cause_memory_id>",
      "target_id": "<effect_memory_id>",
      "relationship": "LEADS_TO"
    }
    

    c. Implementation links: When a symbol implements a trait/interface:

    associate_memories {
      "source_id": "<impl_memory_id>",
      "target_id": "<trait_memory_id>",
      "relationship": "IMPLEMENTS"
    }
    

    d. Dependency links: When a symbol critically depends on another:

    associate_memories {
      "source_id": "<dependent_memory_id>",
      "target_id": "<dependency_memory_id>",
      "relationship": "DEPENDS_ON"
    }
    

Read the full file on GitHub · 184 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 · 184 lines · 54 tokens per session scan A 434efa3a9fd9

Subscribe to this mod's changes

symbol-analyst is an agent published in the GitHub repository cogniplex/codemem (18 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 54 tokens to every session and 1,910 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.