Every Claude Code session produces decisions, patterns, and context that vanish when the terminal closes. I built a daemon that watches for session endings, extracts the knowledge, distills it with Haiku, and compiles it into an Obsidian wiki with Sonnet — turning every coding session into searchable institutional memory for about $20/month.
Duncan Leung
📚 Learning, 👨🏻💻 Building, 📝 Documenting...
Hi! I'm Duncan Leung and I currently lead Frontend Engineering at Airvet.
In a previous career I worked overseas in Beijing as a Product Manager at a skunkworks studio building digital experience projects for Ford Motor (China) and consulted on UX projects for Starwood Hotels. During this time I also mentored startups at Chinaccelerator and ran startup events and hackathons in Shanghai.
👨🏻💻 I'm a self taught software developer, and this is a place for me to jot down some notes. I mostly cover Javascript, Typescript, React, and software development.
Latest Writing
- Read article
- Read article
Claude Code has a dozen ways to research a question — from a single MCP call to a 98-agent adversarial pipeline. This guide maps every research tool by cost, agent count, and use case so you pick the right one the first time. Includes the full source of a custom deep-research-plus workflow that adds a Perplexity search lane to Claude Code's built-in deep-research pipeline.
- Read article
LLM context rot isn't a bug. It's a mathematical property of how the attention mechanism works. Three interacting failure modes (softmax's sum-to-one constraint, RoPE's distance decay, and causal masking's primacy bias) combine to produce the U-shaped attention curve where models attend well to the beginning and end of context but lose the middle. Understanding the mechanism changes how you structure prompts and manage context.
- Read article
LLM context windows have a marketed size and a useful size, and they're not the same number. Research shows quality degrades gradually based on absolute token count, not fill percentage, and a 1M-token model at 40% full is far more degraded than a 200K model at 40%. Here's the research behind the Smart Zone, the Warn Zone, and the Dumb Zone, plus a Claude Code statusline that tracks which zone you're in and how deep.
- Read article
Opus 5 scores 96.0% on SWE-bench Verified vs Opus 4.6's 80.8%, a 15-point gap. But on blind user-preference coding leaderboards, Opus 4.6 ranks 4th (ELO 1547) while Opus 5 ranks 11th (ELO 1530). Synthetic benchmarks and human preference are telling opposite stories. I ran a two-round adversarial research workflow to figure out which signal to trust and landed on a mixed-model strategy.
Newsletter
Stay updated, receive the latest post straight to your mailbox