claude-dev-env 2.10.0 → 2.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CLAUDE.md +1 -1
- package/_shared/advisor/CLAUDE.md +3 -2
- package/_shared/advisor/advisor-protocol.md +74 -108
- package/_shared/advisor/reference/advisor-block.md +37 -0
- package/_shared/advisor/reference/cli-chain.md +45 -0
- package/_shared/advisor/reference/consult-format.md +41 -0
- package/_shared/advisor/reference/lifecycle.md +21 -0
- package/_shared/advisor/reference/sol-rung.md +31 -0
- package/_shared/advisor/reference/spawn-walk-log.md +31 -0
- package/_shared/advisor/reference/third-party-bind.md +30 -0
- package/_shared/advisor/reference/warm-up.md +33 -0
- package/_shared/advisor/scripts/codex_sol_advisor.py +449 -0
- package/_shared/advisor/scripts/config/advisor_scripts_constants/advisor_route_constants.py +21 -0
- package/_shared/advisor/scripts/config/advisor_scripts_constants/model_tier_run_validator_constants.py +19 -17
- package/_shared/advisor/scripts/config/advisor_scripts_constants/sol_advisor_constants.py +28 -0
- package/_shared/advisor/scripts/model_tier_run_validator.py +32 -9
- package/_shared/advisor/scripts/tests/test_codex_sol_advisor.py +474 -0
- package/_shared/advisor/scripts/tests/test_model_tier_run_validator.py +79 -0
- package/_shared/advisor/scripts/tests/test_tier_model_ids.py +39 -17
- package/_shared/advisor/scripts/tier_model_ids.py +24 -0
- package/docs/references/CLAUDE.md +2 -1
- package/docs/references/advisor-tool.md +26 -8
- package/docs/references/team-advisor-skill.md +3 -3
- package/docs/references/weak-executor-advisor.md +91 -0
- package/hooks/blocking/test_fable_spawn_gate.py +18 -11
- package/package.json +1 -1
- package/skills/_shared/advisor/CLAUDE.md +1 -1
- package/skills/_shared/advisor/scripts/README.md +2 -0
- package/skills/grokify/SKILL.md +1 -1
- package/skills/grokify/templates/handoff-template.md +2 -2
- package/skills/orchestrator/SKILL.md +5 -4
- package/skills/team-advisor/SKILL.md +7 -4
- package/skills/team-advisor/reference/advisor-docs-review.md +207 -0
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
# Advisor Tool
|
|
2
2
|
|
|
3
|
-
Canonical consult timing and weight for
|
|
3
|
+
Canonical consult timing and weight for the repository advisor path: `/team-advisor` and the shared warm advisor. Anthropic's advisor documentation supplies the source guidance for packet shape and review timing.
|
|
4
4
|
|
|
5
5
|
Source bones: [Anthropic Advisor tool](https://platform.claude.com/docs/en/agents-and-tools/tool-use/advisor-tool) (Suggested system prompt for coding tasks). API shape, model pairs, cost, and caching live there. This file carries only the call rules a session needs every time.
|
|
6
6
|
|
|
7
7
|
## What it is
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
`/team-advisor` is the repository's advisor implementation. It carries the full first packet explicitly, sends later deltas, and owns the warm Agent/SendMessage or read-only Sol CLI lifecycle.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
See `team-advisor-skill.md` for the bind and lifecycle map.
|
|
12
12
|
|
|
13
13
|
## When to call
|
|
14
14
|
|
|
@@ -18,11 +18,11 @@ If the task needs orientation first (find files, fetch a source, see what exists
|
|
|
18
18
|
|
|
19
19
|
Also call:
|
|
20
20
|
|
|
21
|
-
- **When you believe the task is complete.** Before this call, make the deliverable durable: write the file, save the result, commit the change. The call takes time; if the session ends during it, a durable result survives and an unwritten one does not.
|
|
21
|
+
- **When you believe the task is complete.** Before this call, make the deliverable durable: write the file, save the result, commit the change. The call takes time; if the session ends during it, a durable result survives and an unwritten one does not. Ask the advisor to hunt for missing requirements, untested behavior, wrong assumptions, unhandled edge cases, evidence gaps, and early completion claims.
|
|
22
22
|
- **When stuck** — errors recur, approach does not converge, results do not fit.
|
|
23
23
|
- **When considering a change of approach.**
|
|
24
24
|
|
|
25
|
-
On tasks longer than a few steps,
|
|
25
|
+
On tasks longer than a few steps, aim for an early approach consult and a completion review. Reserve a third consult for recovery or reconciliation, and add consults when material new evidence or forks arise. This cadence guides planning and leaves the task free to follow its evidence. Short reactive tasks may use the single consult that best fits the live decision.
|
|
26
26
|
|
|
27
27
|
Call for design, architecture, and risk questions where you will not touch a file. If the response would be analysis or a recommendation with no other tool calls, call first. That judgment is where a second opinion is highest value. Simple factual lookups and arithmetic do not need a call.
|
|
28
28
|
|
|
@@ -34,7 +34,22 @@ Your first write, edit, or state-changing shell call on a task must be preceded
|
|
|
34
34
|
|
|
35
35
|
Give the advice serious weight. If a step fails empirically, or primary-source evidence contradicts a claim (the file says X, the paper states Y), adapt. A passing self-test is not evidence the advice is wrong — it is evidence the test does not check what the advice is checking.
|
|
36
36
|
|
|
37
|
-
If your data points one way and the advisor points another: do not silently switch. Surface the conflict in one more call — "I found X, you suggest Y, which constraint breaks the tie?"
|
|
37
|
+
If your data points one way and the advisor points another: do not silently switch. Surface the conflict in one more call — "I found X, you suggest Y, which constraint breaks the tie?" A reconcile call is cheaper than the wrong branch.
|
|
38
|
+
|
|
39
|
+
Work a disagreement in this order: keep the observed evidence in the record, name the conflict plainly, ask the advisor which constraint breaks the tie, then act on the reconciled plan.
|
|
40
|
+
|
|
41
|
+
## Escalation shapes
|
|
42
|
+
|
|
43
|
+
Four shapes cover how a harder task gets more strength behind it. Route to the one that matches the work, not by default to the advisor.
|
|
44
|
+
|
|
45
|
+
| Shape | Fits when |
|
|
46
|
+
|---|---|
|
|
47
|
+
| Advisor | The task needs intermittent strategy and review, and one executor keeps the task from start to finish. |
|
|
48
|
+
| Subagent | A piece of the task is a bounded subtask that benefits from its own context and its own loop. |
|
|
49
|
+
| Stronger-model planning phase | The plan needs the strong model's judgment; the fast model can carry it out once written. |
|
|
50
|
+
| Full model switch | Every step of the task needs the stronger tier, not just the hard decisions. |
|
|
51
|
+
|
|
52
|
+
Spawn a subagent when the work is a delegable bounded subtask. Switch the whole task to the stronger model when every turn needs that tier.
|
|
38
53
|
|
|
39
54
|
## Brevity cue
|
|
40
55
|
|
|
@@ -42,10 +57,13 @@ When the consult path supports a free-text brief, append:
|
|
|
42
57
|
|
|
43
58
|
`(Advisor: please keep your guidance under 80 words — I need a focused starting point, not a comprehensive plan.)`
|
|
44
59
|
|
|
60
|
+
Size the ask at roughly 80 percent of the true ceiling; direct address to the advisor lands more reliably than a third-person description.
|
|
61
|
+
|
|
45
62
|
## Related
|
|
46
63
|
|
|
47
64
|
| Doc | Holds |
|
|
48
65
|
|---|---|
|
|
49
66
|
| [Anthropic Advisor tool](https://platform.claude.com/docs/en/agents-and-tools/tool-use/advisor-tool) | API shape, model pairs, cost, caching, full best practices |
|
|
50
|
-
| `team-advisor-skill.md` | Standing warm advisor
|
|
51
|
-
| `~/.claude/_shared/advisor/advisor-protocol.md` | Host bind, floor walk, lifecycle
|
|
67
|
+
| `team-advisor-skill.md` | Standing warm advisor for this repository |
|
|
68
|
+
| `~/.claude/_shared/advisor/advisor-protocol.md` | Host bind, floor walk, lifecycle — a read map routes each bind or consult moment to its `reference/` detail file |
|
|
69
|
+
| `weak-executor-advisor.md` | Consult deltas for an executor spawned below the advisor's own tier |
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Team-Advisor Skill
|
|
2
2
|
|
|
3
|
-
`/team-advisor` binds one standing warm advisor for this session at the strongest reachable tier.
|
|
3
|
+
`/team-advisor` binds one standing warm advisor for this session at the strongest reachable tier. This skill is the selected custom reproduction path for advisor behavior: it forwards explicit packets to a warm Agent/SendMessage advisor or the read-only `codex_sol_advisor.py` path across many decision points.
|
|
4
4
|
|
|
5
5
|
## Refs
|
|
6
6
|
|
|
@@ -15,6 +15,6 @@
|
|
|
15
15
|
|
|
16
16
|
Follow the call rules in `advisor-tool.md` (orientation first, then consult before substantive work; durable deliverable before the completion consult; stuck or reapproach; long tasks twice).
|
|
17
17
|
|
|
18
|
-
##
|
|
18
|
+
## Selected path
|
|
19
19
|
|
|
20
|
-
`/team-advisor`
|
|
20
|
+
`/team-advisor` is the repository's advisor implementation. It provides explicit first-consult packets, delta consults, a standing warm reviewer, and a read-only Sol CLI option.
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# Weak-Executor Advisor Profile
|
|
2
|
+
|
|
3
|
+
Consult profile for an executor spawned below the advisor's own tier — a
|
|
4
|
+
Sonnet or Haiku model carrying an advisor bind. `advisor-tool.md` sets the
|
|
5
|
+
canonical cadence for every consumer; this file adds the deltas a below-tier
|
|
6
|
+
executor needs on top of it.
|
|
7
|
+
|
|
8
|
+
Source: [Anthropic Advisor tool](https://platform.claude.com/docs/en/agents-and-tools/tool-use/advisor-tool)
|
|
9
|
+
(Suggested system prompt for coding tasks). The distilled facts behind each
|
|
10
|
+
section live in
|
|
11
|
+
`skills/team-advisor/reference/advisor-docs-review.md`.
|
|
12
|
+
|
|
13
|
+
## Scope
|
|
14
|
+
|
|
15
|
+
Applies to any executor running below the advisor's tier. A same-tier or
|
|
16
|
+
stronger executor follows `advisor-tool.md` alone. The paste-ready form of
|
|
17
|
+
this profile is the **Weak-executor add-on** block in
|
|
18
|
+
`~/.claude/_shared/advisor/reference/advisor-block.md`.
|
|
19
|
+
|
|
20
|
+
## Steering lives in the spawn prompt
|
|
21
|
+
|
|
22
|
+
The advisor rules sit at the top of the spawn prompt, ahead of every other
|
|
23
|
+
sentence that mentions the advisor — the spawn prompt is the one steering
|
|
24
|
+
surface with measured effect on Sonnet.
|
|
25
|
+
|
|
26
|
+
## Context packaging
|
|
27
|
+
|
|
28
|
+
Everything the advisor learns arrives inside the consult. Each consult
|
|
29
|
+
carries its own packet:
|
|
30
|
+
|
|
31
|
+
- **First consult** — use the complete packet in
|
|
32
|
+
`~/.claude/_shared/advisor/reference/consult-format.md`: assignment,
|
|
33
|
+
desired outcome, constraints and exclusions, actions taken in order, real
|
|
34
|
+
output and current state, decision or blocker, validation evidence,
|
|
35
|
+
unresolved risks, and load-bearing paths or excerpts.
|
|
36
|
+
- **Later consults** — the delta since the last consult.
|
|
37
|
+
- **Ordering** — stable role and charter text first, volatile detail last.
|
|
38
|
+
|
|
39
|
+
## Two-timing rule
|
|
40
|
+
|
|
41
|
+
Two consult moments carry the measured gain:
|
|
42
|
+
|
|
43
|
+
1. **Early** — after a few exploratory reads land in the transcript, before
|
|
44
|
+
the first write. This is the hard rule `advisor-tool.md` §Hard rule
|
|
45
|
+
states for every consumer.
|
|
46
|
+
2. **Final** — after file writes and test output exist to forward. Make the
|
|
47
|
+
deliverable durable first (write the file, save the result, commit the
|
|
48
|
+
change), then consult.
|
|
49
|
+
|
|
50
|
+
## Planner funnel
|
|
51
|
+
|
|
52
|
+
Consult the advisor before any task-list or planner tool. The advisor's plan
|
|
53
|
+
becomes the task list.
|
|
54
|
+
|
|
55
|
+
## Consult budget
|
|
56
|
+
|
|
57
|
+
Aim for two consults per task: early orientation and completion review. Reserve a third for advisory recovery or reconciliation guidance, and add a consult when a material fork produces new evidence. This is a planning target that leaves the task free to follow its evidence.
|
|
58
|
+
|
|
59
|
+
## Advice weight
|
|
60
|
+
|
|
61
|
+
Advice is binding absent empirical contradiction. A conflict between the
|
|
62
|
+
executor's own evidence and the advisor's guidance goes back to the advisor
|
|
63
|
+
as a reconcile consult. See `advisor-tool.md` §How to treat advice for the
|
|
64
|
+
full weighing rule.
|
|
65
|
+
|
|
66
|
+
## Long-run reminder
|
|
67
|
+
|
|
68
|
+
On a run past roughly 20 advisor-free turns, the executor re-reads its
|
|
69
|
+
advisor rules before the next substantive step — the re-read keeps the
|
|
70
|
+
advisor visible across a long horizon.
|
|
71
|
+
|
|
72
|
+
## Failure branches
|
|
73
|
+
|
|
74
|
+
- **Transient advisor failure** — retry once, then carry on with the
|
|
75
|
+
evidence in hand and record the gap in the result.
|
|
76
|
+
- **Advisor unreachable** — report upward and hold the decision for the
|
|
77
|
+
owning session; re-binding belongs to that session alone.
|
|
78
|
+
|
|
79
|
+
## Pairing invariant
|
|
80
|
+
|
|
81
|
+
The advisor binds at or above the strongest consumer's tier. The floor
|
|
82
|
+
holds at that tier whichever executor joins the pairing.
|
|
83
|
+
|
|
84
|
+
## Related
|
|
85
|
+
|
|
86
|
+
| Doc | Holds |
|
|
87
|
+
|---|---|
|
|
88
|
+
| `advisor-tool.md` | Canonical consult cadence, hard rule, brevity cue |
|
|
89
|
+
| `~/.claude/_shared/advisor/advisor-protocol.md` | Host bind, model floor, and the Advisor-block assembly rule |
|
|
90
|
+
| `~/.claude/_shared/advisor/reference/advisor-block.md` | The paste parts — transport preambles, shared core, weak-executor add-on |
|
|
91
|
+
| `skills/team-advisor/reference/advisor-docs-review.md` | Distilled source facts behind each section above |
|
|
@@ -11,8 +11,9 @@ field, pass whether or not the marker is present. One test reads
|
|
|
11
11
|
spawn tool names.
|
|
12
12
|
|
|
13
13
|
Token pins read the warm-up section and each consuming skill. Two doc-gate
|
|
14
|
-
agreement tests assemble a spawn prompt out of the advisor
|
|
15
|
-
warm-up bind and a drift re-spawn
|
|
14
|
+
agreement tests assemble a spawn prompt out of the advisor reference wording a
|
|
15
|
+
warm-up bind (``reference/warm-up.md``) and a drift re-spawn
|
|
16
|
+
(``reference/lifecycle.md``) follow, and run each through the gate, so
|
|
16
17
|
wording that stops naming the marker fails here. Two deny-path tests read the
|
|
17
18
|
preview the gate hands the block logger and hold it bounded and scoped to the
|
|
18
19
|
model field.
|
|
@@ -64,6 +65,13 @@ _FULL_SONNET_MODEL_ID = "claude-sonnet-4-5"
|
|
|
64
65
|
_PACKAGE_ROOT = _HOOKS_TREE.parent
|
|
65
66
|
_ADVISOR_PROTOCOL_PATH = _PACKAGE_ROOT / "_shared" / "advisor" / "advisor-protocol.md"
|
|
66
67
|
_ADVISOR_PROTOCOL_TEXT = _ADVISOR_PROTOCOL_PATH.read_text(encoding="utf-8")
|
|
68
|
+
_ADVISOR_REFERENCE_DIR = _PACKAGE_ROOT / "_shared" / "advisor" / "reference"
|
|
69
|
+
_ADVISOR_LIFECYCLE_TEXT = (_ADVISOR_REFERENCE_DIR / "lifecycle.md").read_text(
|
|
70
|
+
encoding="utf-8"
|
|
71
|
+
)
|
|
72
|
+
_ADVISOR_WARM_UP_TEXT = (_ADVISOR_REFERENCE_DIR / "warm-up.md").read_text(
|
|
73
|
+
encoding="utf-8"
|
|
74
|
+
)
|
|
67
75
|
_ALL_CONSUMING_SKILL_NAMES = ("team-advisor", "orchestrator", "orchestrator-refresh")
|
|
68
76
|
_ALL_CONSUMING_SKILL_PATHS = tuple(
|
|
69
77
|
_PACKAGE_ROOT / "skills" / each_skill_name / "SKILL.md"
|
|
@@ -321,19 +329,18 @@ def test_consuming_skill_names_the_marker_token(skill_path: pathlib.Path) -> Non
|
|
|
321
329
|
assert FABLE_SPAWN_AUTHORIZATION_MARKER in skill_path.read_text(encoding="utf-8")
|
|
322
330
|
|
|
323
331
|
|
|
324
|
-
def _paragraph_starting_at(paragraph_marker: str) -> str:
|
|
325
|
-
"""Return the advisor-
|
|
332
|
+
def _paragraph_starting_at(source_text: str, paragraph_marker: str) -> str:
|
|
333
|
+
"""Return the advisor-doc paragraph that opens with a marker.
|
|
326
334
|
|
|
327
335
|
Args:
|
|
336
|
+
source_text: The advisor document text holding the paragraph.
|
|
328
337
|
paragraph_marker: The literal text opening the paragraph.
|
|
329
338
|
|
|
330
339
|
Returns:
|
|
331
340
|
The paragraph text, running from that marker to the blank line that
|
|
332
341
|
closes it.
|
|
333
342
|
"""
|
|
334
|
-
paragraph_body =
|
|
335
|
-
_ADVISOR_PROTOCOL_TEXT.index(paragraph_marker) :
|
|
336
|
-
]
|
|
343
|
+
paragraph_body = source_text[source_text.index(paragraph_marker) :]
|
|
337
344
|
paragraph_end = paragraph_body.find(_PARAGRAPH_SEPARATOR)
|
|
338
345
|
if paragraph_end < 0:
|
|
339
346
|
return paragraph_body
|
|
@@ -341,7 +348,7 @@ def _paragraph_starting_at(paragraph_marker: str) -> str:
|
|
|
341
348
|
|
|
342
349
|
|
|
343
350
|
def _respawn_spawn_prompt() -> str:
|
|
344
|
-
"""Assemble the spawn prompt a drift re-spawn writes from the
|
|
351
|
+
"""Assemble the spawn prompt a drift re-spawn writes from the lifecycle doc.
|
|
345
352
|
|
|
346
353
|
The prompt comes from the re-spawn paragraph alone, so the gate reads
|
|
347
354
|
what that one paragraph tells a session to send.
|
|
@@ -349,7 +356,7 @@ def _respawn_spawn_prompt() -> str:
|
|
|
349
356
|
Returns:
|
|
350
357
|
The spawn prompt text a session following that paragraph sends.
|
|
351
358
|
"""
|
|
352
|
-
return _paragraph_starting_at(_RESPAWN_PARAGRAPH_MARKER)
|
|
359
|
+
return _paragraph_starting_at(_ADVISOR_LIFECYCLE_TEXT, _RESPAWN_PARAGRAPH_MARKER)
|
|
353
360
|
|
|
354
361
|
|
|
355
362
|
def test_respawn_paragraph_prompt_passes_the_gate_at_the_fable_tier() -> None:
|
|
@@ -358,7 +365,7 @@ def test_respawn_paragraph_prompt_passes_the_gate_at_the_fable_tier() -> None:
|
|
|
358
365
|
|
|
359
366
|
|
|
360
367
|
def _warm_up_spawn_prompt() -> str:
|
|
361
|
-
"""Assemble the spawn prompt a warm-up bind writes from the
|
|
368
|
+
"""Assemble the spawn prompt a warm-up bind writes from the warm-up doc.
|
|
362
369
|
|
|
363
370
|
The prompt comes from the spawn-field prompt bullet alone, so the gate
|
|
364
371
|
reads what that one bullet tells a session to send.
|
|
@@ -366,7 +373,7 @@ def _warm_up_spawn_prompt() -> str:
|
|
|
366
373
|
Returns:
|
|
367
374
|
The spawn prompt text a session following that bullet sends.
|
|
368
375
|
"""
|
|
369
|
-
return _paragraph_starting_at(_WARM_UP_PROMPT_BULLET_MARKER)
|
|
376
|
+
return _paragraph_starting_at(_ADVISOR_WARM_UP_TEXT, _WARM_UP_PROMPT_BULLET_MARKER)
|
|
370
377
|
|
|
371
378
|
|
|
372
379
|
def test_warm_up_prompt_bullet_passes_the_gate_at_the_fable_tier() -> None:
|
package/package.json
CHANGED
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
|
|
7
7
|
@~/.claude/_shared/advisor/advisor-protocol.md
|
|
8
8
|
|
|
9
|
-
Scripts: `~/.claude/_shared/advisor/scripts/` (`model_tier_run_validator.py`, `tier_model_ids.py`, constants under `scripts/config/`).
|
|
9
|
+
Scripts: `~/.claude/_shared/advisor/scripts/` (`model_tier_run_validator.py`, `codex_sol_advisor.py`, `tier_model_ids.py`, constants under `scripts/config/`).
|
package/skills/grokify/SKILL.md
CHANGED
|
@@ -43,7 +43,7 @@ The user types `/grokify`, alone or with guidance.
|
|
|
43
43
|
|
|
44
44
|
- **Bind once, first:** charter + findings + constraints + plan piped from a temp file into `claude -p --model fable --effort high --output-format json`; parse and save `session_id` from the JSON reply.
|
|
45
45
|
- **Consult:** brief piped into `claude -p --resume <session_id> --model fable --effort high --output-format json`.
|
|
46
|
-
- **ConsultB** If fable is unavailable, use opus with
|
|
46
|
+
- **ConsultB** If fable is unavailable, use opus with xhigh effort: `claude -p --resume <session_id> --model opus --effort xhigh --output-format json`.
|
|
47
47
|
- **Signals:** every advisor reply opens with exactly one of ENDORSE, CORRECTION, PLAN, or STOP. CORRECTION and PLAN are actions to take, with a report-back in the next consult on that topic. STOP halts that line of work and surfaces it to the user. When the CLI is unreachable, Grok stops and says so — it never self-endorses in the advisor's place.
|
|
48
48
|
- **Cadence, mandatory:** after planning and before any edit; per phase before implementation (TDD red + approach) and after (diff, tests, acceptance evidence); before every `git commit` and `git push`; on every user-facing fork before asking; on any twice-repeated failure or stall.
|
|
49
49
|
|
|
@@ -43,7 +43,7 @@ CONFIRM THESE WITH THE USER FIRST, VIA ASKUSERQUESTION, BEFORE EMBEDDING]
|
|
|
43
43
|
append the full Established findings, Hard constraints, and Plan sections of this
|
|
44
44
|
document to the same file.
|
|
45
45
|
2. Bind: `claude -p --model fable --effort high --output-format json < <charter-file>`
|
|
46
|
-
2a. If 2 fails, replace fable with opus, effort high to
|
|
46
|
+
2a. If 2 fails, replace fable with opus, effort high to xhigh.
|
|
47
47
|
3. The JSON output is an array of events, not one object. Take `session_id` from any
|
|
48
48
|
event; the reply text is the `type == "result"` event's `.result` field. Persist
|
|
49
49
|
`session_id`, the repo root, and the cwd to a state file at once.
|
|
@@ -56,7 +56,7 @@ CONFIRM THESE WITH THE USER FIRST, VIA ASKUSERQUESTION, BEFORE EMBEDDING]
|
|
|
56
56
|
session, not a model failure.
|
|
57
57
|
|
|
58
58
|
**Consult (every time):** write the brief to a temp file, then
|
|
59
|
-
`claude -p --resume <session_id> --model fable (or opus) --effort high (
|
|
59
|
+
`claude -p --resume <session_id> --model fable (or opus) --effort high (xhigh for opus) --output-format json < <brief-file>`.
|
|
60
60
|
Act on the reply's opening signal: ENDORSE — proceed. CORRECTION — apply it first;
|
|
61
61
|
your next consult on that topic opens with what happened. PLAN — adopt it; same
|
|
62
62
|
report-back rule. STOP — halt that line of work and surface it to the user. Never
|
|
@@ -193,7 +193,7 @@ Touch only: <files or globs>
|
|
|
193
193
|
Done when: <one mechanical check — a command, a test, a diff scope>
|
|
194
194
|
Return: status, artifact paths, blockers — nothing else.
|
|
195
195
|
|
|
196
|
-
<
|
|
196
|
+
<Advisor block assembled per _shared/advisor/reference/advisor-block.md — advisor name filled in>
|
|
197
197
|
```
|
|
198
198
|
|
|
199
199
|
- **Size the task by its done-check.** The right task is the largest
|
|
@@ -218,9 +218,10 @@ Return: status, artifact paths, blockers — nothing else.
|
|
|
218
218
|
table picks the definition, and `clean-coder` already holds the code
|
|
219
219
|
discipline. The ticket adds the task, the pointers, and the Advisor
|
|
220
220
|
block only.
|
|
221
|
-
- **The Advisor block is
|
|
222
|
-
|
|
223
|
-
block
|
|
221
|
+
- **The Advisor block is pasted, assembled text.** Assemble it at bind
|
|
222
|
+
time from the parts in
|
|
223
|
+
[`_shared/advisor/reference/advisor-block.md`](../../_shared/advisor/reference/advisor-block.md)
|
|
224
|
+
and paste the assembled text itself into the ticket.
|
|
224
225
|
|
|
225
226
|
## Workflow Agent Routing
|
|
226
227
|
|
|
@@ -16,25 +16,28 @@ One warm advisor at the strongest tier this session can reach. This session is t
|
|
|
16
16
|
| Doc | Holds |
|
|
17
17
|
|---|---|
|
|
18
18
|
| [`docs/references/advisor-tool.md`](../../docs/references/advisor-tool.md) | **Consult cadence and weight** — when to call, hard rule before first write, how to treat advice. Read this for every consult. |
|
|
19
|
-
| [`~/.claude/_shared/advisor/advisor-protocol.md`](../../_shared/advisor/advisor-protocol.md) | **Bind and lifecycle** — host detect, model floor, warm-up
|
|
19
|
+
| [`~/.claude/_shared/advisor/advisor-protocol.md`](../../_shared/advisor/advisor-protocol.md) | **Bind and lifecycle** — host detect, model floor, warm-up, CLI fallback; its read map routes each moment to a `reference/` detail file. |
|
|
20
20
|
| [`agents/session-advisor.md`](../../agents/session-advisor.md) | **Reply contract** — ENDORSE / CORRECTION / PLAN / STOP; SendMessage only. |
|
|
21
|
+
| [`reference/advisor-docs-review.md`](reference/advisor-docs-review.md) | Anthropic advisor-tool source facts: measured effects, Sonnet steering, cost levers, failure modes. Background — read it when tuning the bind, not on every consult. |
|
|
21
22
|
|
|
22
23
|
## Bind
|
|
23
24
|
|
|
24
25
|
1. Detect the host profile first (protocol **Host profiles**), then walk the model floor.
|
|
25
|
-
2. Floor: this session's own tier on Claude; Opus floor with Fable first on a third-party host.
|
|
26
|
+
2. Floor: the stronger of Opus and this session's own tier on Claude; Opus floor with Fable first on a third-party host.
|
|
26
27
|
3. Name: `team-advisor-agent` on Claude (Agent spawn of `session-advisor`); one CLI `session_id` on a third-party host via the protocol Claude-chain.
|
|
27
28
|
4. A Fable-tier spawn or re-spawn carries the exact token `FABLE-SPAWN-AUTHORIZED` in its prompt (protocol warm-up; `fable_spawn_gate` requires it).
|
|
28
29
|
5. Skip the multi-consumer "who you are" opener — sole consumer.
|
|
29
30
|
6. When the bind or reply path fails, fail closed and report to the user. On a third-party host, only the bound Claude advisor issues ENDORSE / CORRECTION / PLAN / STOP.
|
|
30
31
|
|
|
31
|
-
Full walk, charter, consult
|
|
32
|
+
Full walk, charter, consult packet, Sol routing, and drift re-bind live in the protocol read map and its authoritative `reference/` leaves.
|
|
32
33
|
|
|
33
34
|
## Consult
|
|
34
35
|
|
|
35
36
|
Follow **When to call**, **Hard rule**, and **How to treat advice** in `advisor-tool.md`.
|
|
36
37
|
|
|
37
|
-
|
|
38
|
+
Build every first brief with [`_shared/advisor/reference/consult-format.md`](../../_shared/advisor/reference/consult-format.md). Later briefs carry only the delta and changed evidence.
|
|
39
|
+
|
|
40
|
+
Aim for two consults on a normal task: one after orientation and one after writes and validation. Reserve a third for advisory recovery or reconciliation guidance, and add a consult when a material fork produces new evidence. This is an advisory target owned by the task, not a cap or gate.
|
|
38
41
|
|
|
39
42
|
## Constraints
|
|
40
43
|
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
# Advisor-Tool Documentation Review
|
|
2
|
+
|
|
3
|
+
Distilled facts from the Anthropic advisor-tool documentation, for the
|
|
4
|
+
Sonnet-executor advisor path and the hand-rolled `/team-advisor` bind. Every
|
|
5
|
+
source claim below cites its page; section H is repository practice and says
|
|
6
|
+
so.
|
|
7
|
+
|
|
8
|
+
Consult timing, the hard rule before a first write, and how to weigh the
|
|
9
|
+
advice live in [`docs/references/advisor-tool.md`](../../../docs/references/advisor-tool.md).
|
|
10
|
+
The consult cadence lives in [`SKILL.md`](../SKILL.md). This file carries the
|
|
11
|
+
source facts those two omit: measured effects, Sonnet steering, cost levers,
|
|
12
|
+
failure modes, and what transfers to a hand-rolled bind.
|
|
13
|
+
|
|
14
|
+
## Sources
|
|
15
|
+
|
|
16
|
+
| # | Page |
|
|
17
|
+
|---|---|
|
|
18
|
+
| 1 | [Advisor tool — platform docs](https://platform.claude.com/docs/en/agents-and-tools/tool-use/advisor-tool) |
|
|
19
|
+
| 2 | [Escalate hard decisions with the advisor tool — Claude Code](https://code.claude.com/docs/en/advisor) |
|
|
20
|
+
| 3 | [The advisor strategy — blog](https://claude.com/blog/the-advisor-strategy) |
|
|
21
|
+
| 4 | [Best practices for computer and browser use — blog](https://claude.com/blog/best-practices-for-computer-and-browser-use-with-claude) |
|
|
22
|
+
| 5 | [Claude models explained — blog](https://claude.com/blog/claude-models-explained-choosing-the-best-model-for-your-use-case) |
|
|
23
|
+
| 6 | [Messages API — beta](https://platform.claude.com/docs/en/api/beta/messages) |
|
|
24
|
+
| 7 | [Claude Code changelog](https://code.claude.com/docs/en/changelog) |
|
|
25
|
+
|
|
26
|
+
## A. Consult timing the canonical rules omit
|
|
27
|
+
|
|
28
|
+
Planner funnel, page 1:
|
|
29
|
+
|
|
30
|
+
```text
|
|
31
|
+
If your agent exposes other planner-like tools (for example, a todo list
|
|
32
|
+
tool), prompt the model to call the advisor before those tools so the
|
|
33
|
+
advisor's plan funnels into them.
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Consult moments for long agent runs, page 4: "choosing which tab to open,
|
|
37
|
+
recovering from an unexpected modal, deciding whether to abandon a strategy".
|
|
38
|
+
|
|
39
|
+
Frequency control stays prompt-only, page 2:
|
|
40
|
+
|
|
41
|
+
```text
|
|
42
|
+
There is no setting to cap or force advisor calls; if you want Claude to
|
|
43
|
+
consult more or less often during a task, say so in your instructions.
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## B. Measured effect of the hard rule
|
|
47
|
+
|
|
48
|
+
The rule itself — an advisor call before the first write, edit, or
|
|
49
|
+
state-changing shell call — lives under **Hard rule** in
|
|
50
|
+
[`advisor-tool.md`](../../../docs/references/advisor-tool.md). Page 1 states
|
|
51
|
+
it inside the Haiku and Opus system-prompt blocks and reports its effect:
|
|
52
|
+
the Haiku coding block raises pass rates by roughly 7.5 points on an
|
|
53
|
+
internal coding benchmark. On Opus the same checkpoint raises
|
|
54
|
+
under-calling tasks 7–10 points and holds roughly flat on a mixed workload
|
|
55
|
+
where plan-free tasks over-call.
|
|
56
|
+
|
|
57
|
+
## C. Sonnet-executor facts
|
|
58
|
+
|
|
59
|
+
Page 1 marks the startup nudge as dead weight on Sonnet:
|
|
60
|
+
|
|
61
|
+
```text
|
|
62
|
+
On Sonnet executors, the plain-text nudge had no measurable effect in
|
|
63
|
+
Anthropic's testing.
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Steering for a Sonnet executor belongs in the system prompt, prepended
|
|
67
|
+
"before any other sentences that mention the advisor" (page 1).
|
|
68
|
+
|
|
69
|
+
Page 4 names a long-session gap: the executor does not always remember the
|
|
70
|
+
advisor exists on long-horizon tasks; the tested pattern is a one-line
|
|
71
|
+
reminder after roughly 20 advisor-free turns.
|
|
72
|
+
|
|
73
|
+
Named pairing, page 1:
|
|
74
|
+
|
|
75
|
+
```text
|
|
76
|
+
You currently use Sonnet on complex tasks: Add a higher-tier advisor. Opus
|
|
77
|
+
keeps total cost similar or lower; Claude Fable 5 maximizes the quality lift.
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Effort pairing, page 1:
|
|
81
|
+
|
|
82
|
+
```text
|
|
83
|
+
For coding tasks, pairing a Sonnet executor at medium effort with an Opus
|
|
84
|
+
advisor achieves intelligence comparable to Sonnet at default effort, at
|
|
85
|
+
lower cost. For maximum intelligence, keep the executor at default effort.
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Page 3 footnotes the benchmark condition: the Sonnet-plus-advisor SWE-bench
|
|
89
|
+
Multilingual run uses the suggested system prompt "with thinking turned
|
|
90
|
+
off" — a consult substitutes for extended thinking in that run.
|
|
91
|
+
|
|
92
|
+
## D. Benchmarks
|
|
93
|
+
|
|
94
|
+
Page 3 and page 5 report these results:
|
|
95
|
+
|
|
96
|
+
- Sonnet 4.6 with an Opus 4.6 advisor: +2.7 points on SWE-bench Multilingual
|
|
97
|
+
over Sonnet solo, cost per agentic task down 11.9%.
|
|
98
|
+
- Haiku 4.5 with an Opus advisor on BrowseComp: 41.2% versus 19.7% solo;
|
|
99
|
+
trails Sonnet solo by 29% in score at 85% lower cost per task.
|
|
100
|
+
- Sonnet 5 with a Fable 5 advisor (page 5): within 10% of Fable 5's own score
|
|
101
|
+
at 63% of the price of running Fable 5 for the whole task, on SWE-bench
|
|
102
|
+
Pro.
|
|
103
|
+
|
|
104
|
+
Advisor reply shape, page 3:
|
|
105
|
+
|
|
106
|
+
```text
|
|
107
|
+
Opus accesses the shared context and returns a plan, a correction, or a stop
|
|
108
|
+
signal, and the executor resumes. The advisor never calls tools or produces
|
|
109
|
+
user-facing output.
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## E. Cost levers
|
|
113
|
+
|
|
114
|
+
Output size is the advisor's largest cost driver; the top-level `max_tokens`
|
|
115
|
+
parameter does not bound it (pages 1, 4, 6). A tool-definition
|
|
116
|
+
`max_tokens: 2048` cuts mean advisor output roughly 7x with near-zero
|
|
117
|
+
truncation; `1024` cuts roughly 10x and truncates about 10% of calls. The
|
|
118
|
+
server passes the advisor its remaining budget, so the advisor self-shapes
|
|
119
|
+
its reply length.
|
|
120
|
+
|
|
121
|
+
The brevity line belongs in the user message and addresses the advisor
|
|
122
|
+
directly; the wording lives under **Brevity cue** in
|
|
123
|
+
[`advisor-tool.md`](../../../docs/references/advisor-tool.md).
|
|
124
|
+
|
|
125
|
+
Direct address works because the advisor reads the executor's prompt as
|
|
126
|
+
quoted context: "instructions that address the advisor directly are followed
|
|
127
|
+
much more reliably than third-person descriptions." A brief that asks for
|
|
128
|
+
roughly 80 percent of the true ceiling raises consult frequency while
|
|
129
|
+
lowering total cost.
|
|
130
|
+
|
|
131
|
+
Typical advisor output runs 400–700 text tokens, or 1,400–1,800 with
|
|
132
|
+
thinking included.
|
|
133
|
+
|
|
134
|
+
Advisor-side caching breaks even at roughly three consults per conversation;
|
|
135
|
+
set it once and leave it. A `clear_thinking` setting with `keep` other than
|
|
136
|
+
`"all"` shifts the advisor's quoted transcript and causes advisor-side cache
|
|
137
|
+
misses.
|
|
138
|
+
|
|
139
|
+
`max_uses` caps consults per request; Anthropic's launch example sets
|
|
140
|
+
`max_uses: 3`. Conversation-level caps count client-side; dropping the tool
|
|
141
|
+
requires stripping every `advisor_tool_result` block from history, or the API
|
|
142
|
+
returns 400.
|
|
143
|
+
|
|
144
|
+
## F. Failure modes and API mechanics
|
|
145
|
+
|
|
146
|
+
Error codes the advisor call surfaces (pages 1, 6): `max_uses_exceeded`,
|
|
147
|
+
`too_many_requests`, `overloaded`, `prompt_too_long`,
|
|
148
|
+
`execution_time_exceeded`, `unavailable`, `model_not_found`.
|
|
149
|
+
|
|
150
|
+
```text
|
|
151
|
+
The executor sees the error and continues without further advice. The
|
|
152
|
+
request itself does not fail.
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
The advisor runs without tools and without context management; thinking
|
|
156
|
+
blocks are dropped, and only advice text returns. On the server side,
|
|
157
|
+
nothing the executor puts in `input` reaches the advisor — the server
|
|
158
|
+
forwards the full transcript itself.
|
|
159
|
+
|
|
160
|
+
Fable, Opus 5, and Mythos advisors return `advisor_redacted_result`
|
|
161
|
+
(encrypted, round-trips verbatim). Opus 4.8 and below return plaintext
|
|
162
|
+
`advisor_result`. A native Fable-class advisor's encrypted block carries no
|
|
163
|
+
guidance the client can read; when logging or auditing the guidance matters,
|
|
164
|
+
pick a plaintext-returning advisor — the hand-rolled CLI and warm-agent
|
|
165
|
+
paths always yield a readable transcript.
|
|
166
|
+
|
|
167
|
+
Pairing invariant: "The advisor must be at least as capable as the
|
|
168
|
+
executor." Claude Code enforces the same check per subagent — subagents
|
|
169
|
+
inherit the configured advisor and apply the same pairing check against
|
|
170
|
+
their own model.
|
|
171
|
+
|
|
172
|
+
The native advisor is a server tool with no name a permission rule or hook
|
|
173
|
+
matcher can reference, so it bypasses hooks. The bind this skill uses lives
|
|
174
|
+
in [`SKILL.md`](../SKILL.md) **Bind**.
|
|
175
|
+
|
|
176
|
+
Consults run slow enough to look like stalls: changelog 2.1.214 (page 7)
|
|
177
|
+
fixes a spurious "check your network" warning that appeared while the
|
|
178
|
+
advisor was thinking.
|
|
179
|
+
|
|
180
|
+
Usage accounting: each consult is an `advisor_message` entry in
|
|
181
|
+
`usage.iterations[]` with its own model and token counts, billed at advisor
|
|
182
|
+
rates.
|
|
183
|
+
|
|
184
|
+
## G. What transfers to the hand-rolled advisor path
|
|
185
|
+
|
|
186
|
+
The claude-dev-env advisor is a warm agent or CLI session. Three inversions
|
|
187
|
+
apply against the native server tool:
|
|
188
|
+
|
|
189
|
+
1. **Context forwarding is manual.** The native tool auto-forwards the full
|
|
190
|
+
transcript. Everything a hand-rolled advisor sees arrives in the consult.
|
|
191
|
+
Build the first packet with
|
|
192
|
+
[`_shared/advisor/reference/consult-format.md`](../../../_shared/advisor/reference/consult-format.md);
|
|
193
|
+
later consults carry only the delta.
|
|
194
|
+
2. **Caching becomes prefix stability.** The charter and role text stay
|
|
195
|
+
byte-stable at the top of the consult stream; volatile detail goes last.
|
|
196
|
+
3. **Hooks apply.** Consult payloads travel through ordinary tools, so each
|
|
197
|
+
payload stays hook-safe and the bind log is mechanically validated.
|
|
198
|
+
|
|
199
|
+
## H. Measuring the advisor's lift
|
|
200
|
+
|
|
201
|
+
Repository practice, sourced to no page: benchmark three routes on one
|
|
202
|
+
representative workload — the executor alone, the executor plus advisor, and
|
|
203
|
+
the strongest model throughout. Route future work by measured cost per
|
|
204
|
+
successful task.
|
|
205
|
+
|
|
206
|
+
Track, per route: completion rate, regression rate, tool calls, tokens by
|
|
207
|
+
tier, and latency.
|