extract-protocols-and-state

extract-protocols-and-state is a skill for Claude Code, Codex from HuginnIndustries/CodeCartographer. It costs 62 tokens per session (637 once invoked), scanned A, original, MIT.

A method for documenting how parts of a software system exchange messages, store data, and move between states. A protocol is the agreed format and behavior used at a boundary, such as a JSON or remote-procedure-call interface.

In plain words
What is it for?
Use it to document event streams, session files, JSONL interfaces, remote calls, storage formats, state machines, and tool-calling flows.
Why use it?
It exposes details that are easy to miss when porting event-driven or tool-using systems, including message fields, ordering, errors, retries, persistence, and restart behavior.

Skill for Claude CodeCodex

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/huginnindustries/codecartographer/protocols
Any agent
npx skills add HuginnIndustries/CodeCartographer --skill protocols
Clone the repo
git clone --depth 1 https://github.com/HuginnIndustries/CodeCartographer

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 extract-protocols-and-state

README.md
[![agentmods](https://agentmods.dev/badge/skills/huginnindustries/codecartographer/protocols.svg)](https://agentmods.dev/skills/huginnindustries/codecartographer/protocols)
Your own site
<a href="https://agentmods.dev/skills/huginnindustries/codecartographer/protocols"><img src="https://agentmods.dev/badge/skills/huginnindustries/codecartographer/protocols.svg" alt="Measured on agentmods" height="20"></a>
Per session 62 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 637 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.00062 $0.00637
Opus 5 $0.00031 $0.00318
Sonnet 5 $0.00012 $0.00127
Haiku 4.5 $0.00006 $0.00064

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

Security

Grade A, and why

extract-protocols-and-state 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.

.codecarto/findings/protocols/SKILL.md · 88 lines

What it actually says

Extract Protocols And State

Treat every boundary as a protocol boundary.

Enumerate the boundaries first:

  • process to process
  • UI to core
  • core to provider
  • tool layer to runtime
  • runtime to persistence
  • local files to exported artifacts

Prefer type definitions, schemas, and docs before implementation code:

  • Read event and message types first.
  • Read file format docs next.
  • Use source to fill ordering, retry, and recovery gaps.

For each protocol, record:

  • producer
  • consumer
  • transport or carrier
  • ordering guarantees
  • required fields
  • optional fields
  • identifiers and timestamps
  • error cases
  • restart or resume behavior

Convert control flow into a state machine:

  • Name the states.
  • Name the transitions.
  • Record guards and side effects.
  • Separate synchronous barriers from observational events.

Capture persistence semantics explicitly:

  • append-only vs mutable
  • branching vs linear history
  • compaction or summarization
  • replay or resume behavior
  • locking, deduplication, or conflict handling

Look for these protocol-heavy areas:

  • streamed assistant events
  • tool call validation and execution
  • session files
  • JSONL or RPC framing
  • queueing semantics
  • background event scheduling
  • transport fallbacks

Treat configuration propagation as a protocol when it crosses boundaries:

  • How config values flow from files or env vars into runtime behavior.
  • Whether config changes require a restart or are hot-reloaded.
  • How config is validated and what happens on invalid input.
  • If the config propagation model is complex, use the secondary output at findings/config-model/config-model.md.

Flag portability hazards that frequently break ports:

  • ANSI terminal semantics
  • IME or cursor positioning rules
  • filesystem locking assumptions
  • async ordering guarantees
  • OAuth token refresh behavior
  • shell quoting and OS differences
  • encoding, width, or Unicode handling

Produce four outputs:

  1. Event catalog
  2. State machine
  3. Persistent schema notes
  4. Compatibility hazards

Mark every finding with one of these evidence levels:

  • observed fact: direct statement from docs, tests, schemas, types, or code.
  • strong inference: protocol conclusion drawn from multiple facts.
  • portability hazard: assumption tied to the source language, runtime, terminal, OS, or third-party SDKs.
  • open question: missing or conflicting behavior that still needs evidence.

Do not copy the wire syntax blindly. Preserve the meaning of the interaction, then decide how the target language should encode it.

Use the output template at templates/protocols-and-state.md.

The source code to analyze is in the parent directory (../ relative to .codecarto/). This is the repository root.

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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 · 88 lines · 62 tokens per session scan A ace888bbee5c

Subscribe to this mod's changes

extract-protocols-and-state is a skill published in the GitHub repository HuginnIndustries/CodeCartographer (4 stars, last pushed 3d ago), licensed MIT. It adds 62 tokens to every session and 637 once invoked, about $0.0003 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

repomix

Pack and analyze codebases into AI-friendly single files using Repomix. Use when the user wants to explore repositories, analyze code structure, find patterns, check token counts, or prepare codebase context for AI analysis. Supports both local directories and remote GitHub repositories.

yamadashy/repomix · 58 tokens

knowledge-base

Create and maintain a Markdown knowledge base that any AI agent can read, search, and update. Use when the user wants to start a knowledge base, add or update notes, organize docs/notes for an agent or LLM to consume, build an index of notes, or run a cleanup/maintenance pass on an existing MD knowledge base. Triggers…

wonderwhy-er/DesktopCommanderMCP · 112 tokens

analyzing-android-malware-with-apktool

Perform static analysis of Android APK malware using apktool for resource decompilation, jadx for Java source recovery, and androguard for manifest inspection, dangerous permission-combination detection, and identification of obfuscated code, dynamic code loading, and reflection-based API calls. Use to statically…

mukul975/Anthropic-Cybersecurity-Skills · 84 tokens

analyzing-linux-elf-malware

Analyze malicious Linux ELF binaries — botnets, cryptominers, ransomware, and rootkits targeting Linux servers, containers, and cloud infrastructure — through static analysis, dynamic tracing, and reverse engineering of x8664 and ARM samples. Use when investigating Linux malware, triaging a suspicious ELF binary…

mukul975/Anthropic-Cybersecurity-Skills · 82 tokens

ix

This skill should be used when answering structural questions about a codebase: understanding what a symbol is, tracing flows, measuring change impact, finding callers/callees/imports, or detecting code smells. It drives the Ix CLI (ix map/explain/trace/impact/search/rank/smells) against a persistent code graph stored…

ix-infrastructure/Ix · 103 tokens

cymbal

Tree-sitter indexed code navigator. Use the cymbal CLI — not Read, Grep, Glob, or Bash — for finding where symbols are defined, tracing callers and callees, locating interface implementations, understanding the impact of a change, and mapping imports across an existing codebase. Returns precise, token-efficient…

1broseidon/cymbal · 89 tokens