[Feature Request] High-Efficiency Excel Agent with Range-Level Operations and Workbook State Caching

Status Open
Maintainer reply None cached
Activity 0 comments · opened Aug 22, 2026

Bug Description

# Feature Request: High-Efficiency Excel Agent for Large Audit Workbooks I use Claude extensively for professional audit and accounting work involving large Excel workbooks, commonly containing 60–70+ worksheets. There is currently a major efficiency problem when Claude Code/Excel Agent performs large workbook read/write operations. A workbook that I can manually process in approximately 2–3 hours can consume almost the entire 5-hour Claude usage window in less than 1 hour, while the actual task may still be incomplete. The primary issue appears to be excessive token/context consumption during workbook I/O rather than the complexity of the actual audit logic. ## Core Problem The agent appears to expose too much workbook data to the LLM context during operations such as: Reading many worksheets Inspecting formulas and values Comparing sheets Finding cells/ranges Updating values Updating formulas Copying data between sheets Applying formatting Renaming sheets Saving the workbook Re-reading the workbook for validation These operations should largely be deterministic file operations, not LLM reasoning operations. The LLM should reason about what needs to be changed, while a specialized Excel engine should perform the actual workbook manipulation. ## Proposed Solution Please consider introducing a dedicated high-performance Excel/Workbook Tool Layer into Claude Code. This could use technologies such as: Python + openpyxl Python + pandas where appropriate Office.js / Excel APIs Native workbook parsing/manipulation libraries Direct cell/range read/write APIs Formula dependency analysis Workbook metadata APIs The exact implementation is less important than the architecture. ### Desired architecture ``text User Request ↓ Claude / LLM ↓ Determine required workbook operation ↓ Excel Agent / Workbook Engine ↓ Read only required sheets/ranges ↓ Perform deterministic modifications ↓ Save workbook ↓ Validate affected ranges ↓ Return compact structured result ↓ Claude / LLM ` The **workbook itself should remain outside the LLM context** as much as possible. ## Critical Token Optimization Requirements ### 1. Do not load entire worksheets unnecessarily If the user asks to modify a specific range, the agent should not expose the entire worksheet to the model. ### 2. Do not repeatedly read unchanged sheets Once a worksheet has been inspected and its state has not changed, the agent should maintain that state and avoid re-reading the same content. For example: > 70 sheets → inspect once → cache metadata/state → operate only on affected sheets. ### 3. Range-level operations Support efficient operations such as: `text read_range(sheet, range) write_range(sheet, range, values) read_formulas(sheet, range) write_formulas(sheet, range, formulas) copy_range(source, destination) ` rather than repeatedly returning large worksheet contents to the LLM. ### 4. Metadata-first inspection The agent should initially retrieve only lightweight metadata: `text Workbook ├── Sheet names ├── Dimensions ├── Used ranges ├── Formula counts ├── Named ranges ├── Tables └── Dependencies ` Then retrieve actual cell data only when required. ### 5. Dependency-aware reads If a changed cell affects formulas elsewhere, the agent should identify the relevant dependent ranges/sheets and validate only those areas. There should be no need to reprocess the entire workbook. ### 6. Compact structured responses Instead of returning thousands of cells to the LLM, the tool should return concise results such as: `json { "sheet": "Trial Balance", "range": "F10:F25", "changes": 16, "status": "success" } ` The LLM should receive the result, not the entire workbook contents. ### 7. Native diff/change tracking The Excel agent should maintain a lightweight change log: `text Sheet: TB Cell: F25 Old: 125000 New: 130000 Sheet: Balance Sheet Cell: G42 Old Formula: ... New Formula: ... ` This would make validation and auditing significantly more reliable without consuming unnecessary context. ### 8. Batch operations Multiple deterministic workbook operations should be executed in one tool call where possible. For example: `text Read 10 required ranges → perform 25 cell updates → update 5 formulas → save once → validate affected ranges ` rather than: `text read → reason → write → read → reason → write `` repeated dozens or hundreds of times. ## Token Usage Target For a 60–70 sheet workbook, routine workbook operations should consume onl…
Note: Content was truncated.

View original on GitHub ↗