dshx-project: Opening the Actual Project Directory in the titlebar's "Open In" Menu for the Session.

Preface

When starting a conversation in DeepSeek Harness (DSH), the session’s current working directory (cwd) is fixed upon creation. The Harness does not provide an API to modify it. If you habitually create sessions from the workspace root, the built-in “Open In” button in the title bar will only open the root directory, rather than the specific sub-project or outputs directory you are actually modifying in that conversation turn.

The community plugin dshx-project (maintainer callaumyan-design, categorized as “Memory”) does not modify the session cwd. Instead, it maintains a local mapping of “Session → Real Project Path” and intercepts the built-in “Open In” requests from the title bar. When clicking entry points in the File Explorer, VS Code, etc., it opens the project folder the conversation is actually working on. If the plugin is not loaded, the behavior remains consistent with the original; the facts in this article are based on the GitHub README.

What is this

dshx-project is a Cordis plugin for DSH (current version 2.1.0, MIT License). It does not add extra visible buttons; instead, it intercepts the open-in-app/open requests sent by the existing “Open In” button in the session title bar. It only replaces the request path when the path equals the session’s cwd, swapping it with the identified real project path. If the query fails or no path can be identified, the request passes through unchanged.

It also provides the set_project tool and HTTP routes, allowing the model or external processes to write project paths into the plugin’s persistent storage (~/.dsh/dshx-project/projects.json, using serialized atomic writes). It also appends a set of file placement rules to the system prompt to reduce the scattering of outputs in the workspace root.

Core Functions

Take over “Open In” without adding new controls

The frontend records the session ID using a hidden marker and intercepts requests from the built-in button. The user experience remains unchanged: you still click the original icon, but the opened path points to the “Real Project” instead of the session cwd (provided resolution is successful).

How project paths are determined (Priority high to low)

Source Description
Manual Selection POST /dshx-project/set (README notes there is currently no UI)
AI Record System prompt requires the model to call set_project once the project is determined
Auto-recognition Reads paths involved in tool calls from the session log and scores them by project directory (write operations have higher weight, closer paths have higher weight)
Fallback Session cwd (when no project has been identified yet)

Supplementary notes from the README (based on the author’s local statistics, not a universal guarantee):

  • Historical Sessions: Opening a session allows an attempt at auto-recognition; the author tested 343 sessions and found about 73% could identify a project. The rest were mostly pure chats with no tool calls.
  • New Conversations: Initially correspond to the root directory; after the model starts modifying project files or calls set_project, the next “Open In” click will point to that project.
  • Project Directory Relocation: Old logs containing <root>\my-app can be aligned by directory name to the current path such as <root>\projects\my-app.
  • Manual selection always takes priority; the model cannot override it.

Recognition and Scope Rules

  • Only recognizes directories within the workspace (~/.dsh/storages/workspace.json).
  • “Container directories” are not considered projects themselves; it looks one level down: projects, outputs, docs, dsh, dsh/dshx-plugins, dsh/skills, dsh/tools (modifiable in CONTAINERS in infer.js).
  • Ignores archive, .tmp, tmp, node_modules, .dsh, .agents, etc. (NOISE) and directories starting with a dot.
  • Does not determine a project if evidence is insufficient (total score less than 2).
  • Logs are read-only and decoded incrementally (only decoding new zstd frames), caching offsets for each session.

File Placement Rules (Distributed with System Prompt)

The full text of the rules is in PROMPT_RULE in index.js and can be modified as needed. Key points are as follows:

  1. The model does not write files directly in the workspace root.
  2. When modifying an existing project, files are placed in that project’s directory.
  3. Other outputs: First create outputs\<YYYY-MM-DD>-<english-short-name>\, place files related to this conversation inside it, and register it with set_project so the title bar opens that folder.
  4. Temporary files are placed in .tmp\ and deleted when finished.

Server Routes and Implementation Details

File Responsibilities
index.js Routes /dshx-project/{state,set,clear,open}, set_project tool, system prompt rules
infer.js Session log parsing and project scoring
client.js Takes over built-in Open In requests (no visible UI)

The repository includes host tests and client tests: node test.mjs, node client-test.mjs (README states these are 19 and 8 items respectively).

Installation and Activation

The plugin supports web and desktop profiles. DSH needs to be restarted after installation (requiresRestart: true in package.json).

# Web profile
dsh plugin --profile web add github:callaumyan-design/dshx-project
# Desktop (Use the dsh command bundled with DSH Desktop, quit Desktop completely from the tray first)
dsh plugin --profile desktop add github:callaumyan-design/dshx-project

Uninstallation:

dsh plugin --profile <profile> remove dshx-project

Compatibility: The README states it was developed and used on DeepSeek Harness 0.2.0-rc.2 (desktop / web profile); pure JavaScript, no build step, no install scripts.

Typical Usage

Daily Development: Rely on Auto-recognition and Model Registration

  1. After installing and restarting DSH, click “Open In” in the title bar of a session with existing tool call history; the plugin will attempt to infer the project directory from the logs.
  2. In a new session, let the model read and write files within the project; under the constraints of the system prompt, the model can call set_project after determining the path, and subsequent “Open In” clicks will point to that directory.
  3. If you need to fix a path without going through the model, you can submit a mapping to POST /dshx-project/set (currently no GUI, requires calling according to the plugin route conventions).

Query and Cleanup (HTTP)

The README lists the route prefix /dshx-project/, including state, set, clear, open, etc., used to read/write mappings or open paths according to plugin logic. Specific request bodies depend on the implementation; you can read index.js locally before use.

Use Cases and Notes

Who it’s for: DSH users who have multiple projects or a fixed outputs layout under the workspace root and frequently use the title bar to open the “actual directory of the current conversation” in external editors/file managers; teams or individuals who want the model to reduce root directory clutter via set_project and placement rules.

Permissions & Security: The plugin runs with the current DSH process privileges, reading session logs and workspace configuration, and writing to ~/.dsh/dshx-project/projects.json. It is recommended to read the source code and MIT license before installation to ensure the routes and log parsing behavior comply with your environment policies.

Limitations: The session cwd remains immutable; if recognition fails, the “Open In” behavior is identical to when the plugin is not installed. The auto-recognition ratio comes from the author’s self-reported data; your session distribution will yield different results.

Links and Version History

Changelog (README):

  • 2.1.0 — Takes over the built-in “Open In” in the title bar; session log auto-recognition (including relocation repositioning); file placement rule prompts.
  • 1.0.0 — First public version of the title bar “Project” control and set_project tool.

The DSH ecosystem emphasizes “Everything is a plugin”; community directories like SkillHub are independent sites and have no official affiliation with DeepSeek / High-Flyer. If your main pain point is that “Open In always opens the root directory,” dshx-project uses local mapping and log inference to align the title bar entry with the real project, accomplishing this without modifying the Harness session cwd.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye