Back to marketplace

dsh-context-imports

Agent & Workflow

ciskonc/dsh-context-imports

Expands @path imports in AGENTS.md/CLAUDE.md and injects the referenced file contents into the session context at session start.

  • agents-md
  • claude-md
  • context-injection
  • deepseek-harness
  • dsh-plugin
  • llm-memory
GitHub Stars
6GitHub
Views
0DSH Plugin Hub
Forks
0GitHub
Open issues
0GitHub Issues
Manifest version
0.1.2dsh-context-imports
Latest push
Oct 9, 2026GitHub
License
MITTypeScript
Plugin type
Host + ClientRuns in both Host and Web Client

Verification and compatibility

This section shows evidence collected by the catalog. Undeclared information is labeled as unknown.

Static checked
01Exact source: npm · dsh-context-imports@0.1.202Validated: Sep 22, 202603Verified Harness: 0.1.0-rc.7
Current-version compatibility
Verified on the catalog Harness version
Declared Harness range
Not declared
Declared platforms
Not declared
Profiles
web
Build approval
Unknown
Permissions
Not declared
External services
Not declared
Telemetry
Unknown
No known risk flags found

This is not a security endorsement. Review source, permissions, and configuration before installing.

View evidence and scope

Verification covers only the named source, version, and Harness environment. It does not guarantee future compatibility.

  • dsh-context-imports@0.1.2
  • The manifest and static structure passed checks; a runtime load check has not completed.

README

View source

dsh-context-imports

Inject the files referenced from AGENTS.md into model context at session start.

DeepSeek Harness injects AGENTS.md itself, but the @path references inside it stay as plain text and the model never sees them. This plugin expands those references the way Claude Code does: it reads each referenced file and adds the content to the session context.

English | 中文


Why

Without this pluginWith it
AGENTS.md itselfInjected by the stock agent-instructions pluginStill injected by it, no duplication
@docs/architecture.md referencesPlain text, ignoredFull file content in context
Nested importsNobody handles themExpanded recursively, depth limited
After compactionReferenced files are gone with the historyRe-injected automatically
Resumed sessionsMay stack a second copySkipped when one is already present

How it works

agent/session-start (startup / resume / clear / compact) records the scene
agent/pre-step (every step) decides whether to inject
  ├─ scan the instruction files (default AGENTS.md, CLAUDE.md) for @path imports
  │    ├─ fenced code blocks are skipped; the path must have a file extension
  │    ├─ relative paths resolve against the importing file's directory
  │    └─ duplicates collapse by resolved path, so import cycles are harmless
  ├─ merge the explicit files list (injected in full; instruction files are
  │    scanned but never re-injected)
  ├─ budgets: 64 KB per file (truncated with a note), 128 KB total (skipped
  │    with a note); a missing file becomes a one-line note instead of an error
  ├─ at most one injection stays in the active history: the full event log is
  │    fingerprint-scanned, and compaction that removes the block re-enables it
  └─ the bundle is appended to the end of the step messages, after AGENTS.md
       and every other context injection

The injected message is a <system-reminder> containing <file path="..."> blocks and nothing else. Set template if you want your own framing around it.

Features

  • Expands @path imports recursively. Default depth is 3; import cycles and duplicates are collapsed.
  • Triggers on new sessions, resume, clear, and after compaction. Each scene can be turned off.
  • Keeps exactly one injection in the active history. After compaction removes it, the next session start injects again.
  • Six-language settings card (zh, en, ja, fr, ru, ko) under Settings, Plugins, Plugin configuration. Every option is editable there and applies without a reload.
  • Byte budgets per file and in total. Missing files are reported, never fatal.
  • Uses the official API surface only: cordis events, createUserMessage from dsh-llm, a schemastery config, and the optional dsh-settings namespace. No feature-plugin dependencies.

Configuration

FieldDefaultDescription
files[]Extra files to inject, relative to the session working directory or absolute
scanImportstrueScan AGENTS.md and the other instruction files for @imports
instructionFiles["AGENTS.md", "CLAUDE.md"]Files to scan. They are never re-injected themselves
maxDepth3How many levels of nested imports to follow
maxFileBytes65536Per-file cap in bytes; larger files are truncated
maxTotalBytes131072Total budget; files beyond it are skipped with a note
injectOnall fourWhich session-start scenes trigger injection
template""Custom wrapper text. {{content}} marks where the files go; empty uses the plain wrapper

Install

dsh plugin --profile web add dsh-context-imports

It works with no configuration: AGENTS.md and CLAUDE.md are scanned and their imports injected. To build from source instead:

git clone https://github.com/ciskonc/dsh-context-imports.git
cd dsh-context-imports
npm install
DSH_CHECKOUT=<path-to-your-dsh-installation> npm run build
npm run build:client

Compatibility

Plugin versionDeepSeek HarnessNotes
0.2.3+≥ 0.1.7-rc.1(0.2.3 tested on 0.2.0-rc.1 and 0.2.0-rc.2)Current line. Built on the 0.1.7 APIs: agent/created, loader-projected settings, configForms, a custom message-source kind. 0.2.3 hardens config access: on DSH ≥ 0.2.0-rc.2 the volatile config projection no longer fills schema defaults, so every field is normalized at entry (0.2.2 could crash session creation or silently skip injection there)
0.2.0 – 0.2.2≥ 0.1.7-rc.1(0.2.1 tested on 0.1.7-rc.2 and 0.2.0-rc.1; 0.2.2 tested on 0.2.0-rc.1)0.2.2 fixed re-injection after compaction and settings-page mounting, but on DSH ≥ 0.2.0-rc.2 it can crash session creation (injectOn.includes is not a function) or silently skip injection (cfg.files is not iterable) — upgrade to 0.2.3
0.1.x0.1.5-rc.1 – 0.1.5-rc.3(tested on 0.1.5-rc.2/rc.3)Legacy line. Does not work on 0.1.7 — it waits on the removed settingsScope service and the removed agent/session-start event

Each release note names the DSH version it was tested against.

Development

FileRole
src/index.tsHost side: session-start ledger, import expansion, budgets, pre-step injection, settings namespace
src/client/index.tsBrowser side: six-language dictionaries and the settings card slot
src/client/form.tsStaged form model behind the card
src/client/ContextImportsCard.tsxThe card component

License

MIT

Comments

0
Newest first