LarryE135/dsh-flash-presets
About
降低 DeepSeek V4.1 Flash 的 Token 消耗(精简预设 + 计划模式 + 内置 Windows fl-bash)/ Raising token efficiency for DeepSeek V4.1 Flash without losing performance
Other ProjectsMeasured star growth
- in 24h
- +7
- in 7 days
- +32
- in 15 days
- +51
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.en.md
Originaldsh-flash-presets
中文 | English
dsh-flash-presets
An efficiency bundle for DeepSeek Harness (DSH) tuned for DeepSeek V4.1 Flash. Ships as a single DSH bundle (dsh.bundle) containing lean PTC agent presets, two-phase plan mode, run_code runtime speed-ups, and a bundled Windows Bash tool (fl_bash) — without modifying host source files.
The premise is straightforward: compact context earlier, trim oversized tool output, disable rarely used tools, batch calls through run_code, and replace slow PowerShell / Git Bash cold starts on Windows with a single-binary native Bash interpreter. None of this raises the model's reasoning ceiling; it cuts the tokens and wall time spent on tasks the model can already solve.
Current version: 0.3.5 (for npm, always verify with
npm view dsh-flash-presets version) · previous official release 0.3.4 · mis-published 0.3.3 (deprecatedon npm, not an official release) · presetslean-v3/balance· plan modeplan-mode v1(1.0.0) · requires DSH>=0.2.1-rc.5 <0.2.3-0(CI-tested on0.2.1-rc.5,0.2.2-rc.1,0.2.2-rc.3, and0.2.2-rc.5including Windows real-host runs)Version pinning: Always pin the exact version (
[email protected]orgithub:LarryE135/dsh-flash-presets#v0.3.5). Do not use a^0.3range (it may resolve to the deprecated0.3.3), and do not install0.2.5(cannot create sessions on DSH0.2.2-rc.1, #19). On release day, pnpm 11's default 24-hourminimumReleaseAgecooldown can silently pull the previous release for bare package names — pinning@0.3.5or#v0.3.5avoids that.
Contents
- What Ships in One Bundle Card
- Quick Install & Verification
- Benchmarks
- Components in Detail
- Runtime Component Switches
- Upgrading from Older Releases
- Fit, Troubleshooting & Known Limitations
- Development & Verification
- Version History
What Ships in One Bundle Card
Installing this bundle adds 4 components to the DSH Plugins page (streamlined from 6 in 0.3.4), alongside profile-wide ptc-runtime persistence and lean context defaults:
| Component | Row ID | Default | Role |
|---|---|---|---|
Lean PTC v3 (lean-v3) |
preset-flash-lean-ptc-v3 |
Enabled (default preset) | 13 behavioral rules + 25% compaction threshold + output trimming + PTC tool surface |
| Lean PTC v3 balance | preset-flash-lean-ptc-v3-balance |
Enabled | Same compaction/trimming/PTC framework, keeping only 3 core rules |
| Flash Lean Presets (runtime) | flash-presets |
Enabled (deliveryGate off) |
Single row hosting 4 runtime features: glob/grep read-only concurrency, plan-mode host, legacy preset-id alias layer, and opt-in delivery gate |
| fl-bash (Windows Bash) | fl-bash |
On by default (Windows x64) | Bundled flash-sh.exe (~1.7 MB) providing fl_bash with zero Git Bash / WSL dependency; gracefully skipped on other platforms |
Profile-wide runtime effects: Three things apply across the target profile, not only to this package's presets — the resident PTC runtime (
ptc-runtime: persistent-in-memory, removed only by removing the plugin card),glob/grepread-only concurrency (DSH_FLASH_PRESETS_CONCURRENCY=0disables it), and the in-memory legacy preset-id alias layer (DSH_FLASH_PRESETS_ALIAS=0disables it). Two input-side lean patches are also applied (tool-skill.catalogDescriptionMaxLength: 60and disabling two DeepSeek-specific upload rows).
Quick Install & Verification
Option 1: Plugin Manager (Recommended)
Installs the full bundle card (presets + plan mode + run_code speed-ups + legacy-id layer + fl-bash):
# From npm (pin exact version)
dsh plugin --profile web add [email protected]
# Or install the identical code from GitHub tag
dsh plugin --profile web add github:LarryE135/dsh-flash-presets#v0.3.5
--profileis typicallywebordesktop(entering the same spec in GUI Plugins → Add plugin is equivalent; presets do not activate underheadless, andacpis untested).- To track unreleased fixes merged on
main, replace#v0.3.5with#main. - Applying changes: reload the page for
web; fully quit and restart the app fordesktop(profile patches are read at startup only).
Option 2: Offline / Install Script (Presets Only)
Download an archive from Releases or clone the tag (uses the DSH 0.1.7+ plugin-row patch mechanism; the pre-0.1.7 directory layout was removed in 0.2.6):
git clone --depth 1 -b v0.3.5 https://github.com/LarryE135/dsh-flash-presets.git
cd dsh-flash-presets
bash scripts/install.sh --profile web # Windows: scripts\install.ps1 -Profile web
- Writes a single managed block (the two preset rows) into
cordis.patch.ymlwith automatic backup & pruning; pass--with-runtime(-WithRuntimein PowerShell) to also addptc-runtime: persistent-in-memory. - Plan mode, legacy preset-id resolution,
glob/grepconcurrency, andfl-bashship only via the plugin card. - Either/or: uninstall the script block (
--uninstall) before switching to the plugin card to avoid duplicate preset rows (the installer refuses stacking withexit 4by default).
Verify Installation
dsh --profile web --dump-config | grep -c 'id: preset-' # Expect 6 (4 built-in + 2 from this bundle)
dsh --profile web --dump-config | grep -c 'persistent-in-memory' # Expect 1
dsh --profile web --dump-config | grep -c '^- id: flash-presets$' # Expect 1
dsh --profile web --dump-config | grep -c '^- id: fl-bash$' # Expect 1
node scripts/doctor.mjs --profile web # Version, duplicates, !!js, YAML & exe integrity check
For plugin-manager installs, the doctor script lives inside the profile:
node ~/.dsh/profiles/web/node_modules/dsh-flash-presets/scripts/doctor.mjs --profile web.
Update & Uninstall
- Update: pinned versions do not drift on
dsh plugin update; re-rundsh plugin --profile web add dsh-flash-presets@<new-version>. - Uninstall:
dsh plugin --profile web remove dsh-flash-presets # Plugin-manager install
bash scripts/install.sh --uninstall --profile web # Script install (Windows: scripts\install.ps1 -Uninstall)
Benchmarks
Every number below is tied to its own benchmark setup and sample size; do not compare absolute scores across different task sets.
1. End-to-End Agent Efficiency — DSH-Bench (110 Tasks × 6 Runs, Four Arms)
Same tasks, same model, same order (660 answered runs per arm; net wall time excludes startup and queueing): lean-v3 incurs no measurable accuracy drop while cutting both tokens and wall time.

