Matt Pocock

/handoff 스킬 — compact이 못 하는 세션 간 컨텍스트 인수인계

Matt Pocock

Matt Pocock이 '스킬이 되기엔 너무 단순하다'고 생각했던 handoff를 결국 스킬로 만든 이유. 현재 세션의 컨텍스트를 markdown 한 장으로 압축해 다른 세션에 건네는 패턴 — smart zone·dumb zone과 120k 예산, compact의 퇴적층식 한계, grilling 도중의 scope 분리, prototype 학습을 부모 세션으로 되돌리는 DIY sub agent, harness 중립적 markdown 인수인계까지.

/handoff 스킬 — compact이 못 하는 세션 간 컨텍스트 인수인계

생각 덩어리

스킬이 되기엔 너무 단순해 보였던 것 — 본능을 스킬로 패키징하기

A few weeks ago, I noticed myself doing something with agents that I thought was very clever, but I thought it was just too simple to require a skill.

I'm constantly thinking about how to package my instincts and coding practices into reusable skills. And this has meant my skills repo has almost 100,000 stars at the time of recording.

스킬의 전부 — 대화를 markdown 한 장으로 압축해 임시 디렉토리에

The theory was that this skill would take the context window of the current session and compress it down into a markdown file that could be handed off to another session.

It's a very very simple skill. It says to write a handoff document summarizing the current conversation so a fresh agent can continue the work. Save it to the temporary directory of the user's operating system, not the current workspace.

I put this into my skills folder as an experiment to see how much I would use it. And it turns out I used it a lot.

Smart zone과 dumb zone — 1M을 광고해도 쓸 만한 건 120k

There is actually a smart zone and a dumb zone in these context windows. Early on in the context window you are going to get much better performance from the agent because the attention relationships are not so strained there because there's much fewer tokens to calculate.

As your conversation develops, you're going to get dumber and dumber and dumber responses from the agent all the way up to going up to ... 800,000 tokens, which personally I've never been in because around by the 120k token mark, I start to feel like I'm in the dumb zone.

Even though Anthropic advertises a ton of context window on these models really for ... proper smart tasks you've only got about 120k to work with which means you need to budget really efficiently and you need to be aware of your context window at all times.

Compact의 본질 — 퇴적층을 쌓으며 한 세션을 길게 끄는 도구

What compact does is it will take a large conversation like this and summarize it. So you go essentially from near to the dumb zone to all the way into the smart zone here.

As you continue to compact and compact, you're going to end up with this kind of sediment of different layers here from previous conversations.

It can be really useful for debugging actually because you can compact all of the other options that you've tried and then continue to try different things, hit the barrier and then compact again to just save your state essentially. So it's a way of doing a long running session, but it's only really one session.

Compact이 못 하는 것 — 슬라이스만 잘라 옆 세션으로

While I was in this session, I noticed a little refactoring opportunity, something that was totally out of bounds, out of scope from my current session, but I knew I would need to get there eventually.

I could extend my current session, but then I would end up with this sort of like diluted context where I was half working on one thing, half working on the other, and I would definitely hit the dumb zone ... I could compact, but then I would clobber all of the progress that I'd made in my current session.

I wanted to essentially take the context or take just the slice that pertains to this extra bug fix, hand it off to another session, and then these two could just run independently.

It turned out I was doing this so freaking often that I just decided, okay, I need a skill for this.

Grilling 도중의 handoff — 넘기는 순간 현재 세션이 날카로워진다

I say here, I think in future we may want to move the iterations and the completion signal onto a separate API. In fact, let's hand off that task to a separate agent.

First of all, it actually sharpens the current grilling session I'm on. So, it says that given that constraint, Q2 collapses. ... It helps my current grilling session because I'm saying that's out of scope. We'll pick that up somewhere else.

Prototype으로 handoff, 다시 부모에게 — DIY sub agent 패턴

There are the kind of known unknowns, the ones that the agent can ask you about, and then there's stuff that you really need to see in code or need to see prototyped. This can be really true with like UI prototypes or complicated bits of logic that you're not quite sure how to deal with yet.

In the prototype session, this ended up being a huge session. So 169K tokens, so way bigger than would have fit inside the grilling. ... Then I said, okay, let's hand this off back to the grilling session that spawned this. Take all of the learnings from the prototype, anything that's not directly captured in the prototype itself or that's nonobvious, give me a handoff document that I can pass back to the planner.

It's almost like you've done a kind of DIY sub agent where you're able to use a context window for one specific task, compress your learnings from that task, and pass it back to the parent.

Markdown이라서 harness 중립 — Claude Code에서 Codex로

The thing that's cool about just using like a markdown document here and not relying on kind of native agent stuff is that you can have this first session be Claude Code, but you can just pass this to another agent, right? You can pass it to Codex or pass it to ... Copilot CLI whatever you're using. So if you want to do any kind of adversarial review or any kind of ... interaction between different coding agents this is a very very simple way to do it.

스킬 설계의 디테일 — suggested skills·포인터·일회용 문서·목적 명시

Having a suggested skills section means that you can kind of just paste the handoff document into the new session. It will invoke the skills needed like grill with docs or diagnose or prototype or something and then you're kind of good to go.

I would often find these handoff documents just got really big and they were just duplicating stuff that was already present either in other markdown files or in resources like GitHub issues ... It's basically saying just use pointers instead of ... repeating everything that's in the document.

These handoff files are disposable. They are not something to be kept around for a long time to rot in your codebase as documentation.

Every time I use handoff, I always describe the purpose, the reason that we're handing off because I just can't see how you would write a good handoff document otherwise. And of course, dictation makes this really easy because I just blast it out and we're good to go.

YouTube 원본 →원본 사이트 →