Back to Kun Chen

High Throughput Agentic Engineering with ex-Meta L8 Principal

Kun ChenSeptember 13, 202653m
In a Nutshell

Kun runs First Mate as a single orchestrator that dispatches work to dozens of specialized crewmates across 36 projects, with each crewmate using model-specific rules (Fable for UI, Opus for planning, Luna/Sonnet for simple fixes) and quota-aware selection. Second mates scale capacity by owning entire domains on remote machines while Herder provides unified navigation and Lavish delivers interactive prototype reviews. The workflow routes bug reports from Discord/X directly into the same session, lets automatic compaction handle context limits, and applies "direct PR plus yolo" or "no mistakes" policies based on project risk.

AI-Generated Notes

These notes were generated by AI and may contain inaccuracies.

Kun, previously an L8 principal engineer at Meta, Microsoft, and Atlassian, is sharing an advanced workflow focused on high throughput multitasking through a large number of agents. The approach builds on previous videos about agentic engineering basics.

Herder is a multiplexer that manages all agent sessions and enables easy navigation between sessions. First Mate is an open source project created by Kun that serves as the core workflow where the user only interacts with one agent, and First Mate orchestrates all other agents to minimize context switching.

Setup requires cloning the repository and launching an agent within it. The user utilizes Pi for most models and Claude Code when needing Anthropic models like Opus and Fable. Currently using Grok 4.5 because it is faster, more efficient, and more direct compared to Grok 4.6, which has a non-human personality.

When the new model comes out, don't assume the new model is always better than the last. Use it for a bit and get a sense for how the model behaves by yourself and look at how other people have summarized their learnings as well.

Voice input is used by default because it is faster than typing for natural language prompts. Typing is only used for URLs or specific text. First Mate manages 36 projects total, including both open source and private projects, with all tasks handled through a single agent session.

Backpass is a tool that analyzes past agent sessions to detect improvements for agents.mmd and cloud.md files. The planned feature allows Backpass to collect agent sessions across multiple remote machines.

First Mate looks into projects to find previously made plans and delegates work to implementation agents. The Pi agent terminal shows minimal activity with a custom extension called Com that hides tool call noise, displaying only a floating boat animation to indicate the agent is working. The Com command toggles detail visibility.

Crew dispatch.json contains dispatch rules that determine which agent harness and LLM model to use for each crew mate. The user does not write these rules manually but instructs First Mate on preferences, and First Mate configures the file accordingly.

  • Fable is used for new feature development work on the iOS app because it excels at building good UI
  • Codex with GPT 5.6 Soul is used when tasks require generating images due to native image generation tools
  • Fable, Kim K3, and Astra are used for technical product design, architecture, or genuinely difficult planning work
  • Luna, Sonnet, Cursor, and Grok 4.6 are used for simple bug fixes where root cause and expected behavior are well defined
  • Default is Claude Opus when tasks don't match specific rules

When multiple models match a rule, First Mate selects the model with the most available quota.

Quota Axi is a tool that monitors subscription quotas across Claude, Codex, Cursor, and Grok. The TUI interface is for human use while the default CLI is for agent use. First Mate calls Quota Axi to access quota information and selects models with the most available quota.

Fry with Me is a relaxing procedurally generated game featuring a bird flying across different worlds. The game runs on a second monitor with sound turned off to help maintain focus while coding.

Three improvements requested:

  • Prototype better looking snowy mountains
  • Add northern lights that appear randomly at night with realistic appearance
  • Prototype multiple different bird types for user selection

Each idea requires three different variants, with prototypes delivered through Lavish for review. All prototypes to be done by Fable crew mates in parallel.

First Mate remains available for conversation while crew mates handle actual work. Multiple tasks can be dispatched simultaneously without waiting for previous tasks to complete. The user can continue providing prompts even while First Mate is actively working.

Bearings is a built-in skill that collects snapshots of all active tasks across the fleet. Bearings Lavish generates the report in Lavish format as an interactive HTML instead of terminal output. Follow-up prompts queue behind current actions and only execute after current actions complete.

  • Follow-up: Alt+Enter, queues prompt behind current actions
  • Steer: Enter, immediately sends prompt to First Mate

The interactive HTML report shows:

  • What's charted next
  • What's currently underway
  • What's recently landed
  • Captain's calls requiring decisions at the top

Decisions recorded include:

  • Workaround for Lavish onboard
  • Claude exit confirm dialogue fix
  • Props up sub
  • Herder missing endpoints recreate
  • Keep refuse escalate
  • URL wrap bug fix for ship app
  • Ship follow-up for first-time user experience
  • Diaglide banner build
  • Design kit mock removal
  • Dial nested fan editor
  • Drag into group customization

