code-archaeologist

code-archaeologist is a skill for Codex from lsantosweb/codex-agents-skills-kit. It costs 27 tokens per session (270 once invoked), scanned A, original, MIT.

A guide for understanding and safely improving old or poorly documented software. Brownfield work means changing an existing system while preserving behavior that users or other code may rely on.

In plain words
What is it for?
Explaining a repository, tracing its data flow, identifying entry points and coupling, documenting risks, adding characterization tests, and planning gradual refactors.
Why use it?
It reduces the risk of breaking hidden dependencies or removing behavior whose purpose is not yet known.

Skill for Codex

Written for Codex: installed under .codex/.

Good fit Explaining a repository, tracing its data flow, identifying entry points and coupling, documenting risks, adding characterization tests, and planning gradual refactors.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/lsantosweb/codex-agents-skills-kit/code-archaeologist
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.

Any agent
npx skills add lsantosweb/codex-agents-skills-kit --skill code-archaeologist
Clone the repo
git clone --depth 1 https://github.com/lsantosweb/codex-agents-skills-kit

Made for: Codex.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/lsantosweb/codex-agents-skills-kit/code-archaeologist/github.svg)](https://agentmods.dev/skills/lsantosweb/codex-agents-skills-kit/code-archaeologist)
Your own site
<a href="https://agentmods.dev/skills/lsantosweb/codex-agents-skills-kit/code-archaeologist"><img src="https://agentmods.dev/badge/skills/lsantosweb/codex-agents-skills-kit/code-archaeologist/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 code-archaeologist

Your own site · 80×15
<a href="https://agentmods.dev/skills/lsantosweb/codex-agents-skills-kit/code-archaeologist"><img src="https://agentmods.dev/badge/skills/lsantosweb/codex-agents-skills-kit/code-archaeologist.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 27 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 270 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 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.00027 $0.00270
Opus 5.5 $0.00011 $0.00108
Sonnet 5.5 $0.00005 $0.00054
Haiku 4.5 $0.00003 $0.00027

Measured 2mo ago against content hash f6bab43f858d, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 2mo 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.

.codex/skills/code-archaeologist/SKILL.md · 46 lines

What it actually says

When to use

Use this skill when the request mentions:

  • legacy code
  • refactor
  • spaghetti code
  • explain this repo
  • understand current behavior before changing it
  • undocumented system

Core operating rules

  • Do not remove or rewrite behavior before understanding why it exists.
  • Prefer wrapping and strangler-pattern migration over rewrite-first behavior.
  • Before changing functional behavior, establish characterization tests when feasible.
  • Document risk, coupling, and likely side effects.

Investigation workflow

  1. Identify entry points and major modules.
  2. Trace data flow and mutation points.
  3. Detect global mutable state, circular imports, and hidden coupling.
  4. Describe current behavior in plain language.
  5. Recommend the smallest safe refactor path.

Preferred report structure

  • Artifact analyzed
  • Estimated age/style clues
  • Inputs and outputs
  • Dependencies and side effects
  • Risk factors
  • Safe refactoring plan
  • Tests to add before deeper edits

Mandatory constraints

  • No large rewrite without tests or a fallback plan.
  • Prefer extracting methods, renaming symbols, and adding guard clauses before architectural rewrites.
  • Explicitly mark unknowns and assumptions.
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. 2mo ago First seen · 46 lines · 27 tokens per session scan A f6bab43f858d

Subscribe to this mod's changes

code-archaeologist is a skill published in the GitHub repository lsantosweb/codex-agents-skills-kit (2 stars, last pushed 7mo ago), licensed MIT. It adds 27 tokens to every session and 270 once invoked, about $0.0001 per session on Opus 5.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.

Related

code-archaeologist compared with skills from other repositories

code-archaeologist next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
code-archaeologistlsantosweb/codex-agents-skills-kitSkill27mo agoMITA27Codex
systematic-debuggingopen-metadata/OpenMetadataSkill16kyesterdayApache-2.0A37Claude Code
log-error-digestzebbern/claude-code-guideSkill4.7k3d agoMITA71Claude Code, Codex
cwv-optimizeradobe/skillsSkill319yesterdayApache-2.0A112Claude Code
ci-fixersipyourdrink-ltd/bernsteinSkill1.2kyesterdayApache-2.0A15Claude Code, Codex
incident-response-incident-responsermyndharis/antigravity-skillsSkill1.9k23d agoMITA36Claude Code
triaging-web-analytics-supportPostHog/posthogSkill41kyesterdaynoneA151Claude Code, Codex