Skip to content
Pi · Claude Opus 4.6debugCLI & tooling

Investigate why Excel format_cells needs more tool calls than write_cells

Session from pi-for-excel-sessions on Hugging Face by thomasmustier · MIT · condensed by Coders Talk

2msession
0interventions
GOAL

Figure out why the agent's formatting tool calls are far less batched/efficient than its write_cells calls, and whether the tooling should be made more robust to reduce redundant formatting calls.

  1. Prompt · +0
    The agent needs way more tool calls for formatting than for editing (write_cells). Is this something we should make more robust?
  2. Agent did · +0m
    Explored repo structure and read DECISIONS.md, system-prompt.ts, format-cells.ts, write-cells.ts, and registry.ts to understand current tool design and prior decisions around formatting behavior.
  3. Agent did · +0m
    Searched the codebase for existing batching/multi-range support and tool-call grouping UI, then listed the test suite to see what formatting/write behavior is already covered.
  4. Agent did · +1m
    Read with-workbook-coordinator.ts, coordinator.ts, and conventions/defaults.ts to understand how mutating tool calls are serialized and where formatting conventions are defined.
  5. Outcome · +2m
    Agent concluded formatting is worth hardening: the trace showed 9 formatting calls vs one batched write, format_cells already supports comma-separated multi-ranges but prompt guidance doesn't enforce batching, and some formatting actions (e.g. hide_gridlines) are overreach.
VERDICT

Next time I'd start the prompt by pointing straight at format-cells.ts and the multi-range support so the agent doesn't have to rediscover it through grep. No correction was needed here — it was a pure investigation and the agent's read-through of the coordinator, registry, and conventions files did the work of surfacing that batching already exists but isn't enforced in the prompt.

I tried this · 0

Discussion · 0

How Builds work