Skip to content

Instantly share code, notes, and snippets.

View cometkim's full-sized avatar
stealth mode

Hyeseong Kim cometkim

stealth mode
View GitHub Profile
@cometkim
cometkim / comparison.md
Last active April 22, 2026 09:30
Token count change due to Claude's tokenizer update

Token counting: claude-opus-4-6 vs claude-opus-4-7

Generated: 2026-04-16 15:39:30 UTC

Both columns come from the real /v1/messages/count_tokens endpoint.

Summary by category

Category claude-opus-4-6 claude-opus-4-7 Ratio
@cometkim
cometkim / SKILL.md
Last active April 24, 2026 01:02
Python FastAPI dependency-injection convention as a agent skill

name: dependency-injection description: FastAPI pattern for app-scoped dependency injection via ResourceProvider[T] classes. Each provider owns one resource's construction and teardown as a single @asynccontextmanager, declares dependencies on other providers via constructor arguments, and is exposed as a fastapi.Depends callable; providers are composed into the app with compose_providers(*providers), which accepts None entries so conditional wiring inlines at the call site as provider if cond else None. "Resource" is load-bearing - this is only for things that live for the lifetime of the app. Per-request values (authenticated user, request-id, per-request DB transaction) use plain async def + Depends; ResourceProvider is not a universal DI container. Trigger whenever you add, refactor, or wire any app-scoped resource in a FastAPI project; HTTP clients, DB pools, service clients, Kafka producers/consumers, schedulers, caches, feature-flag clients, or any singleton that previously