Skip to content

mager/conseiller

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

conseiller

A small TypeScript harness for Anthropic's advisor tool — one principal agent, one stronger consultant.

The advisor tool lets a fast executor model (Sonnet, Haiku) consult a stronger advisor model (Opus) mid-generation. The advisor reads the full transcript, returns a short plan, and the executor continues. Most tokens stay at executor rates; you only pay Opus for the planning.

This repo is the smallest interesting wrapper around that pattern.

Setup

npm install
cp .env.example .env       # then add your ANTHROPIC_API_KEY

Requires Node 22+.

Run

# default task — concurrent worker pool in Go
npm start

# any task you want
npm start -- "Refactor this Python script to stream results" 

Optional model overrides:

CONSEILLER_EXECUTOR=claude-haiku-4-5-20251001 \
CONSEILLER_ADVISOR=claude-opus-4-7 \
npm start -- "..."

Output

You'll see the executor's response, how many times it consulted the advisor, and a per-tier usage breakdown so you can sanity-check the cost shape:

─── usage ────────────────────────────────────────────
executor  in=412  out=1230  cache_read=0
advisor   in=823  out=531   cache_read=0
──────────────────────────────────────────────────────

Executor and advisor tokens are billed at their respective model rates.

What's in the box

  • src/prompts.ts — the recommended advisor system prompt blocks (timing, trust, conciseness)
  • src/conseiller.ts — the Conseiller class. Owns the message history and the beta.messages.create call with the advisor tool wired in
  • src/index.ts — CLI entry point

The harness uses the advisor-tool-2026-03-01 beta header. Advisor caching ({type: "ephemeral", ttl: "5m"}) is on by default — pays off after ~3 advisor calls per conversation.

Valid model pairs

The advisor must be at least as capable as the executor. As of this writing:

Executor Advisor
claude-haiku-4-5-20251001 claude-opus-4-7
claude-sonnet-4-6 claude-opus-4-7
claude-opus-4-6 claude-opus-4-7
claude-opus-4-7 claude-opus-4-7

Notes

  • The advisor tool is in beta. Things may change.
  • The server_tool_use block's input is always empty — the executor signals timing only; the server forwards the full transcript on its own.
  • The advisor's thinking tokens are dropped server-side; only the advice text returns.
  • max_tokens applies to executor output only; it does not bound advisor output.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors