capture-environment

capture-environment is a skill for Claude Code from pedrohcgs/claude-code-my-workflow. It costs 139 tokens per session (2,837 once invoked), scanned A, original, MIT.

A tool for recording the software environment used by an analysis project. It detects whether the project uses R, Stata, or Python and creates the version and package records those ecosystems use.

In plain words
What is it for?
Use it before releasing or submitting a research replication package to record language versions, package versions, random-number settings, seeds, and optionally operating-system details.
Why use it?
It helps other people rerun research later, even when software versions or computers have changed. This is important for replication packages, which let referees or researchers reproduce published results.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: positional $N argument.

Good fit Use it before releasing or submitting a research replication package to record…

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/pedrohcgs/claude-code-my-workflow/capture-environment
About the project

claude-code-my-workflow is a forkable setup for using Claude Code to produce and review academic papers, slides, data analyses, and replication packages. Researchers use its agents, skills, rules, hooks, and quality checks to coordinate these tasks and verify their results. The catalogue entries define the reusable workflow components for Claude Code.

pedrohcgs/claude-code-my-workflow · 1,563 stars · on GitHub · psantanna.com

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 pedrohcgs/claude-code-my-workflow --skill capture-environment
Clone the repo
git clone --depth 1 https://github.com/pedrohcgs/claude-code-my-workflow

Made for: Claude Code.

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 capture-environment

README.md
[![agentmods](https://agentmods.dev/badge/skills/pedrohcgs/claude-code-my-workflow/capture-environment.svg)](https://agentmods.dev/skills/pedrohcgs/claude-code-my-workflow/capture-environment)
Your own site
<a href="https://agentmods.dev/skills/pedrohcgs/claude-code-my-workflow/capture-environment"><img src="https://agentmods.dev/badge/skills/pedrohcgs/claude-code-my-workflow/capture-environment.svg" alt="Measured on agentmods" height="20"></a>
Per session 139 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,837 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.00139 $0.02837
Opus 5 $0.00069 $0.01418
Sonnet 5 $0.00028 $0.00567
Haiku 4.5 $0.00014 $0.00284

Measured 7d ago against content hash a1033120e000, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

capture-environment 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 7d 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.

.claude/skills/capture-environment/SKILL.md · 137 lines

How it starts

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

/capture-environment — snapshot the computational environment

A replication package that runs on the author's laptop in 2026 and nowhere else in 2029 is not reproducible. This skill captures the exact computational environment — language versions, package versions, seeds, RNG kind, and (optionally) the OS layer — so a referee, the AEA Data Editor, or future-you can reconstruct it. It detects which stack the project uses and emits the artifacts that stack's ecosystem expects, then verifies the lockfile installs clean.

Core principle: Pin everything a result depends on. Display rounding aside, a re-run on a pinned environment should reproduce the paper to the replication-protocol.md tolerances — byte-identical when the optional Dockerfile is used.

When to use

  • Before releasing a replication package to openICPSR, Zenodo, Dataverse, or a journal archive — the AEA Data Editor / DCAS standard expects a documented, version-pinned environment.
  • Before submission, alongside /audit-reproducibility — that skill checks the numbers; this one captures the environment those numbers were produced in (its sessionInfo.txt requirement is satisfied by this skill).
  • After adding or upgrading a package mid-project — re-snapshot so the lockfile doesn't drift from what the code actually loads.
  • When handing a project to a co-author or RA who needs to reconstruct your stack.

Inputs

  • $0 — project directory. Defaults to the repo root. The skill looks under scripts/R/, scripts/stata/, scripts/python/.
  • --docker — also emit a Dockerfile pinning OS + language version + system libraries for byte-identical reproduction.
  • --no-verify — skip Phase 3 (the best-effort clean-install check). Useful in CI or when the toolchain isn't installed locally.

Workflow

Phase 0: Detect the stack

Glob for stack signals and decide which capture paths to run (a project may be multi-language — DiD in R, an IV robustness check in Stata):

Read the full file on GitHub · 137 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. 7d ago First seen · 137 lines · 139 tokens per session scan A a1033120e000

Subscribe to this mod's changes

capture-environment is a skill published in the GitHub repository pedrohcgs/claude-code-my-workflow (1,563 stars, last pushed 13d ago), licensed MIT. It adds 139 tokens to every session and 2,837 once invoked, about $0.0007 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.

Related

Other skills, from other repositories