Skip to content

Put function handler shape and args binding in llms.txt; add a docs search CLI #406

Closed

Description

@jimhoyd

Evidence: benchmark run test4 (task redirector, claude-sonnet-5 medium, @jimhoyd/urlcode 0.4.8, one repeat per arm): control arm 67k tokens / 3 turns / $0.07; URLCode arm 407k tokens / 12 turns / $0.25 (most of the token total is cache re-reads). Both passed 6/6 acceptance.

The URLCode arm read llms.txt (14 KB), then ran four grep passes over llms-full.txt (240 KB) for the function handler signature, export default and args binding, and read a 50-line slice of it twice. llms.txt does not answer those questions, so llms-full.txt became the search target.

Proposals:

  1. Add a short function-handler section to llms.txt: the (request, {args, env, route}) signature, string form auto-binding vs long form, returning a Response.
  2. Add a urlcode docs search TEXT CLI command with parity to the MCP search_docs tool (three bounded excerpts), so a CLI-only agent gets bounded retrieval instead of grepping the whole file.

Activity

  1. added
    enhancement
    ai-first
    on Sep 21, 2026
  2. jimhoyd commented on Sep 22, 2026

    @jimhoyd
    CollaboratorAuthor

    Additional evidence from benchmark run test1 (Claude Sonnet 5 medium, one fresh run per arm, pinned core revision cb48354ed414bef7a4dcf810ecd1a19057745a82): across five valid paired tasks, URLCode and Fastify tied on acceptance (26/41 assertions each), while the URLCode arms used 1,265,927 tokens vs 427,479 and 410,448 ms vs 177,319 ms. This is n=1 per task and the prompts differ, so it is directional authoring-friction evidence, not a runtime performance comparison.

    The URLCode agents explicitly reported that llms.txt referenced docs paths unavailable in their installed package and that long-form function routes required an explicit parameters declaration. This reinforces the need for the compact handler/args information and bounded CLI documentation retrieval proposed here. It does not establish whether the current packaged release still has the docs-path issue; that needs a clean packed-install reproduction.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    ai-firstenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions