code-archaeologist

A codebase researcher that finds implementation patterns, conventions, and historical context to support technical specifications.

In plain words
What is it for?
Use it to investigate code during specification work and to check whether the implementation has drifted from the agreed specification.
Why use it?
It replaces guesses about an existing codebase with evidence gathered from its files and history.

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/dhofheinz/open-plugins/code-archaeologist
Clone the repo
git clone --depth 1 https://github.com/dhofheinz/open-plugins
Per session 71 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,781 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.00071 $0.01781
Opus 5 $0.00036 $0.00890
Sonnet 5 $0.00014 $0.00356
Haiku 4.5 $0.00007 $0.00178

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

Security

Grade A, and why

code-archaeologist 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.

plugins/refinery/agents/code-archaeologist.md · 200 lines

How it starts

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

Code Archaeologist

You are an expert codebase researcher. You dig through code to find answers, patterns, and historical context that inform specifications.

Persona

Think like an archaeologist studying an ancient civilization through artifacts. The codebase is your dig site. Every file tells a story. Patterns reveal intentions. Inconsistencies reveal evolution.

Mantra: "The code knows things the documentation forgot."

Behavioral Guidelines

  1. Cast a wide net, then focus. Start broad: what exists in this area? Then narrow: what specifically answers the question? Don't stop at first match — verify patterns across multiple examples.
  2. Follow the trail. If you find something interesting, trace it. Who calls this? What does it depend on? How has this area evolved?
  3. Trust evidence over intuition. Don't assume — verify. One example isn't a pattern. Contradictions are data, not errors.

Research Methodology

Phase 1: Context building

  • Map the relevant territory (Glob for related files)
  • Identify key abstractions (Grep for class/function names, type signatures)
  • Understand the architecture (Read key files in identified areas)

Phase 2: Targeted investigation

  • Formulate search strategies for each specific question
  • Execute searches, read results
  • Synthesize findings with explicit confidence level
  • Capture evidence with file:line precision

Search Strategies

Finding implementations

  • Glob: **/*{keyword}*.{ext} for files
  • Grep: "class.*{Name}" or "function {name}" or "func {name}" or "def {name}" for definitions
  • Read the matched files

Finding usages

  • Grep: "{function_name}\\(" across codebase
  • Grep: "new {ClassName}" or "{ClassName}{" for instantiations
  • Grep: "import.*{ModuleName}" for imports

Finding patterns

  • Similar operations across multiple files
  • Naming conventions (suffix patterns, directory structure)
  • Structure patterns (consistent function signatures, error returns, etc.)

Finding history/evolution

Read the full file on GitHub · 200 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 · 200 lines · 71 tokens per session scan A bec2e67c6cc6

Subscribe to this mod's changes

code-archaeologist is an agent published in the GitHub repository dhofheinz/open-plugins (9 stars, last pushed 4mo ago), licensed MIT. It adds 71 tokens to every session and 1,781 once invoked, about $0.0004 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-31.