# Ivan Magda

> Personal blog about AI Engineering and Software Development by Ivan Magda.

## About

- [About](https://ivanmagda.dev/about/): Background, projects, and contact info

## Blog Series: Building a Coding Agent in Swift

A 9-part series documenting a Swift reimplementation of a Claude Code-style CLI agent. Series overview: https://ivanmagda.dev/series/swift-coding-agent/

- [Part 0: Bootstrapping the Project](https://ivanmagda.dev/posts/s00-bootstrapping-the-project/): Setting up a two-target SPM package, strict concurrency, and AsyncHTTPClient
- [Part 1: The Agent Loop](https://ivanmagda.dev/posts/s01-the-agent-loop/): The agent loop that drives everything — how a single stopReason check turns an API client into an autonomous agent
- [Part 2: Tool Dispatch](https://ivanmagda.dev/posts/s02-tool-dispatch/): Dictionary-based tool dispatch, path sandboxing, and file tools
- [Part 3: Self-Managed Task Tracking](https://ivanmagda.dev/posts/s03-self-managed-task-tracking/): A Codable todo system with validation constraints and nag reminders
- [Part 4: Subagents](https://ivanmagda.dev/posts/s04-subagents/): Context isolation through recursive agent loops with restricted tool sets
- [Part 5: Skill Loading](https://ivanmagda.dev/posts/s05-skill-loading/): Two-layer knowledge injection — system prompt awareness and on-demand tool results
- [Part 6: Context Compaction](https://ivanmagda.dev/posts/s06-context-compaction/): Three-layer compression strategy for infinite conversations
- [Part 7: Task System](https://ivanmagda.dev/posts/s07-task-system/): A file-based task DAG with dependency resolution
- [Part 8: Background Tasks](https://ivanmagda.dev/posts/s08-background-tasks/): Swift actors for background execution with notification injection

## Blog Series: Reading Koog

A series reflecting on JetBrains' Koog framework after hand-rolling a Claude Code clone in Swift.

- [Part 1: What I Missed Until I Read Koog](https://ivanmagda.dev/posts/koog-s01-foundation/): After nine posts building a Claude Code-style agent by hand in Swift, the foundation a framework like Koog gives you for free

## WWDC26: Foundation Models Framework

A three-post cluster on the WWDC26 Foundation Models announcements: an overview hub and two deep dives.

- [Foundation Models, Year Two: From On-Device API to General LLM Runtime](https://ivanmagda.dev/posts/wwdc26-foundation-models-year-two/): The framework became Swift's general LLM client — a rebuilt on-device model with vision, Private Cloud Compute, an any-model abstraction layer, agent primitives, and new tooling
- [A Server LLM With No API Keys: Private Cloud Compute in the Foundation Models Framework](https://ivanmagda.dev/posts/foundation-models-private-cloud-compute/): PrivateCloudComputeLanguageModel gives apps a 32K-context server model with reasoning and no cloud API cost — and makes the per-user daily quota a UI design problem
- [An Agent Framework Hiding Inside a Session: Dynamic Profiles in Foundation Models](https://ivanmagda.dev/posts/foundation-models-dynamic-profiles/): Dynamic Profiles turn a single LanguageModelSession into a declarative agent runtime — per-phase models, history transforms, lifecycle hooks, and two orchestration patterns

## Standalone Posts

- [Swift synchronization benchmarks: Mutex, locks, queues, atomics, and actors on real iPhones](https://ivanmagda.dev/posts/swift-synchronization-benchmarks/): Eight experiments on two physical iPhones comparing Mutex, OSAllocatedUnfairLock, NSLock, dispatch queues, Atomic, and actors on tasks taken from real apps
- [Why my Swift debouncer got 50× faster and what the Swift Runtime has to do with it](https://ivanmagda.dev/posts/swift-debounce-runtime-investigation/): A measured investigation of task reuse, Swift runtime metadata, generic specialization, lock placement, and callback latency
- [Keeping Project Memory Shared Between Claude Code and Codex](https://ivanmagda.dev/posts/project-memory-in-the-repository/): Sharing reviewed project notes between Claude Code and Codex, with a reusable migration skill
- [Add Native Progress UI to Your Telegram AI Agent](https://ivanmagda.dev/posts/telegram-native-agent-progress/): Show tool calls and progress in Telegram with native thinking blocks, animated action icons, and a Stop button
- [Fixing the 40k CLAUDE.md Warning in a Monorepo](https://ivanmagda.dev/posts/fixing-40k-claude-md-warning-monorepo/): How we restructured Claude Code's CLAUDE.md files in a monorepo to cut 73% of always-loaded context without losing a single fact
- [Five Things I Learned About Making AI Coding Agents Actually Work](https://ivanmagda.dev/posts/five-things-ai-coding-agents-actually-work/): The biggest gains in AI agent performance come from the system around the model, not the model itself

## Optional

- [swift-claw](https://swift-claw.ivanmagda.dev/): An always-on personal AI assistant in one pure-Swift binary
- [swift-claw repository](https://github.com/ivan-magda/swift-claw): The swift-claw GitHub repository
- [swift-claude-code](https://github.com/ivan-magda/swift-claude-code): The swift-claude-code GitHub repository
- [All Posts](https://ivanmagda.dev/posts/): Browse all articles
- [Tags](https://ivanmagda.dev/tags/): Browse by topic
