counterfactual-analysis

counterfactual-analysis is a skill for Claude Code, Codex from MattArtzAnthro/gephi-ai. It costs 42 tokens per session (643 once invoked), scanned A, original, Apache-2.0.

A method for testing hypothetical changes to a network graph loaded in Gephi, such as removing nodes or links, without changing the real graph.

In plain words
What is it for?
Use it to compare scenarios such as removing a highly connected node, deleting a connection, or adding a new connection; ambiguous node names must first be resolved.
Why use it?
It lets you measure the likely structural effect of a change safely and repeatedly using a temporary copy.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to compare scenarios such as removing a highly connected node, deleting a connection, or adding a new connection; ambiguous node names must first be resolved.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/mattartzanthro/gephi-ai/counterfactual-analysis
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 MattArtzAnthro/gephi-ai --skill counterfactual-analysis
Clone the repo
git clone --depth 1 https://github.com/MattArtzAnthro/gephi-ai

Made for: Claude Code, 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 counterfactual-analysis

README.md
[![agentmods](https://agentmods.dev/badge/skills/mattartzanthro/gephi-ai/counterfactual-analysis/github.svg)](https://agentmods.dev/skills/mattartzanthro/gephi-ai/counterfactual-analysis)
Your own site
<a href="https://agentmods.dev/skills/mattartzanthro/gephi-ai/counterfactual-analysis"><img src="https://agentmods.dev/badge/skills/mattartzanthro/gephi-ai/counterfactual-analysis/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 counterfactual-analysis

Your own site · 80×15
<a href="https://agentmods.dev/skills/mattartzanthro/gephi-ai/counterfactual-analysis"><img src="https://agentmods.dev/badge/skills/mattartzanthro/gephi-ai/counterfactual-analysis.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 42 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 643 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.00042 $0.00643
Opus 5 $0.00021 $0.00321
Sonnet 5 $0.00008 $0.00129
Haiku 4.5 $0.00004 $0.00064

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

Security

Grade A, and why

counterfactual-analysis 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 11d 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/gephi-network-analysis/skills/counterfactual-analysis/SKILL.md · 48 lines

How it starts

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

Counterfactual test

Answer the user's what-if question by running it as a real measurement against the graph currently loaded in Gephi, using gephi_whatif. It duplicates the current workspace, applies the edit to the copy, diffs the structural profile before/after, then deletes the copy — the real graph is never touched, so this is safe to run repeatedly.

If the request does not specify an edit, ask what edit they want to test (one sentence is enough: "what if we removed the top hub?", "what if these two accounts stopped talking?").

Steps

  1. Health check: gephi_health_check. If it fails, tell the user to start Gephi and stop.

  2. Resolve the edit. Turn the plain-language question into gephi_whatif's edit list (remove_node, remove_nodes, add_edge, remove_edge). If the person names nodes by label rather than id ("the top hub", "Alice"), resolve the id first — gephi_query_nodes for a name/rank lookup, gephi_compute_degree or the existing profile if "top hub" needs a metric to rank by. Confirm which node(s) you resolved to before running the edit if there's any ambiguity.

  3. Run gephi_whatif with the resolved edits. Only pass include_slow: true (diffs average path length / diameter too) if the graph is roughly under 3k nodes — same cost gate as gephi_profile_graph.

  4. Report the diff, not a verdict. gephi_whatif returns measurements, and the framing matters:

    • Lead with the numbers that changed and by how much (components, giant-component share, density, modularity, isolates, path length if computed).
    • This is a hypothesis test, not a conclusion — say what the delta does and does not support, and note the same caution that applies to any single sample: a counterfactual on a small or skewed graph, or a single removed node standing in for a whole category, can mislead.
    • Offer a rival read where one exists (e.g. "components jumped because this specific hub is also a cut vertex, not because hubs in general hold the network together — want to test a second one to check?").

Read the full file on GitHub · 48 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. 11d ago First seen · 48 lines · 42 tokens per session scan A fd655367bfe1

Subscribe to this mod's changes

counterfactual-analysis is a skill published in the GitHub repository MattArtzAnthro/gephi-ai (22 stars, last pushed 9d ago), licensed Apache-2.0. It adds 42 tokens to every session and 643 once invoked, about $0.0002 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