Skip to content

Fix: Ask bar fails with "Prompt is too long" (keep the agent out of generated map files) - #120

Merged
haydenschmitty merged 1 commit into
haydenschmitty:mainfrom
psingh-valorx:fix/ask-prompt-too-long
Nov 15, 2026
Merged

haydenschmitty merged 1 commit into
haydenschmitty:mainfrom
psingh-valorx:fix/ask-prompt-too-long

Conversation

@psingh-valorx

Copy link
Copy Markdown

Problem

On a small project, asking the Ask bar a one-line question ("from where it fetches words meaning ?") ended with a red Prompt is too long and nothing else.

Reproducing it by running the same claude -p call by hand showed the session growing to about 993,000 tokens before it hit the limit and failed to compact, so one short question used a large part of the person's allowance. The map itself (graph.json) was only ~7 KB, so it wasn't the map's size.

Cause (probable)

claudeRun allows Read, Grep and Glob over the whole project. floorplan/index.html is about 2 MB (it inlines the layout engine and fonts), so an agent that opens or greps it can blow past the context limit.

I did not capture which exact file was read. My reproduction also left out the Ask bar's own instructions, which point the agent at query.mjs, so the Ask bar's real call may behave a little differently from what I ran.

Change

  • skills/floorplan/assets/serve.mjs: add --disallowedTools for Read(floorplan/index.html), Read(floorplan/serve.mjs), Read(floorplan/page-safety.mjs) and Read(floorplan/.cache/**). It goes before --tools, so the existing check on the end of the argument list still holds.
  • tests/ask.test.mjs: assert the deny rule is passed.
  • CHANGELOG.md: line under Unreleased.

Testing

  • node --test tests/ask.test.mjs and tests/serve.test.mjs pass on their own (7/7 and 8/8), with and without this change.
  • A full npm test on Windows had several serve.test.mjs cases fail with "server didn't start" when everything ran at once; they pass in isolation, so I think that is a timing issue from running in parallel, but I haven't confirmed it.
  • Not verified end to end: I could not rerun a real Ask question after the change, so I haven't confirmed that this removes the error. Please treat it as a likely fix and not a proven one. Tried on a tiny static web app (one HTML file, no backend) on Windows 11.
  • I didn't regenerate CHECKSUMS.txt, assuming that happens at release.

If you'd rather fix this another way (a size limit on reads, or answering only through query.mjs), I'm happy to rework it.

🤖 Generated with Claude Code

The Ask bar runs `claude -p` with Read/Grep/Glob on the project. It could open
floorplan/index.html (about 2 MB, inlined layout engine and fonts) and a single
short question grew to roughly a million tokens and failed with
"Prompt is too long". Deny Read on that file and the other generated files.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@haydenschmitty

Copy link
Copy Markdown
Owner

Merged and released in 0.9.0, together with running questions with no MCP servers loaded. Thank you!

Update with claude plugin update floorplan@floorplan.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants