twining-map

twining-map is a skill for Claude Code, Codex from daveangulo/twining-mcp. It costs 33 tokens per session (1,094 once invoked), scanned A, original, MIT.

A toolset for recording and querying relationships between parts of a codebase, such as components and their dependencies. It builds a knowledge graph, which represents entities and their connections.

In plain words
What is it for?
Use it to document architecture, trace dependencies across modules, and inspect code structure when needed.
Why use it?
It helps when the impact of a change or the structure of a complex project is difficult to understand from individual files.

Skill for Claude CodeCodex

Part of the twining plugin — 9 skills, 2 commands, 2 agents, 5 hooks shipped together

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 skills/daveangulo/twining-mcp/twining-map
Any agent
npx skills add daveangulo/twining-mcp --skill twining-map
Clone the repo
git clone --depth 1 https://github.com/daveangulo/twining-mcp

Made for: Claude Code, Codex.

Or install twining, the plugin that ships this one along with the rest of its 9 skills, 2 commands, 2 agents, 5 hooks.

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 twining-map

README.md
[![agentmods](https://agentmods.dev/badge/skills/daveangulo/twining-mcp/twining-map.svg)](https://agentmods.dev/skills/daveangulo/twining-mcp/twining-map)
Your own site
<a href="https://agentmods.dev/skills/daveangulo/twining-mcp/twining-map"><img src="https://agentmods.dev/badge/skills/daveangulo/twining-mcp/twining-map.svg" alt="Measured on agentmods" height="20"></a>
Per session 33 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,094 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.00033 $0.01094
Opus 5 $0.00016 $0.00547
Sonnet 5 $0.00007 $0.00219
Haiku 4.5 $0.00003 $0.00109

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

Security

Grade A, and why

twining-map 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 3d 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.

plugin/skills/twining-map/SKILL.md · 99 lines

How it starts

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

Twining Map — Knowledge Graph Building (Optional)

This is an advanced, opt-in workflow. Benchmark data shows graph building has no measurable correlation with coordination quality (r=-0.01). Use only when you specifically need structural analysis. Requires graph.auto_populate: true in config for auto-population, or manual entity/relation creation.

Tool availability. The graph tools below (twining_add_entity, twining_add_relation, twining_neighbors, twining_graph_query, twining_prune_graph) are on the default surface. twining_decide and twining_verify, referenced below, require tools.full_surface: true — on a default install use twining_record's decisions array instead, which populates the same affected_files / affected_symbols entities.

Build the knowledge graph to capture architectural relationships when you need to reason about code structure across multiple modules.

When to Invoke

  • When you need to understand cross-module dependencies for impact analysis
  • When onboarding to a complex area where structural relationships aren't obvious from code alone
  • When explicitly asked to map code structure

When NOT to Invoke

  • For most day-to-day coordination work (use decisions and blackboard instead)
  • Trivial decisions (naming, formatting, config values)
  • Changes that don't alter code structure
  • When the graph already has the information (check first with twining_neighbors)

Workflow

1. Add Entities

Call twining_add_entity for each significant code component:

  • name: Unique identifier (e.g., "AuthMiddleware", "src/auth/middleware.ts")
  • type: One of module, function, class, file, concept, pattern, dependency, api_endpoint
  • properties: Key-value metadata (e.g., { file: "src/auth/middleware.ts", layer: "engine" })

Note: twining_decide auto-creates file and function entities for affected_files and affected_symbols. You only need to manually add entities for richer structural information.

Read the full file on GitHub · 99 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. 3d ago First seen · 99 lines · 33 tokens per session scan A 6fa897c0cefe

Subscribe to this mod's changes

twining-map is a skill published in the GitHub repository daveangulo/twining-mcp (7 stars, last pushed 8d ago), licensed MIT. It adds 33 tokens to every session and 1,094 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-31.

Related

Other skills, from other repositories

understand-knowledge

Analyze a Karpathy-pattern LLM wiki knowledge base and generate an interactive knowledge graph with entity extraction, implicit relationships, and topic clustering.

Egonex-AI/Understand-Anything · 32 tokens

ux-ui-analyze-single-page

Analyze exactly one captured UI page (from uxuimap screenshots + request JSON) and immediately write/update uxuimap/pages/{page}.md in neutral descriptive language. Use when asked to analyze screenshots, rewrite corresponding analysis immediately, or avoid memory/context saturation.

raphaelmansuy/edgequake · 58 tokens

shodh-memory

Persistent memory system for AI agents. Use this skill to remember context across conversations, recall relevant information, and build long-term knowledge. Activate when you need to store decisions, learnings, errors, or context that should persist beyond the current session.

varun29ankuS/shodh-memory · 53 tokens

lemmalog

Externalize working memory and logical state into the lemmalog Datalog engine (MCP). Use for ANY multi-step task where state should outlive one context window or span agents: long investigations, debugging sessions, audits, multi-agent searches, systematic explorations, planning with many interdependent constraints…

JordyZomer/lemmalog · 105 tokens

dbrain-processor

Personal assistant for processing daily voice/text entries from Telegram. Classifies content, saves thoughts to Obsidian with wiki-links, generates HTML reports. Integrates Your Business context (clients, projects, CRM). Triggers on /process command or daily 21:00 cron.

smixs/agent-second-brain · 60 tokens

autograph

Schema-as-code enforcement for any Obsidian vault. Zero hardcoded domains. Use when creating vault cards, checking vault health, running schema compliance, deduplicating entities, generating MOC indexes, running decay cycles, bootstrapping a vault, fixing wikilinks, finding orphans or backlinks, extracting entities…

smixs/agent-second-brain · 89 tokens