auto_trader: Command for Claude Code

.claude/commands/fill-event-triage.md

fill-event-triage is a command for Claude Code from mgh3326/auto_trader. It costs 41 tokens per session (1,821 once invoked), scanned A, original, MIT.

A read-only workflow for reviewing a completed trade, called a fill, especially after selling an asset.

In plain words
What is it for?
Use it to review buy or sell fills, inspect balances and holdings, recover recent decisions, and record a dry-run follow-up.
Why use it?
It restores relevant trading context and checks the resulting cash and portfolio state without placing a real order.

Command for Claude Code

Written for Claude Code: $ARGUMENTS substitution.

This is mgh3326/auto_trader's own configuration. It tells Claude Code how to work on auto_trader itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything auto_trader configures →

Reuse

Borrowing it

Nothing to install: this file belongs to mgh3326/auto_trader. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/mgh3326/auto_trader/main/.claude/commands/fill-event-triage.md
Clone the repo
git clone --depth 1 https://github.com/mgh3326/auto_trader

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 fill-event-triage

README.md
[![agentmods](https://agentmods.dev/badge/commands/mgh3326/auto_trader/fill-event-triage/github.svg)](https://agentmods.dev/commands/mgh3326/auto_trader/fill-event-triage)
Your own site
<a href="https://agentmods.dev/commands/mgh3326/auto_trader/fill-event-triage"><img src="https://agentmods.dev/badge/commands/mgh3326/auto_trader/fill-event-triage/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 fill-event-triage

Your own site · 80×15
<a href="https://agentmods.dev/commands/mgh3326/auto_trader/fill-event-triage"><img src="https://agentmods.dev/badge/commands/mgh3326/auto_trader/fill-event-triage.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 41 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,821 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.00041 $0.01821
Opus 5 $0.00020 $0.00911
Sonnet 5 $0.00008 $0.00364
Haiku 4.5 $0.00004 $0.00182

Measured 9d ago against content hash 37bb96b37636, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

fill-event-triage 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 9d 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/fill-event-triage.md · 97 lines

How it starts

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

fill-event-triage

체결(fill) 이벤트가 들어왔다. 너는 신선한 세션이지만, 매매 맥락은 지속 아티팩트에 산다. 아래 순서로 맥락을 복원하고, 매도/매수 분기에서 적절히 분석하고, dry_run 제안까지만 낸다. 실주문 금지.

입력

$ARGUMENTS 에 공백구분 key=value 로 체결 요약이 온다: ledger_id=... event_key=... broker=... account_mode=... market=... symbol=... side=... filled_qty=... filled_price=... filled_notional=... currency=... filled_at=... correlation_id=... 먼저 이를 파싱한다. market이 비면 crypto로 간주.

1. 맥락 복원 (반드시 이 순서)

  1. get_operating_briefing(market=<market>) — 현재 보유 / 미체결 주문(만료시각) / 활성 watch / 최신 리포트 / 최근 session_context.
  2. get_cash_balance(...)매도 체결 후 현금/주문가능금액 재확인 (핵심). 특히 sell fill에서 어떤 통화로 얼마가 풀렸는지, 주문가능금액의 변화까지 같이 본다.
  3. get_portfolio_allocation(include_cash=true) — 활성 MCP profile에 해당 도구가 노출되어 있는 경우에만 호출한다. 매도 후 포트폴리오 비중 변화 / 현금 비율의 타겟 괴리를 점검한다.
  4. session_context_get_recent(market=<market>, limit=10) — 직전 트리아지·결정 핸드오프(decision/next_action/open_question). "지난번에 뭘 보고 뭘 미뤘나".
  5. session_context_append(...) — refs에 {event_key, ledger_id, correlation_id, symbols} 포함해 다음 신선 런이 읽을 핸드오프를 적재.

2. 분석

side 값에 따라 분기한다. 두 분기 모두 read-only 검토이며, 어떤 분기에서도 실주문을 호출하지 않는다.

분기 A — 매도(sell) 체결

풀린 현금과 그 재배치 판단에 집중한다.

  • 어떤 현금/통화가 풀렸는가? (filled_notional × currency, 수수료/슬리피지 고려)
  • 매도 후 현재 포트폴리오가 타겟 대비 under / over 어디에 있는가? (get_portfolio_allocation 결과의 비중 vs 타겟)
  • 기존 후보(latest report) / 활성 watch / 직전 session_context 중 매도 자금으로 재검토해야 할 것이 있는가?
  • 운영자가 검토할 dry-run buy / redeploy 제안은 무엇인가? (재배치 후보 종목, 분할 수량, 지정가 구간)

분기 B — 매수(buy) 체결

체결된 트랜치의 완결성과 잔여 주문 가정의 유효성에 집중한다.

  • 의도된 트랜치(tranche)가 실제로 다 체결되었는가? (filled_qty vs 의도 수량)
  • 남은 rung(미체결 주문) 가정이 여전히 유효한가? (지정가, 노트, 손절선, max_action)
  • 운영자가 남은 주문을 pause / tighten / leave 중 어떻게 해야 하는가? 그 근거는 무엇인가?

분기 C — buy.support_reserve_net confirmed fill (operator §45/§46)

이 분기는 confirmed broker fill 이고, 해당 주문이 동일 policy version의 buy.support_reserve_net 티어였다는 주문/제안 증거가 있을 때만 적용한다. 가격 모양, 심볼, 또는 추정 RSI로 티어를 추론하지 않는다. 귀속 증거가 없거나 주문 상태가 unknown/ambiguous이면 KEEP_RESERVED_AND_BLOCK으로 결론 내리고 취소 대상이나 가용 현금을 만들어내지 않는다.

Read the full file on GitHub · 97 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. 9d ago First seen · 97 lines · 41 tokens per session scan A 37bb96b37636

Subscribe to this mod's changes

fill-event-triage is a command published in the GitHub repository mgh3326/auto_trader (6 stars, last pushed today), licensed MIT. It adds 41 tokens to every session and 1,821 once invoked, about $0.0002 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.