extract

extract is a command for Claude Code from vitorpamplona/amethyst. It costs 10 tokens per session (353 once invoked), scanned A, original, MIT.

A command for moving a user-interface component from the Android-only part of Amethyst into shared Kotlin Multiplatform code. It checks the component's platform dependencies, creates shared or platform-specific versions, and updates references.

In plain words
What is it for?
Use it when sharing a composable, moving business logic into common code, replacing Android resources and context access, adding expect/actual implementations, and updating the desktop app when needed.
Why use it?
It reduces duplicated interface code while preserving Android-specific behavior where shared code cannot replace it. It also identifies APIs such as camera access or Android notifications that need platform-specific implementations.

Command for Claude Code

About the project

Amethyst is an Android client for Nostr, a social network protocol that lets people control their own social activity and connections. People use it to read and publish Nostr content, follow accounts, and exchange encrypted direct messages from Android and other supported platforms. The catalogue add-ons support workflows for developing or operating the client.

vitorpamplona/amethyst · 1,595 stars · on GitHub

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 commands/vitorpamplona/amethyst/extract
Clone the repo
git clone --depth 1 https://github.com/vitorpamplona/amethyst

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 extract

README.md
[![agentmods](https://agentmods.dev/badge/commands/vitorpamplona/amethyst/extract.svg)](https://agentmods.dev/commands/vitorpamplona/amethyst/extract)
Your own site
<a href="https://agentmods.dev/commands/vitorpamplona/amethyst/extract"><img src="https://agentmods.dev/badge/commands/vitorpamplona/amethyst/extract.svg" alt="Measured on agentmods" height="20"></a>
Per session 10 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 353 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.00010 $0.00353
Opus 5 $0.00005 $0.00177
Sonnet 5 $0.00002 $0.00071
Haiku 4.5 $0.00001 $0.00035

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

Security

Grade A, and why

extract 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 4d 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.

.claude/commands/extract.md · 51 lines

What it actually says

Extract the component $ARGUMENTS from the Android app to shared KMP code:

Process

  1. Locate the component in the amethyst module:

    find amethyst/src -name "*$ARGUMENTS*"
    grep -r "fun $ARGUMENTS\|class $ARGUMENTS" amethyst/src/
    
  2. Analyze dependencies:

    • Android-specific imports (Context, Intent, etc.)
    • Platform APIs (Camera, MediaStore, etc.)
    • Android Compose specifics vs standard Compose
  3. Identify what can be shared:

    • Pure Composable functions → commons/commonMain/
    • Business logic → quartz/commonMain/
    • Platform-specific → create expect/actual
  4. Create shared version:

    • Move to appropriate shared module
    • Replace Android imports with multiplatform alternatives
    • Add expect declarations for platform-specific parts
  5. Update references:

    • Change imports in amethyst module
    • Add implementations in desktopApp if needed

Common Replacements

Android Multiplatform
LocalContext.current expect/actual or parameter
stringResource() Res.string.*
painterResource() painterResource(Res.drawable.*)
Toast.makeText() Custom snackbar/notification
Intent expect/actual for navigation

Example

/extract NoteCard

This will find NoteCard, analyze its dependencies, and guide you through extracting it to shared code.

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. 4d ago First seen · 51 lines · 10 tokens per session scan A cda79e5c86d5

Subscribe to this mod's changes

extract is a command published in the GitHub repository vitorpamplona/amethyst (1,595 stars, last pushed today), licensed MIT. It adds 10 tokens to every session and 353 once invoked, about $0.0001 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.