flow-import

flow-import is a command for Claude Code from shenchangmin/cairnkit. It costs 19 tokens per session (782 once invoked), scanned A, original, MIT.

A resumable command for turning an existing project's code, documents, and history into draft project knowledge. It runs several separate steps, from collecting sources to profiling the codebase and building knowledge candidates.

In plain words
What is it for?
Use it when starting the knowledge base for an existing project or continuing an import that stopped partway through.
Why use it?
It provides a controlled path for documenting a project whose important rules and decisions are not written down yet.

Command for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: reads ~/.codex paths; mentions Codex.

Part of the cairnkit plugin — 2 skills, 7 commands, 11 agents shipped together

Good fit Use it when starting the knowledge base for an existing project or continuing an import that stopped partway through.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/shenchangmin/cairnkit/flow-import
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.

Clone the repo
git clone --depth 1 https://github.com/shenchangmin/cairnkit

Made for: Claude Code.

Or install cairnkit, the plugin that ships this one along with the rest of its 2 skills, 7 commands, 11 agents.

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 flow-import

README.md
[![agentmods](https://agentmods.dev/badge/commands/shenchangmin/cairnkit/flow-import/github.svg)](https://agentmods.dev/commands/shenchangmin/cairnkit/flow-import)
Your own site
<a href="https://agentmods.dev/commands/shenchangmin/cairnkit/flow-import"><img src="https://agentmods.dev/badge/commands/shenchangmin/cairnkit/flow-import/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 flow-import

Your own site · 80×15
<a href="https://agentmods.dev/commands/shenchangmin/cairnkit/flow-import"><img src="https://agentmods.dev/badge/commands/shenchangmin/cairnkit/flow-import.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 19 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 782 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.00019 $0.00782
Opus 5.5 $0.00008 $0.00313
Sonnet 5.5 $0.00004 $0.00156
Haiku 4.5 $0.00002 $0.00078

Measured 1mo ago against content hash d424336b1121, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

flow-import 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 1mo 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.

commands/flow-import.md · 58 lines

How it starts

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

/flow-import

Make an existing project's implicit knowledge explicit as baseline draft entries.

Start or resume

Run cairn --root . import show. Resume when it succeeds. Run cairn --root . import init only when exit 2 specifically reports that no import is in progress; for any other error, surface it and stop.

The engine's current step is the source of truth:

step role mandate required output
doc-collect doc-collector docs/knowledge-import/01-sources.md
codebase-profile codebase-profiler docs/knowledge-import/02-profile.md
knowledge-build knowledge-builder docs/knowledge-import/knowledge-candidates.json and docs/knowledge-import/03-summary.md

Isolated dispatch for every step

Before each dispatch, resolve the plugin root exactly as the router did. Read the complete role mandate from resources/agents/<role>.md when resources/agents/ exists; otherwise read agents/<role>.md. Never use .codex/agents, ~/.codex/agents, a copied global mandate, or a same-named project or global profile.

Use a named role only when the host explicitly exposes that role as part of this cairnkit plugin. Installed Codex always uses a fresh generic worker with fork_turns="none". Supply only the full mandate, the original user request, current import step, exact allowed write scope from the mandate, and required output paths. Tell the worker not to edit docs/knowledge-import/import-state.json; the parent advances through cairn.

Confirm the worker inherits the required write access before dispatch. If not, stop; do not elevate permissions, never substitute the parent for the role, and never advance a failed dispatch.

After the worker returns, run the check for the current step:

test -f "docs/knowledge-import/01-sources.md" && test ! -L "docs/knowledge-import/01-sources.md" && test -s "docs/knowledge-import/01-sources.md"
test -f "docs/knowledge-import/02-profile.md" && test ! -L "docs/knowledge-import/02-profile.md" && test -s "docs/knowledge-import/02-profile.md"
test -f "docs/knowledge-import/knowledge-candidates.json" && test ! -L "docs/knowledge-import/knowledge-candidates.json" && test -s "docs/knowledge-import/knowledge-candidates.json"
test -f "docs/knowledge-import/03-summary.md" && test ! -L "docs/knowledge-import/03-summary.md" && test -s "docs/knowledge-import/03-summary.md"

Read the full file on GitHub · 58 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. 1mo ago First seen · 58 lines · 19 tokens per session scan A d424336b1121

Subscribe to this mod's changes

flow-import is a command published in the GitHub repository shenchangmin/cairnkit (1 stars, last pushed 3mo ago), licensed MIT. It adds 19 tokens to every session and 782 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.