Skip to content

feat(core): discover AGENTS.md up to the home directory - #41652

Merged
kitlangton merged 1 commit into
v2from
agents-home-discovery
Aug 11, 2026
Merged

feat(core): discover AGENTS.md up to the home directory#41652
kitlangton merged 1 commit into
v2from
agents-home-discovery

Conversation

@kitlangton

Copy link
Copy Markdown
Contributor

What

Extend ambient AGENTS.md discovery from the project-root boundary to the user's home directory when the resolved Location is inside home. Locations outside home keep the existing project-root boundary.

Why

This enables shared per-directory conventions such as ~/code/AGENTS.md to apply across every project below that directory. Claude Code and pi similarly walk beyond the repository boundary to the filesystem root, while grok and Codex stop at the git root; stopping at home provides shared user conventions without consulting ancestors above projects in temporary directories, CI scratch space, or shared mounts.

How

  • Resolve the Global service's home through the same filesystem canonicalization used for the Location and project root.
  • Select home as the upward stop with one containment check when the start directory is inside home; otherwise retain the project root.
  • Derive both discovery and file-watch candidates from that selected stop, preserving global-first and nearest-to-farthest ordering.
  • Keep the existing project/trust gating unchanged.
  • Update the instructions and V1 migration docs with the new boundary.

Testing

  • bun run test instruction-discovery.test.ts from packages/core: 9 passed
  • bunx tsgo --noEmit from packages/core: passed
  • bun run test from packages/core: 1,636 passed, 16 skipped
  • Push hook workspace typecheck: 33 tasks passed

@kitlangton

Copy link
Copy Markdown
ContributorAuthor

Implementation and verification are complete: focused instruction discovery tests, core typecheck, full core suite, and workspace push-hook typecheck all pass.

@kitlangton
kitlangtonforce-pushed the agents-home-discovery branch from 414bd3e to 37c16c7CompareAugust 11, 2026 17:22
@kitlangton
kitlangton merged commit 136bad9 into v2Aug 11, 2026
14 of 16 checks passed
@kitlangton
kitlangton deleted the agents-home-discovery branch August 11, 2026 17:57
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@kitlangton