Coding agents increasingly work with skills: ready-made procedures that bundle several steps into one call, like "move this module and fix every import". When a skill fits, it is fast. When it does not fit, it fails, and in most setups the run fails with it. This week's paper asks a simple question: what should the agent do in the moment the big skill breaks?
The paper is Adaptive Skill Granularity for Coding Agents: Runtime Routing and Macro-to-Micro Recovery by Dingxuan Zhang, Yanhui Jiang, Jun Wang and Hefeng Zhou (Shanghai Jiao Tong University, Kuaishou Technology, University of Warwick; arXiv 2610.31461, 22 October 2026). The code is public. I checked every number below against the paper's text.
The problem
An agent can solve the same coding task at two sizes of step:
- Small steps (the paper says micro tools): read a file, search, edit, run a syntax check, run the tests. Slow, but each step is easy to check.
- Big skills (macro skills): one call that does several of those at once.
Most work on skills is about choosing which skill to show the agent before it starts. The paper's point is that a second decision comes later, during the run: how big the next step should be, and what happens when a big one fails halfway.
The idea
The agent runs in one of three modes:
- Micro: small steps only.
- Macro: big skills only. A failure ends the run.
- Hybrid: start with big skills. On a failure the agent can see, switch to small steps and continue from the current state of the workspace, not from the start.
The switch is one way, from big to small, and it happens only on a signal the system can observe: the expected text was not there, the syntax check failed, the tests failed, the tool itself failed, or a failure was planted for the test. The paper calls it macro-to-micro recovery.
For the switch to work, each big skill has a written contract: when it applies, which changes it may make to the files, how it checks its own result, how it can fail, and what the small-step fallback is. The prototype has three hand-written skills of this kind: inspect a Python module, replace a piece of text and verify it, and move a Python module and rewrite its imports.
Success is decided by the task's own checks on the final files, "regardless of whether the model declares completion". Every variant uses the same models, tools and checks; only the set of actions the agent may use differs.
The numbers
First, the trade-off on 12 mixed tasks, with no failures planted:
| Mode | Solved | Mean steps | Mean tokens |
|---|---|---|---|
| Small steps only | 12 of 12 | 6.00 | 7,218 |
| Big skills only | 7 of 12 | 2.71 | 3,609 |
| A hand-written rule picks the mode | 9 of 12 | 3.22 | 4,098 |
Big skills used half the tokens and solved 5 tasks fewer.
Then the recovery test: 7 tasks with a failure planted in the big skill.
| When the skill fails | Without fallback | With fallback |
|---|---|---|
| Early, before it did useful work | 0 of 7 | 7 of 7, 11,293 tokens a task |
| Late, after it had made the changes | 7 of 7, 2,440 tokens | 7 of 7, 7,567 tokens |
The early case is the headline: giving up solved nothing, carrying on with small steps solved everything, at a higher token cost.
The late case is the part I find more useful. The big skill had already done the work before it raised the failure, so the run without fallback passed anyway. Falling back every time redid work that was done and cost about three times the tokens for no extra task solved.
The authors' answer is to learn both decisions from past runs: a small decision tree (at most 4 levels deep, stored as a JSON file) picks the starting mode, and a second one decides whether a failure is worth falling back for. On the 12 mixed tasks the learned mode choice solved 12 of 12, against 9 of 12 for the hand-written rule. On the 7 planted-failure tasks the full learned version kept 7 of 7 in both cases. It fell back in only 14 % of the late-failure runs and used 3,694 tokens a task there, against 7,567 for always falling back; on early failures it used 9,764 tokens against 11,293.
The catch
- It is a pilot. The paper's own benchmark plan has 80 tasks in four families of 20; the results come from 12 mixed tasks and 7 recovery tasks. The authors call it a pilot study, and say the comparison against an agent with no limits and against an LLM picking the mode is still to come.
- The failures were planted. The 7 of 7 is about failures injected on purpose, early or late. Real skills fail in messier ways, for example halfway with some files already changed, which the paper names as a failure class but does not report on its own.
- No model is named. I found no model name in the paper, so you cannot tell how a stronger or weaker model changes the picture.
- Small, Python-only skills. Three hand-written macros on Python code. The authors say future work will widen the tasks, repositories, failure kinds and models.
- Read the learned numbers as a sign. The 12 of 12 of the learned router is on 12 tasks, and I found no separate test split for it in the paper. One small thing to know if you compare tables: the no-fallback late-failure run is reported with 2,440 tokens in one table and 2,280 in another.
What it changes in practice
- Give every big skill a fallback in writing. The contract in the paper is a good checklist for any skill or script an agent calls: when it applies, what it may change, how it checks itself, how it fails, what to do instead. If you write skills for Claude Code, the fallback line is the one most skills I see leave out. Where skills fit next to hooks and CLAUDE.md is in CLAUDE.md, hooks, skills or the task.
- Continue from where it stopped, not from the start. I run the same idea at the level of tests. When the full check of a batch fails, the session does not send the whole check again. It reads the log, fixes what failed, and re-runs only the failed test file on my own machine. The big step failed; the small steps carry on from there.
- Look before you fall back. The late-failure result says a failure signal is not proof that the work is missing. Check the state first: if the files are already right, the fallback only costs tokens.
- Let the checks say "done". Success here is the task's own checks passing on the final files, never the agent's claim. The same point, from the other side, is in Your agent finished the task. Did every step work?.
The 40-second version
Paper: Zhang, Jiang, Wang, Zhou. Adaptive Skill Granularity for Coding Agents: Runtime Routing and Macro-to-Micro Recovery. arXiv:2610.31461, 2026. arxiv.org/abs/2610.31461