claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

Support `@` imports in sub-agent markdown files

Open lukens opened this issue 4 months ago • 2 comments

Memory files support an @ import syntax for importing other files.

Similar functionality in sub-agent files would be useful in various situations, such as:

  • you have common guidance that you want to include in multiple agents
  • you have knowledge you want the main agent to have, but a sub agent to enforce, and want to avoid duplication

Currently you can put @some/other/file.md in a sub-agent, and behaviourally it works as I would like, however, there are a few downsides that suggest to me that the @ import syntax isn't really working, and instead Claude is just smart enough to read and process the file:

  • It reads the imported file every time the agent is loaded, whereas agents usually get loaded once and then cached (proven by making edits directly to the agent's md file, as they don't take effect without a restart)
  • It requires the Read tool

Proper support for @ import should not require the Read tool, and should only import the file once when first loading the agent.

lukens avatar Aug 16 '25 12:08 lukens

This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

github-actions[bot] avatar Dec 04 '25 10:12 github-actions[bot]

This would still be useful if not yet implemented (I'll admit I've not checked in a while)

lukens avatar Dec 04 '25 19:12 lukens