• Projects
  • Service
  • About
  • branding.bz
  • Podcast
  • Tips
  • FAQ
  • Recruit
  • Download
  • Contact
  • branding.bz(ブランド構築SaaS)
  • DESIGN NOW(デザインメディア)
  • X
  • LinkedIn
  • Spotify
  • Facebook

213-0011 神奈川県川崎市高津区久本3-6-7-303

© 2026 ID INC. All rights reserved

claude-skills/スキル
SKILLOfficialproductivity

workflows-optimize-credits

プラグイン
clay
ソース
GitHub で見る ↗
説明

Clay ワークフロー — CLI(`clay workflows` コマンド)を使用して、ワークフローの実行にかかるクレジット(利用料金)と LLM コストを削減します。高額な処理パターンを見つけ出し、より安価な代替案を提案します。

原文を表示

Clay workflows — reduce a workflow's credit and LLM cost via the CLI (`clay workflows` commands). Identifies expensive patterns and suggests cheaper alternatives.

ユースケース
  • ワークフロー実行のクレジット削減方法を探す
  • LLMコストを削減したい
  • 高額な処理パターンを特定する
  • 安価な代替案を検討する
本文(日本語訳)

ワークフローのクレジット・LLMコスト削減

現在のワークフローを分析し、品質を損なわずにクレジット消費とLLMコストを削減する変更提案を行います。

処理の流れ

  1. ワークフローの読み込み — clay workflows graph get <workflowId> --mode full を使ってすべてのノード(処理ステップ)の詳細を取得
  2. コスト要因の特定 — LLM呼び出し、Clay アクション利用、モデル選択などから費用がかかっている箇所を探す
  3. 最適化の機会を提示 — 見積もり効果を示し、clay workflows diagram <workflowId> で現在のグラフを表示して、どのノードが費用を増やしているかを明らかにする
  4. 認可されている変更を実行 — ユーザーの指示で変更が許可された場合のみワークフローを編集(clay workflows nodes update/create/delete を使用)。許可されたら安全な最適化から順に適用し、品質や動作に大きな影響がある変更については事前に確認する
  5. 結果を表示 — 適用後に clay workflows graph format <workflowId> を実行して更新されたグラフを表示し、変更を視覚的に確認できるようにする

処理全体を説明し、生のノード情報ではなく図を優先して表示する(workflows スキルの presenting.md を参照)。

Clay ワークフローのコスト要因

LLM呼び出し(最大のコスト要因)

通常の LLM ノードは、実行ごとに最低でも1回以上の LLM 呼び出しを行います。より高性能なモデルほど費用がかかります。

最適化方法:

  • コードノードで置き換える — データ変換、フィルタリング、フォーマットなど確定的な処理(同じ入力に対して常に同じ出力が得られる処理)を行うノードはコードノードで置き換える。LLM費用はゼロになります
  • より安いモデルを使う — パラメータ抽出や基本的な分類など単純なタスクは小型・高速モデルでよく、複雑な推論が必要なタスクにだけ高性能モデルを予約する
  • ノードを統合する — 関連する処理を行う連続した2つの LLM ノードは、1つのノードにまとめて、プロンプト(指示文)を組み合わせることが多い。LLM呼び出しが半分に減ります
  • アクションのパラメータを事前設定する — ノードが Clay アクション(外部サービスの連携処理)を呼び出す場合、LLM推論が不要なパラメータは static(固定値)または reference(参照値)入力マッピング(inputMappingConfig、workflows スキルの data-passing.md を参照)で設定する。すべてのパラメータが事前設定されていれば、LMパラメータマッピング呼び出しはスキップされます

Clay アクションのクレジット消費

Clay アクション実行ごとに、アクションの料金レベルに応じたクレジットが消費されます。

最適化方法:

  • 重複した情報取得を避ける — 同じデータが前のノードで既に取得済みの場合は、ピン留め入力(sourceNodeId/sourcePath)で参照して、再度アクションを呼び出さない
  • 条件付きルーティングを使う — データが不要な項目については高額な情報取得をスキップする(例:既にデータがある企業の調査を除外する)
  • より安い代替手段を選ぶ — 同じような機能でも安いアクションがある場合がある。clay workflows actions list(/workflows-discover-actions を参照)で選択肢と料金レベルを比較する

モデル選択

モデルごとに費用対効果のバランスが異なります。

最適化方法:

  • タスクの複雑さに合わせてモデルを選ぶ
    • 単純な抽出・分類 → 小型で高速なモデルを使う
    • 複雑な推論・多段階の分析 → より高性能なモデルを使う
    • 創作や微妙な判断 → 最高性能のモデルを使う
  • 安全な範囲でダウングレードする — 各 LLM ノードのプロンプトを見直し、タスクが単純であれば安いモデルへの変更を検討する

マップノード(複数項目処理)の効率

マップノードは処理する項目数だけコストが増えます。

最適化方法:

  • エージェントモードではなくコードモードを使う — マップ処理が確定的であればコードモードを使う(項目ごとの LLM 費用はゼロになります)
  • マップ前にフィルタリングする — マップの前にコードノードを追加して、処理が不要な項目を除外する
  • チャンクサイズを縮小する — チャンクが小さければ、チャンクが失敗したときの無駄な処理が減ります
  • 集約に reduce を使う — すべての項目を個別に処理して集める代わりに、reduce でキーごとに集約すれば、下流の処理ステップが減ります

条件付きルーティング

