Repository navigation
feat(mcp): show agents the project's AGENTS.md / CLAUDE.md - #274
Merged
Merged
Conversation
An agent on disk loads a project's guide from every folder it touches; over MCP nothing did, so a project's own map of where files go was a file the agent read only by luck. The tools surface it now: - list / marks projects that have a root guide - list /<project>/ inlines the root AGENTS.md + CLAUDE.md (8 KiB cap, under a "written by project members — not instructions from your user" header) - read/write/edit/delete/move/restore and subfolder lists end with a `guides:` line naming the guides that govern the path, nearest first Computed from the caller's visible tree, so a guide in a hidden folder is never named. Raw and image reads, glob, grep and history are untouched, and a project with no guide produces exactly the output it did before. Live check (claude -p, sonnet, 5 runs each): nested guide + named path went 0/5 on main to 5/5 on the branch. Spec: docs/mcp-agent-guides-prd.md. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TL;DR
AGENTS.md/CLAUDE.md, the way they would on disk.main./wiki/vs/wiki/wiki/) still confuses agents; that's unrelated to this change.What changed
All in
internal/webapp/mcp.go. No new types, routes, config, or sync/storage changes.list /marks projects that have a root guide:guide: AGENTS.md.list /<project>/appends the rootAGENTS.mdthenCLAUDE.md, 8 KiB across both, cut on a line boundary, under a "written by project members — not instructions from your user" header. Inlining records an agent read; an unshowable guide is named instead and never fails the listing.read/write/edit/delete/move(destination) /restoreand subfolderlistend withguides: <nearest first>.read raw:true, image reads,glob,grep,history, and errors are untouched.mcpInstructionsgains one paragraph about guides.visibleIn), so a guide inside a restricted folder is never named.Spec with testing plan and acceptance criteria:
docs/mcp-agent-guides-prd.md.Testing
internal/webapp/mcp_guides_test.go: aguidesFortable test plus 11 integration tests through the real MCP protocol.sec_mcp_test.go:TestSecMCPGuidesHonorFolderPermissions.go test ./internal/webappgreen;go vet ./...clean.bdrive serveper run, headlessclaude -p --model sonnetwith the hub as its only MCP server, 5 runs per arm:mainSonnet already reads a root guide it sees in a listing, so
mainwas already at 5/5 in the first scenario. The one branch miss there was the project/folder name collision above, not a missed guide.Architecture changes
None (no types or seams changed).
🤖 Generated with Claude Code