sam

sam is an agent for Claude Code from kaisa-kucherenko/claude-code-flow. It costs 0 tokens per session (939 once invoked), scanned A, original, MIT.

A pytest test-writing agent that derives tests from the stated behavior of Python code. It checks that each test targets a real bug and verifies that the test can fail when the code is changed incorrectly.

In plain words
What is it for?
Use it to create focused pytest tests from a task, specification, docstring, or callers, including the expected failure each test is meant to catch.
Why use it?
It avoids writing tests merely to increase the test count or copy the current implementation. If the required behavior is not documented or otherwise recoverable, it stops instead of guessing.

Agent for Claude Code

Written for Claude Code: effort in frontmatter. Also seen: model in frontmatter.

Good fit Use it to create focused pytest tests from a task, specification, docstring, or callers, including the expected failure each test is meant to catch.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/kaisa-kucherenko/claude-code-flow/sam
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/kaisa-kucherenko/claude-code-flow

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 sam

README.md
[![agentmods](https://agentmods.dev/badge/agents/kaisa-kucherenko/claude-code-flow/sam/github.svg)](https://agentmods.dev/agents/kaisa-kucherenko/claude-code-flow/sam)
Your own site
<a href="https://agentmods.dev/agents/kaisa-kucherenko/claude-code-flow/sam"><img src="https://agentmods.dev/badge/agents/kaisa-kucherenko/claude-code-flow/sam/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 sam

Your own site · 80×15
<a href="https://agentmods.dev/agents/kaisa-kucherenko/claude-code-flow/sam"><img src="https://agentmods.dev/badge/agents/kaisa-kucherenko/claude-code-flow/sam.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 939 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.00000 $0.00939
Opus 5.5 $0.00000 $0.00376
Sonnet 5.5 $0.00000 $0.00188
Haiku 4.5 $0.00000 $0.00094

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

Security

Grade A, and why

sam 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.

agents/sam.md · 72 lines

How it starts

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

You write pytest tests that fail when the code is wrong — and only those. Research first: you know what the thing is supposed to do before you go near it. The pytest-quality skill is preloaded: it is the bar, and nothing it says is repeated here. This file is the process.

Time matters here: do not spend time that can be avoided, and the earlier a correct result is obtained, the better.

What you are given

  • The contract: the task, spec, issue, docstring, business cases — what the code must do.
  • The target: module / function / class paths, and where the tests should live.
  • Scope: what is out of it.

If the brief carries the implementer's reasoning about how the code works, treat it as a claim, not a source of expected values. If the contract is missing and the behavior cannot be recovered from docstrings, types and callers — stop and say what is missing rather than inventing it.

Process

  1. Project context (skill §0). Note the run command and asyncio mode.
  2. Test list from the contract — before reading the implementation body. Signatures, docstrings, types and call sites only. For each behavior: the case, the break it catches, the priority (skill §2). This order matters: a list written after reading the body copies the body's mistakes into the expectations.
  3. Read the implementation for seams (what to mock, where the external edge is) and for paths the contract did not mention. A path found only in the code is added only if its behavior can be justified from the contract; if the code contradicts the contract, it is a suspected bug — report it, do not encode it as expected.
  4. Write the tests the list earned. Where an existing parametrize table already covers the behavior, extend it rather than add a near-duplicate test.
  5. Run (skill §6): collected, executed, nothing skipped counted as passing. A test that fails against current code where the contract says the test is right stays as written — report the suspected bug; never bend the test to the output.
  6. Mutation check (skill §6) for every High test. Strengthen any test that let a realistic mutant survive.
  7. Report.

Read the full file on GitHub · 72 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 Changed · -4 lines 8c536cb83c57
  2. 1mo ago Changed · +2 lines c9aa003395b1
  3. 1mo ago First seen · 74 lines · 0 tokens per session scan A 409b7f3d1227

Subscribe to this mod's changes

sam is an agent published in the GitHub repository kaisa-kucherenko/claude-code-flow (25 stars, last pushed 1mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 939 tokens. 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-10-08.

Related

sam compared with agents from other repositories

sam next to 6 agents from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
samkaisa-kucherenko/claude-code-flowAgent251mo agoMITA0Claude Code
test-automator-agentdsifry/metaswarmAgent4423d agoMITA22Claude Code
test-engineersoftspark/ai-toolkitAgent1802d agoApache-2.0A51Claude Code
jasmine-expert0xfurai/claude-code-subagentsAgent1.0k27d agoMITA55Claude Code
testerjosstei/maestro-orchestrateAgent4921mo agoApache-2.0A66Claude Code
testRune-kit/runeAgent96yesterdayMITA35Claude Code
surgeonRune-kit/runeAgent96yesterdayMITA39Claude Code