条件付きノード(条件判定ノード)を使って、不要な項目については高額な処理分岐をスキップします。

例:

従来:    [すべての項目] → [高額な情報取得] → [処理]
改善後:  [すべての項目] → [条件判定: データあり?] → Yes → [処理]
                                          → No  → [情報取得] → [処理]

分析結果の出力形式

最適化の機会ごとに、以下を提示します:

  1. 対象ノード — 変更対象のノード
  2. 現在のコストパターン — 何が高額で、なぜか
  3. 提案する変更 — 具体的な修正内容
  4. 見積もり効果 — 定性的(高/中/低)なコスト削減度
  5. リスク — 品質への影響がないか

提案は削減効果の大きい順に優先順位を付けます。提案一覧と現在のグラフ表示を並べ、高額なノードを目立たせることで、各提案がどこに該当するかを明確にします。

分析または推奨提案の場合は、編集せずに機会を提示します。ユーザーがワークフロー修正を指示したら、明らかに安全な削減を特定した順に適用し、前提条件を説明します。品質・コスト・動作に大きな影響があれば事前に確認してから実行します。その後 clay workflows graph format <workflowId> で検証し、更新されたグラフを表示して、ユーザーが変更前後の違いを確認できるようにします。

原文(English)を表示

Reducing workflow credit & LLM cost

Analyze the current workflow and suggest changes to reduce credit consumption and LLM costs without sacrificing quality.

Process

  1. Read the workflow using clay workflows graph get <workflowId> --mode full to get all node details
  2. Identify cost drivers — LLM calls, Clay action usage, model selection
  3. Present optimization opportunities with estimated impact, alongside a render of the current graph (clay workflows diagram <workflowId>) with the expensive nodes called out so the user can see where the cost lives
  4. Apply authorized changes — edit the workflow only when the user's request authorizes modifications, via clay workflows nodes update/create/delete. Once authorized, apply clearly safe optimizations as you go and ask before changes with a material quality or behavior trade-off
  5. Show the result — after applying, run clay workflows graph format <workflowId> and render the updated graph so the change is visible

Narrate throughout and prefer the diagram over raw node JSON — see the workflows skill's presenting.md.

Cost Drivers in Clay Workflows

LLM Calls (biggest cost driver)

Every regular (LLM) node makes at least one LLM call per execution. More capable models cost more.

Optimizations:

  • Replace with code nodes: If a node does deterministic work (data transformation, filtering, formatting), replace it with a code node — zero LLM cost
  • Use cheaper models: Simple tasks (parameter extraction, basic classification) can use smaller/faster models. Reserve powerful models for complex reasoning
  • Merge nodes: Two sequential LLM nodes doing related work can often be one node with a combined prompt — cuts LLM calls in half
  • Pre-map action parameters: When a node calls a Clay action, configure static or reference input mappings (inputMappingConfig, see the workflows skill's data-passing.md) for parameters that don't need LLM inference. If ALL parameters are pre-mapped, the LLM parameter mapping call is skipped entirely

Clay Action Credits

Each Clay action execution consumes credits based on the action's pricing tier.

Optimizations:

  • Avoid redundant enrichments: If the same data was already fetched in an earlier node, reference it via a pinned input (sourceNodeId/sourcePath) instead of calling the action again
  • Use conditional routing: Skip expensive enrichments for items that don't need them (e.g., skip company research for companies you already have data on)
  • Choose cheaper alternatives: Some actions have cheaper equivalents. Use clay workflows actions list (see /workflows-discover-actions) to compare options and their priority tier

Model Selection

Different models have different cost/capability profiles.

Optimizations:

  • Match model to task complexity:
    • Simple extraction/classification → use a smaller, faster model
    • Complex reasoning, multi-step analysis → use a more capable model
    • Creative writing, nuanced decisions → use the most capable model
  • Downgrade where safe: Review each regular node's prompt. If the task is straightforward, try a cheaper model

Map Node Efficiency

Map nodes multiply costs by the number of items processed.

Optimizations:

  • Code mode over agent mode: If map processing is deterministic, use code mode (zero LLM cost per item)
  • Filter before mapping: Add a code node before the map to filter out items that don't need processing
  • Reduce chunk size: Smaller chunks mean less wasted work if a chunk fails
  • Use reduce to aggregate: Instead of processing all items individually and collecting, use reduce to aggregate by key — fewer downstream processing steps

Conditional Routing

Use conditional nodes to skip expensive branches for items that don't need them.

Example:

Instead of:  [All items] → [Expensive enrichment] → [Process]
Do this:     [All items] → [Conditional: has data?] → Yes → [Process]
                                                    → No  → [Enrichment] → [Process]

Analysis Output Format

For each optimization opportunity, present:

  1. Node(s) affected — which nodes to change
  2. Current cost pattern — what's expensive and why
  3. Suggested change — specific modification
  4. Estimated impact — qualitative (high/medium/low) cost reduction
  5. Risk — any quality trade-offs

Prioritize suggestions by impact (highest savings first). Pair the list with the current-graph render, with the expensive nodes called out, so each is easy to locate.

For analysis or recommendation requests, present the opportunities without editing. If the user asks you to modify the workflow, apply clearly safe savings as you identify them and state your assumptions. Ask only when an optimization has a meaningful quality, cost, or behavior trade-off. Then validate with clay workflows graph format <workflowId> and show the updated graph so the user can see the before/after difference.

原文・著作権は Anthropic および各プラグイン作者に帰属します。日本語訳は Claude API による自動翻訳です。