| Setup | Accuracy | Tokens | vs Standard | Cost / Answer | Net Time |
|---|---|---|---|---|---|
| Standard | 84.1% | 128.63 M | — | ¥0.0805 | 12.2 h |
| Native PTC | 85.0% | 98.00 M | −23.8% | ¥0.0724 | 11.1 h |
| lean-v3 · Windows | 84.1% | 83.77 M | −34.9% | ¥0.0634 | 9.8 h |
| lean-v3 · WSL | 84.8% | 63.08 M | −51.0% | ¥0.0551 | 7.0 h |


How to read it:
- All five dimensions (overall / coding / knowledge / long-horizon / office) stay within ±4 points; 0.1-point differences sit inside noise — the honest conclusion is "no measurable drop", not "smarter".
- Comparing against Native PTC isolates the preset's net impact from the PTC tool surface: −14.5% tokens on Windows / −35.6% on WSL. Quote the conservative Windows column by default.
- This 110-task × 6-run set is distinct from the 160-task
dsh-benchv1 set and earliern = 3runs. Full breakdowns and reproduction steps: DSH-Bench four-arm report (Chinese).
2. Windows Shell Performance — fl_bash vs Git Bash vs pwsh
On Windows, DSH ships only pwsh, forcing models into an unfamiliar shell while paying heavy PowerShell or Git Bash login-shell startup overhead on every command. Measured on Windows with the bundled Rust single-binary flash-sh.exe and its warm --standby pool:
Startup Latency & Memory
| Shell | Cold Start | Min | Startup RAM | grep 23MB Peak |
|---|---|---|---|---|
fl_bash |
14.4 ms | 12.5 ms | 5.3 MB | 5.6 MB |
cmd.exe |
14.3 ms | 13.0 ms | — | — |
gitbash -c |
49.5 ms | 44.6 ms | 11.1 MB | — |
pwsh -NoProfile |
350.6 ms | 335.3 ms | 80.7 MB | 265.2 MB |
gitbash -lc |
385.4 ms | 354.5 ms | 13.2 MB | 13.3 MB |
Real DSH Tool-Layer Wait Time (End-to-End, ms)
Through the real DSH tool pipeline (fl_bash warm standby hits as low as 3 ms):
| Task | fl_bash Tool |
gitbash (via pwsh Tool) |
pwsh Tool |
|---|---|---|---|
echo |
39 (min 3) | 871 | 559 |
grep 23MB |
24 | 886 | 1679 |
find 3000 files |
114 | 937 | 607 |
git log 50 commits |
61 | 964 | 666 |
12 Workloads (Single-Call Median, ms)
| Workload | fl_bash |
gitbash -c |
gitbash -lc |
pwsh |
fl vs gitbash -lc |
fl vs pwsh |
|---|---|---|---|---|---|---|
| No-op command | 14.4 | 49.5 | 385.4 | 350.6 | 26.8× | 24.3× |
grep -c 23MB |
33.8 | 84.0 | 410.3 | 1499.6 | 12.1× | 44.4× |
wc -l 23MB |
33.2 | 99.2 | 424.8 | 2543.4 | 12.8× | 76.6× |
| CSV sum (300k rows) | 102.1 | 110.7 | 476.8 | 1631.1 | 4.7× | 16.0× |
| Sort 100k integers | 30.4 | 138.6 | 469.6 | 844.4 | 15.4× | 27.8× |
| Recursive find (3000 files) | 121.0 | 113.9 | 466.6 | 379.9 | 3.9× | 3.1× |
git log 50 commits |
72.3 | 126.9 | 496.5 | 419.5 | 6.9× | 5.8× |
| Shell loop (10k iters) | 18.4 | 98.5 | 418.6 | 301.9 | 22.8× | 16.4× |
base64 23MB |
80.4 | 122.9 | 454.3 | 305.5 | 5.7× | 3.8× |
cat 23MB byte count |
23.3 | 101.7 | 475.6 | 364.5 | 20.4× | 15.6× |
sed replace (300k rows) |
45.8 | 259.2 | 570.1 | 3145.0 | 12.4× | 68.7× |
| Spawn Python child | 60.0 | 94.5 | 431.7 | 364.5 | 7.2× | 6.1× |
Expand: Net work time excluding startup (ms)
| Workload | fl_bash |
gitbash -c |
gitbash -lc |
pwsh |
|---|---|---|---|---|
grep 23MB |
19.4 | 34.5 | 24.9 | 1149 |
wc 23MB |
18.8 | 49.7 | 39.4 | 2193 |
| CSV sum | 87.7 | 61.2 | 91.4 | 1280 |
| Sort 100k | 16.0 | 89.1 | 84.2 | 494 |
find 3000 |
107 | 64.4 | 81.2 | 29.3 |
git log |
57.9 | 77.4 | 111 | 69 |
| Loop 10k | 4.0 | 49.0 | 33.2 | ≈0 |
base64 23MB |
66.0 | 73.4 | 68.9 | ≈0 (.NET) |
cat 23MB |
8.9 | 52.2 | 90.2 | 13.9 (.NET) |
sed 300k rows |
31.4 | 209.7 | 184.7 | 2794 |
Components in Detail
1. Lean Presets & Four Token-Saving Mechanisms
| Mechanism | When It Acts | Setting | Effect |
|---|---|---|---|
| Turn compaction | Stored context grows large | thresholdRatio: 0.25, retainTokens: 20000 (default: 0.8) |
Replaces old history with summaries earlier in long sessions |
| Output trimming | Tool result enters context | Threshold 8192, keeps first 4096 / last 1024 chars | Prevents one huge tool output from blowing context |
| Disabled plugins | System prompt assembly | 6 rarely used plugins set to disabled: true |
Drops fixed tool schema overhead |
| Behavioral rules | Every model step | lean-v3 (13 rules) / balance (3 rules) |
Encourages cheap probes, batched calls, incremental edits, single-pass delivery |
| Preset | ID | Rules | Compaction | When to Use |
|---|---|---|---|---|
Lean PTC v3 (lean-v3) |
flash-lean-ptc-v3 |
13 | 0.25 / 20k | Default. Best token efficiency for day-to-day coding and scripting |
| Lean PTC v3 balance | flash-lean-ptc-v3-balance |
3 | 0.25 / 20k | Minimal guardrails (scope/language, no secrets, switch after 2 failures) when the model needs more room |
Implementation notes with source line references: four mechanisms write-up (Chinese). Compared to the official PTC preset, this bundle omits
time-context(no current date/time) andtool-schedule, and sets 6 rarely used plugins (tool-plugin-manager,tool-workflow,tool-ralph,workflow-ptc,tool-subagent-codex,tool-subagent-claude-code) todisabled: true.
2. fl-bash: Built-In Windows x64 Bash Tool (On by Default)
- Self-contained:
lib/fl-bash.jsandvendor/win32-x64/flash-sh.exe(~1.7 MB, single-binary Rust shell with built-in coreutils /grep/sed/awk/jq/diff/find/xargs; open-source atLarryE135/fl-bash) ship inside this package and never shadowbash,pwsh, orrun_code. - Platform behavior: Registers
fl_bashon Windows x64 only; macOS, Linux, and Windows ARM64 log one info line and skip gracefully. If the standalonefl-bashpackage is also installed, a process coordinator registersfl_bashonly once (this bundle takes precedence). - Security boundary (important): when DSH has a sandbox provider (
ctx.sandbox), everyfl_bashrun is wrapped withctx.sandbox.confineinto the same file sandbox as the built-in pwsh / bash tools (read-only / workspace-write / full-access behave the same), and approvals match the built-in tools: you are asked only when the model retries a sandbox-denied command withsandbox_permissions(allowed once, never remembered). Two extra cases always prompt: writes to workspace paths other tools run as code (.git/,package.json,.npmrc,.env*,*.ps1/*.sh, …, including writes whose target cannot be seen on the command line, such assh -c, inline interpreters, or writes wrapped inenv/xargs) and force-push / remote-branch deletion / publishing (npm publish,cargo publish,gh release create, …). To turn the sandbox off:sandbox: offorDSH_FL_BASH_SANDBOX=0. When no sandbox is available it falls back to the per-command approval below (never unconfined without approval), andfl_bashthen runs outside DSH's file sandbox with your user privileges:- Default
approval: "sandboxed": prompts for confirmation in every non-full-access session and fails closed if approval cannot be obtained; - Pure read-only commands (
ls/cat/grep/findwithout-exec/-delete, etc., with every file on the command line inside the workspace) run without a prompt (jqis not on that list, since it is looked up onPATHfirst); - Other safe commands are remembered per session by individual command name and feature:
|, plus>and&bound to the command that uses them (approvingecho … > fdoes not letcatwrite files); git is allow-listed: only read-only subcommands (status/log/diff/show/blame/…) share thegitname; every other subcommand (commit/add/checkout/…) is remembered per subcommand, and ones that rewrite hooks/config/refs, unknown subcommands, aliases (git co) andgit floware confirmed every time;git lfsis remembered per lfs subcommand (sub:git lfs pull), exceptinstall/uninstall/update/migrate, which always prompt. Dangerous commands always prompt: writes to paths other tools run as code or config (.git/,.husky/,package.json,.npmrc,.env*,conftest.py,setup.py,build.rs,*.ps1/*.sh, …), archive extraction (tar -x,unzip,7z x),rm -rf, out-of-workspace writes resolved viarealpath, UNC/device paths,bash -c/eval/source/. script/inline interpreter execution,${!name}indirect expansion, dangeroustar/gitflags, mutations toPATH/NODE_OPTIONS/etc., and any unparseable syntax (guarded by 348 adversarial cases + 52 read-only/memory bypass cases + 165 cross-command borrowing / sensitive-write / extraction / git-subcommand / dot-source cases). Sensitive paths are checked against the write targets visible on the command line; see the plugin README for exactly what is covered; - Strips credential-like environment variables (
*KEY*,*PASSWORD*,*PASSWD*,*SECRET*,*TOKEN*,*CREDENTIAL*,*COOKIE*,*JWT*,*OAUTH*,*_PASS,*_PWD,*_PAT,*_AUTHexcludingGIT_AUTHOR_*, plus prefixesDSH_*,AWS_*,GITHUB_*,GH_*,NPM_CONFIG_*,YARN_NPM_*,AZURE_DEVOPS_*) and URLs containing credentials before spawning; - Full documentation and compatibility notes:
plugins/flash-sh/README.md(Chinese) and SECURITY.md.
- Default
- Turning it off: toggle
fl-bashoff in the DSH Plugins page, set- id: fl-bashwithconfig: { enabled: false }incordis.patch.yml, or setDSH_FL_BASH=0(legacyDSH_FLASH_SH=0also works).
3. run_code Runtime Speed-Ups
- Persistent PTC runtime:
cordis.patch.ymlconfiguresptc-runtime: persistent-in-memory, cutting per-program startup cost from 108 ms to ~0 ms and nested tool calls from 44 ms to 15 ms (benchmark notes, Chinese). - Read-only
glob/grepconcurrency: thetoolConcurrencysub-feature offlash-presetsmarks read-only search tools as concurrency-safe at runtime and prints a one-line startup self-check:
[tool-concurrency] v0.3.5 生效|targets=glob,grep|sweep=500ms|witness=glob=true grep=true|scopes=1
Setting
DSH_FLASH_PRESETS_CONCURRENCY=0disables onlyglob/grepconcurrency; it does not disable the profile-wide persistent PTC runtime.
4. Plan Mode (plan-mode v1, 1.0.0)
Composer icon and upward panel to the left of the input box, independent of your selected preset:
off: inactive; switching tooffimmediately exits native plan mode opened by this plugin (user-initiated/plansessions stay untouched; run/plan offto exit manually).light(recommended default): bridges DSH's native plan review card; after approval, execution follows the model's normal flow.full: bridges the native plan review card, then automatically steersPHASE 2execution in the same turn upon approval, requiringP0-EXEC.ymlwith measured acceptance results.- Key capabilities:
- Scope (
scope):auto(default: plans on turn 1 and re-plans when task scope shifts),always, orfirst; every turn gated for planning enters the native plan review card rather than silently skipping review on later turns. - Auto-approve (
autoApprove): optionally approvesexit_plan_modeautomatically (v1.1 animated glyph) without touching normalask_user_questionprompts. - PTC 10-minute review timeout guard (#29): blocks
run_codecalls invokingexit_plan_mode/ask_user_questionwithouttimeoutMs >= 600000(DSH_FLASH_PRESETS_REVIEW_GUARD=0disables). - Headless / CI:
DSH_PLAN_MODE_UI_HEADLESS=offdisables plan mode completely;promptinjects text without bridging review cards. - Host-identity authentication: every GET/POST route under
/api/plan-mode/*and/api/flash-presets/coreauthenticates the DSH hostowneridentity first (fail-closed:ctx.connection.admit/requestRejectionon DSH0.2.1-rc.5–0.2.2-rc.5, and routeauth: "required"+ownerpeer on DSH0.2.3+;401unauthenticated,403untrusted/non-owner,503if host auth is unavailable), followed by supplementalSec-Fetch-Site,Origin, andx-plan-mode-client: 1write checks. For LAN or reverse-proxy access, configuretrustedHostson DSH'sclient-connection.
- Scope (
5. Legacy Preset-ID Alias Layer & Delivery Gate
- Legacy preset-id compatibility (
alias): all 5 historical preset IDs (flash-lean-ptc-v3-lite,flash-lean-ptc-v1,flash-lean-ptc-v2,flash-lean-ptc,flash-lean) resolve in memory toflash-lean-ptc-v3(all markedrulesDiffer: true, logging a notice on first hit — including-v3-litesince rule 7 changed in 0.3.2). No code in this package ever scans or rewritessessions/. See preset ID contract (Chinese) andpresets/legacy-preset-map.json. - Delivery gate (
deliveryGate, off by default): when enabled, runs workspace-containedverify.ps1(Windows) orverify.sh(Linux/macOS) at turn stop (realpath-confined to workspace), steering failure exit codes and output tails back to the model (up tomaxRounds: 2). Enable viadeliveryGate.enabled: trueorDSH_DELIVERY_GATE=1.
Runtime Component Switches
Override only the sections you need in ~/.dsh/profiles/<name>/cordis.patch.yml (environment variables take precedence):
- id: flash-presets
config:
toolConcurrency: { enabled: true } # glob/grep concurrency (env: DSH_FLASH_PRESETS_CONCURRENCY=0)
alias: { enabled: true } # legacy preset IDs (env: DSH_FLASH_PRESETS_ALIAS=0)
planMode: { enabled: true } # plan-mode host; todoSync / lagTurns go here too
deliveryGate: { enabled: false } # delivery gate (env: DSH_DELIVERY_GATE=0/1); maxRounds / scripts / timeoutMs
- id: fl-bash
config:
enabled: true # Windows x64 Bash tool (env: DSH_FL_BASH=0)
approval: sandboxed # sandboxed | read-only | off
approvalMemory: session # session | off (reuse per-class approval in-session; dangerous commands always prompt)
sandbox: auto # auto | off (0.3.5+: run inside the DSH sandbox; off = per-command approval; env: DSH_FL_BASH_SANDBOX=0/1)
Overrides written against pre-0.3.4 row IDs (
flash-presets-core,plan-mode-ui,flash-presets-alias,delivery-gate,flash-sh) are automatically read back and translated at startup. To turn off only plan mode, setplanMode: { enabled: false }— do not disable the wholeflash-presetsrow, or legacy-session support and concurrency optimization will also stop.
Upgrading from Older Releases
- Stable preset IDs: the two active presets stay
flash-lean-ptc-v3andflash-lean-ptc-v3-balance. All 5 historical IDs resolve in memory via the plugin card's alias layer (add your own profile row from tagv0.2.5if you need verbatimv1/v2rules). - Script installs lack the alias layer: if your old patch contained
flash-lean-ptc-v3-lite,merge-presetskeeps anorder: 99compatibility row; forv1/v2sessions, switch to the plugin card. - 0.3.2 → 0.3.4: plugin page rows consolidated from 6 to 4; if you previously wrote
config.enabled: falseonplan-mode-uiorflash-presets-alias(ignored in 0.3.2), it now takes effect — remove it if unintended. - Sessions stuck in plan mode prior to 0.3.4 (#45): pre-0.3.4 sessions lack persisted ownership metadata; run
/plan offonce in that session to clear it. - Remove any standalone
dsh-plan-mode-uior legacydsh-flash-shpackages before installing this bundle to avoid duplicate registration.
Fit, Troubleshooting & Known Limitations
Good fit: coding, scripting, data processing, and deliverable-driven tasks with clear verification criteria, long sessions, and Windows workflows where shell startup latency hurts.
Poor fit: competition-grade problems beyond the model's ceiling (standard mode holds up better; see measured evidence), workflows relying on time-context/schedules/in-chat plugin installs, DSH < 0.2.1-rc.5, or untested non-Flash models.
Troubleshooting
Run diagnostics first:
node scripts/doctor.mjs --profile web --all
node scripts/diag-preset-load.mjs --profile desktop
| Symptom | Likely Cause | Fix |
|---|---|---|
| Preset card shows "failed to load" | Custom preset still references removed .../dsh-tool-subagent-control/list-agents subpath (0.2.2-rc.1+) |
Locate with diag-preset-load.mjs and delete that row |
Slash commands vanish / tool executor is unavailable |
Hot reload disposed an open session's composition | Restart DSH, or set DSH_FLASH_PRESETS_SELFCHECK_HEAL=1 |
| Duplicate presets in picker | Script managed block stacked with bare rows or plugin card | Re-run installer to adopt bare rows, or --uninstall before using plugin card |
js-yaml reports unknown tag |
Raw preset source containing !!js copied manually |
Run node scripts/doctor.mjs --profile web --fix |
| Presets disappear after DSH upgrade | DSH version exceeded engines.dsh (<0.2.3-0) |
Upgrade this bundle, or override via dsh plugin allow-version |
Tools (glob/grep) silently missing |
Stale local @deepseek-ai/* copy mismatched with host DSH version |
Follow section [9] of doctor.mjs output |
Known Limitations
- Under the
headlessprofile, presets and plan mode staypending(acpis untested); usewebordesktop. - macOS has not been tested on physical hardware; scripts follow bash 3.2 rules and pass CI across Ubuntu, Windows, and macOS.
- Plan-mode state is visible to other plugins watching
planMode; if a third-party plugin prompts during plan mode on pure Q&A turns, switch plan mode tooff. - Raise the model output token limit (≥ 120K, ideally 384K) and use one problem per session for long-thinking models.
Using It from DSH Go (Mobile App)
- Local mode (DSH runs on the phone):
fl_bashregisters only on Windows x64, so it is not registered on the phone and the shell is DSH's nativebash; presets, therun_codespeed-ups, plan mode, and the delivery gate work as usual. - Remote mode (the phone connects to DSH on a computer, e.g. DSH Remote or SSH "connect only"):
fl_bashapprovals appear on the app's native approval card. The card shows only the first 3 lines of the reason, so since 0.3.5 the reason reads "command / why it asks / inside or outside the sandbox", with the command on the first line (long commands are cut, with the number of hidden characters shown) and a Chinese version for Chinese UIs; the full explanation is visible in DSH Web on the computer. - Use "Allow all in this chat" with care: once tapped, the app answers "allow once" to every later approval in that chat, including the commands
fl_bashdeliberately asks about every time (force pushes, publish commands such asnpm publish, writes to.git/hooks/package.json, and so on). The plugin receives the same answer as a manual "Allow" and cannot tell the difference. - Change remote-host settings on the computer: remote hosts have no DSH Go bridge, so
fl-bashsettings (sandbox,approval, …) cannot be changed in the app; use the plugin page in DSH Web on the computer, or editcordis.patch.yml.
Development & Verification
npm run verify # 13 authoritative checks (sync-lib, sync-fl-bash, core, session compat, YAML, structure, lint, bench leak guard, versions, compat gate, bench table, bash 3.2, ps1)
node plugins/flash-sh/test/unit.mjs # fl-bash unit tests
node plugins/flash-sh/test/adversarial.mjs # fl-bash adversarial security suite (348 adversarial + 29 benign + 52 read-only/memory bypass + 165 borrowing/sensitive-write/extraction/git-subcommand/dot-source + 50 memory-still-works + 8 pathological glob)
bash scripts/selftest.sh # Installer / uninstall / merger / publish-guard E2E tests
node scripts/verify-session-compat.mjs # 10 synthetic legacy-session checks + negative controls
These commands require a full git clone (
scripts/contains 51 files in the repo; the npm tarball ships only runtime/diagnostic files perpackage.jsonfiles).cordis.patch.ymlis generated vianpm run build(scripts/compose-bundle-patch.mjs), andlib//vendor/mirrors are synced bysync-lib.mjsandsync-fl-bash.mjs— never edit derived files by hand. See CONTRIBUTING.md.
Version History
Full changelog: CHANGELOG (Chinese). Compatibility matrix: versions & compatibility (Chinese).
v0.3.5
- Security fix (P0): bundled
flash-sh.exeupdated to fl-bash 1.0.2. The 0.3.4 package on npm shipped flash-sh 0.1.9 (flash-sh --versionprints 0.1.9; exe sha25604c44cee…a60cd1), where${!x}(indirect expansion) parsed the variable's value as code — e.g.x='a}$(touch /tmp/PWNED)${b'; echo "${!x}"actually rantouch. fl-bash 1.0.0 (swapped intomainafter 0.3.4, never published to npm) and 1.0.1 are affected too; versions before 0.1.9 were not tested but are most likely affected — seeing 0.1.9 does not mean you are safe. 1.0.2 reportsinvalid variable nameand runs nothing. fl-bash users should upgrade to 0.3.5. - Behavior change:
fl_bashnow runs inside the DSH sandbox by default (#69). When DSH provides a sandbox (ctx.sandbox) and the session is not full-access, every run is wrapped withctx.sandbox.confineinto the same file sandbox as the built-in pwsh / bash tools, and per-command approval is turned off: ordinary reads and writes in the workspace,git commit/git push,npm test/npm run buildand so on no longer prompt. Measured on a full development session (search + edit files + npm + git, 40 commands): 18 → 0 prompts. Writes outside the workspace (e.g.npm installof a new dependency writes the global cache,git config --global) are denied by the sandbox; when the model retries withsandbox_permissionsyou are asked once (that call only, never remembered), so a session that installs new dependencies usually still sees one escalation prompt. Still confirmed every time: writes to paths that run as code outside the sandbox (.git/,package.json,.npmrc,.env*,*.sh/*.ps1, …, including writes whose target is not visible on the command line:sh -c '…',python3 -c/node -einline code, writes wrapped inenv/timeout/xargs,curl -O/wgetdownloads named after the URL,git apply/git ampatches, hand-built git objects (git update-index --cacheinfo,read-tree, …),git fetch/git pullfrom a URL on the command line, package-manager config writes (yarn config set,yarn set version,npm config set --location project), …;dd of=,git mv,curl -o,lnandchmodare judged by the files on the command line), force-push / remote-branch deletion, and publishing (npm publish(including thenpm pubabbreviation) /unpublish/owner/access/dist-tag/deprecate,pnpm -r publish,cargo publish,twine upload,gh release create/upload/delete, … — on both routes, never released by session memory).- New setting
sandbox: auto | off(defaultauto) and environment variableDSH_FL_BASH_SANDBOX(0off,1on; overrides the setting). To turn the sandbox off, setconfig: { sandbox: off }under- id: fl-bashincordis.patch.yml, orDSH_FL_BASH_SANDBOX=0; then, and whenever DSH has no sandbox or it fails to start,fl_bashfalls back to per-command approval (the 0.3.4-style classifier; approved command classes are remembered for the session).
- New setting
- fl-bash approvals (round-4 audit): git global options that switch repository (
--git-dir/--work-tree/-C/--bare…), git aftercd,git cloneandfetch/ls-remote/pullwith a URL or path are confirmed every time;unzipcounts as listing only when every option is a listing option;mv/cp/install-t/--target-directorycheckDIR/<source name>against sensitive paths andcp -rTalways asks; glob bracket expressions follow bash rules; files written bygunzip/unzstd/xz -d… are write targets, andjar/cpio/pax/expand… always ask. - Includes the sixth-round audit fixes and the fl-bash read-only auto-approval work (#66) merged to
mainafter 0.3.4; see CHANGELOG.
v0.3.4 (2026-11-27)
- Plugin page 6 → 4 consolidation: merged
flash-presets-core,plan-mode-ui,flash-presets-alias, anddelivery-gateinto oneflash-presetsrow with automatic legacy-override translation. - Bundled
fl-bash(on by default on Windows x64): ships the 1.7 MBflash-sh.exe(0.1.9 with warm--standbypool) and fail-closed approval classifier inside the package. - Stability & CI: three-state plan detection,
subCallId-paired PTC in-flight tracking,#45clean goal-mode exit after switching plan mode off, and a real DSH0.2.2-rc.5dual-OS host-probe matrix in CI. - Round-six full-repo audit remediation &
fl-bashv1.0.0 alignment onmain(queued for the next release): fixed Issue#56multi-turn plan-review bypass, closed all 9 P0fl-bashclassifier bypasses +StandbyPool/spill hardening, fixeddelivery-gate/plan-mode-uilocking, state machine, and native Windows test pass (34/34), closed script/publish-guard/CI/docs gaps, and aligned the bundledflash-sh.exewith the open-sourcedLarryE135/fl-bashv1.0.0release (see CHANGELOG).
v0.3.2 (2026-11-17, previous official release)
- Auto-approve button v1.1 glyph & trigger animation, default context trimming, delivery gate reverted to off by default,
scopedefaultauto,#29PTC 10-minute review timeout guard, plus round-three and round-four audit fixes. Earlier releases: CHANGELOG.
Explore related projects
Loading…