Second mates scale up First Mate's capacity by owning different domains of the charter. Each second mate functions as its own first mate with independent crew mates, memory, and instructions. Work on specific domains routes automatically to the appropriate second mate.

Herder manages agent sessions across multiple machines. The Mini Mac Mini runs headlessly on a shelf and hosts multiple second mates including first mate development, ship, Eddie's wallet, Axi, and a default second mate. The Mac Mini has more hardware resources than the MacBook local machine.

The Lavish board for Fry with Me bird prototypes shows interactive artifacts with current bird comparisons and multiple prototype variants including:

  • Soaring raptor
  • Slender swallow
  • Large ocean glider
  • Long necked crane
  • Soft night owl

The user reviews bird prototypes through Fable's interface. The system displays key features of each bird type and provides recommendations at the bottom. Current birds include a raptor and swallow, while the glider is considered redundant with the existing design. The user decides to keep the crane and owl, then instructs the system to build the selected birds and sends feedback back to the Fable crewmate.

Seven crewmates are now working in parallel across multiple projects. The first mate remains idle and available for new tasks. The user typically continues providing additional ideas and work items while waiting for current tasks to complete. A second mate has landed with unreleased user-facing features including auto pay local.

A Discord server with over 1,000-2,000 members serves as a community hub for discussions about first mate, models, and harnesses. The user uses a bug reports channel to identify issues needing attention. A treehouse project bug report indicates a hook is not firing, with substantial debug information already available.

The first mate bot can be summoned from Discord to investigate issues, with messages relayed back to the local first mate session. The same functionality works on X (Twitter), where user reports about confusing settings can be addressed by adding the first mate to the thread. This creates a unified agent session that holds intent and context across all projects.

Grok 4.5 has a 500k token context window limit, with over 40% already used. While manual context management can optimize token usage and potentially improve agent performance, the recommendation is against manual management. Human attention and time represent the most precious resource and primary bottleneck. Setting a constant threshold for automatic compaction is advised rather than manual optimization.

For Claude Code with its default 1 million token limit, an environment variable cloud_code_autocompact_window can be set to 500k tokens to trigger automatic compaction. The philosophy is to let automatic systems handle context management rather than spending mental bandwidth on optimizations.

The treehouse investigation reveals that hooks are intentionally discarded for safety reasons, explaining why the destroy hook never runs. This is a security measure where repository hooks are kept untrusted. The first mate dispatches a warning fix and posts an update to the Discord thread.

Each project has a policy defined in projects.md under the first mate configuration. The "fly with me" project uses a "direct PR plus yolo" policy, allowing the first mate to make judgment calls and merge without review. Different policies apply based on project risk level - "no mistakes" for high-stakes projects, "yolo" for low-risk projects where changes won't be immediately released.

The "no mistakes" pipeline performs adversarial review and extensive validation, taking significant time and tokens. The decision framework is: if you wouldn't ask another human to review the code change, you probably don't need "no mistakes." If the change is risky enough to warrant human peer review, then "no mistakes" activation is worthwhile.

A new lavish artifact presents snow-capped mountain variants including painted alpine, storybook cap, glacial jade, and carved peaks. The user requests Mount Everest and K2 reference photos to guide improvements toward more realistic mountain peak appearances. The agent provides climate modeling and three shading studies to inform the variants.

The AOY skill built into the first mate repository summarizes what the first mate has communicated since the last user message and identifies open decisions. This helps maintain awareness of progress across multiple parallel workstreams without reviewing every individual message.

When GitHub returns an internal server error during PR creation for the treehouse warning fix, the first mate automatically authorizes a retry. This demonstrates the orchestrator role where the first mate handles infrastructure issues without requiring user intervention.

A new lavish board presents the five birds variant selector with color options for each bird type. The interface includes mobile optimization and proposes a corner word that opens a strip, with colors grouped by kind and cycling through variants. The user approves the straightforward chooser implementation.

The snowy mountains update incorporates real Mount Everest photos as reference material. New variant D shows improved rock and snow definition. The user selects variant D and requests changes to the mountain shapes themselves, specifically wanting taller and sharper pyramid peaks.

The treehouse warning fix PR that went through the no mistakes pipeline contains intent documentation, change summary, risk assessment (rated low), and comprehensive testing results. Nine out of ten scenarios were validated, including stderr warning emission and verification that repository-level hooks remain untrusted and unexecuted. Documentation updates were appropriately skipped from live testing requirements.

The demonstrated workflow shows how to direct large numbers of agents working in parallel without cognitive overload. All project communications from Discord, X, and other surfaces funnel into a single first mate session that orchestrates crewmates across multiple projects while maintaining context and intent across the entire portfolio.

Keep Kun Chen in your library

Save the videos and channels worth coming back to, and find them again in one place.