Add the session view to the trace page. Read the specimens first, then build the lane strip, the tree, the document, and the inspector from one authored run. The family's plugins must be visible on the records they touch, and the page must read the same run with the family off.
hook / Classic
hook-dsh-tool-coach
Teaches the model to stop reading files through the terminal
Facts
- Package
- @playform/hook-dsh-tool-coach
- Version
- 0.2.1
- Kind
- hook
- Release
- Classic
- Licence
- CC0-1.0
- Directory
- Classic/packages/hook-dsh-tool-coach
What it does
Teaches the model to stop reading files through the terminal.
Conversation
The turn as a document: the calls every plugin page shares, what this package changes in them, and the order its work happens in.
Conversational
Lane
The same run as time: one row per resource, a bar per span, and the clock every record shares. A wait is drawn as an outline, because nothing is busy.
Session
The tree, the document, and the inspector read one record list. The switch at the top of the document changes the face they read, and the run changes with it.
The turn
The same 3 calls on every plugin page, so a reader who moves between plugins stays in the same frame.
| Seq | Call | Outcome |
|---|---|---|
20 | bash ls -la | ok |
21 | write src/index.ts | ok |
22 | read src/index.ts | ok |
Change
The one line that differs with this package installed, transcribed from its source by the dissection.
- Model the fourth cat a.md returns its content
- Transcript the result gains Tool-coach note (strike 4, read-class bash pattern)
64 character changed, from 35 to 64.
- Property
- Tool-use coaching
- Knob
- strike threshold, documented per rule
- Seam
- tools/post-execute
Flow
The order this package's work happens in, with the branch that decides it inline, transcribed from the source; the rule it obeys is the last band of Architecture.
- 01
- seam tools/post-execute
why
A terminal call settles; the coach judges bash, pwsh, and the configured judge tools.
- 02Normalize the command, then classify it: write, read, search, discovery, control
why
Heredoc bodies are stripped and substitutions masked before any row is matched.
- 03branch The head is exempt: a build, a test, git, a package manager, or a file lifecycle
why
An exempt head dominates its pipe, so a diff redirected to a file is still exempt.
- 04pass exempt <tool> <pattern>: one line, and the call is not judged
why
An exempt call neither strikes nor escalates, and the ledger is its only trace.
- 05Tier 0: one offense line, and the strike lands in the window
why
The model sees nothing at tier 0; the ledger is the only record.
- 06branch The class reaches threshold strikes inside window judged calls, past the cooldown
why
The note is one per class, not one per call.
- 07Tier 1: one notice with the live tool line, prepended as additionalContexts
why
The tool name, the first sentence of its description, and its primary parameter come from the registry.
- 08branch escalateThreshold offenses since the last note
why
The escalation is a section rather than a louder notice.
- 09Tier 2: the persistent section, appended at system-prompt/assemble
why
The section is rebuilt on its own TTL and again when the tool registry changes.
- 10branch enforce is on, and the class has enforceThreshold strikes
why
Off by default; write is the narrow scope, and all adds read and search.
- 11fail Tier 3: tools/pre-execute denies the call, with the lesson as the reason
why
Discovery and control are never denied, because flagging them hard dilutes the signal.
- 12store ~/.dsh/playform/hook-dsh-tool-coach.log
why
Every tier writes its own line, and the deny is byte-exact.
Harness
The laws the package states, the line it writes when it loads, the seam the harness dispatches with none of the family, and the surface and knobs a run can set.
Activation
The one line this package writes when it loads, as a template and as the strings the source composes from it.
activated (k1=v1, k2=v2, ...)- absent field
- A pair whose value is undefined is skipped, so a flavor with no replacement simply omits the pair.
- bare segment
- A pair with an empty key renders its value alone, which is how the governance trio leads with its flavor word.
- present field
- An empty string is a value, not an absence: the invisible flavor writes replacement= to say it removed the family.
- hook-dsh-normalize-quotes
activated (reasoning=on, toolArgs=off, logFile=~/.dsh/hook-dsh-normalize-quotes.log) - hook-dsh-normalize-invisible
activated (replacement=, reasoning=on, toolArgs=off, logFile=~/.dsh/hook-dsh-normalize-invisible.log) - hook-dsh-package-governor
activated (anywhere mode, logFile=~/.dsh/hook-dsh-package-governor.log, updateMode=chain, ncuBin=ncu, exclude=[], policyFile=(discovery)) - hook-dsh-package-pinner
activated (pinner, logFile=~/.dsh/hook-dsh-package-pinner.log, keep=[@types/*])
Default
What the harness does at this package's seam with none of the family installed, so the surface below has something to be a difference from.
The harness dispatches tools/post-execute as a waterfall and already has listeners there: claude-code-mods, hooks-claude-code, hooks-codex, repeat-tool-reminder, spill-policy, tool-fs-search.
A waterfall listener receives the payload and may return a changed one, so the harness's own listeners can already change what the model reads. This package adds another listener to that list.
Surface
Every listener, tool, service, and knob the README documents.
| Kind | Name | What |
|---|---|---|
| listener | tools/post-execute | judges every terminal call; tier-0 ledger + tier-1 notice via additionalContexts (source {kind: 'tool-coach', form: 'notice', summary: '<tool> <class> × <n>'}) |
| listener | tools/pre-execute | tier 3: denies the terminal call with the lesson as the deny reason |
| listener | agent/pre-step | the clean-window accounting between judged calls |
| listener | system-prompt/assemble | tier 2: the persistent "Tool discipline" section |
| listener | tools/change | rebuilds the cached section when the registry changes |
| config | SCHEME.md | the full Schemastery schema (see the table below) |
Install
The package as the profile adds it.
pnpm add @playform/hook-dsh-tool-coachConfiguration
Every knob this plugin documents, with its default.
| Field | Type | Default | Meaning |
|---|---|---|---|
| log | boolean | true | volatile - the shared factory log switch |
| logFile | string | ~/.dsh/playform/hook-dsh-tool-coach.log | volatile - the ledger file |
| enabled | boolean | true | volatile - the coach switch |
| judgeTools | array | ["bash", "pwsh"] | volatile - the terminal tools that are judged |
| threshold | number | 3 | volatile - tier-1 strikes within the window |
| window | number | 8 | volatile - the sliding judged-call window |
| cooldown | number | 10 | volatile - judged calls between tier-1 notes |
| escalateThreshold | number | 6 | volatile - offenses since the last note that turn tier 2 on |
| cleanWindow | number | 12 | volatile - clean calls that turn tier 2 off |
| enforce | union | off | volatile - off / write / all, the tier-3 deny scope |
| enforceThreshold | number | 4 | volatile - strikes since the last note that deny |
| exemptPatterns | array | DEFAULT_EXEMPTS | volatile - the exempt command heads |
| patternTable | array | DEFAULT_PATTERNS | volatile - { pattern, class, tool, note? } rows |
| notes | object | first / persistent / denied templates | volatile - the three model-facing note texts |
| fetchLive | boolean | true | volatile - fetch tool data from the live registry |
| maxSectionTools | number | 5 | volatile - the tier-2 tool-table row cap |
| sectionTtl | number | 20 | volatile - judged calls between tier-2 section rebuilds |
Family
The neighbours at the same seam, the arms beyond it, the twin in the other release tree, and the packages this one needs.
Neighbours
The behavior map lists 10 answers at tools/post-execute, in the order the family registers them.
| Answer | Effect | Position |
|---|---|---|
| hook-dsh-ccr | rewrite | neighbour |
| hook-dsh-comment-filter | rewrite | neighbour |
| hook-dsh-convention-suggester | advise | neighbour |
| hook-dsh-doc-suggester | advise | neighbour |
| hook-dsh-edit-suggester | advise | neighbour |
| hook-dsh-graph-suggester | advise | neighbour |
| hook-dsh-replay-suggester | advise | neighbour |
| hook-dsh-search-suggester | advise | neighbour |
| hook-dsh-test-suggester | advise | neighbour |
| hook-dsh-tool-coach | advise | this package |
Arms
The seams its source also registers, beyond the one its README documents.
- agent/pre-step
- system-prompt/assemble
- tools/change
- tools/pre-execute
Twin
The same package in the other release tree, when one exists.
Its twin is ets-hook-dsh-tool-coach.
It registers the same listeners in the same order and composes the same ledger strings; the ledger file's name, which carries the package identity, and the factory base import are the only differences.
Dependencies
The packages this one imports, and whether each one is the family's own.
| Package | Role |
|---|---|
| family | |
| family |
Person
What the person waits for, reads, and never sees.
The person sees the note arrive as context rather than as content, so the result it is about reads exactly as it did before.
Architecture
This plugin's own structure: the shape the portrait gives it, the facts its source documents, and the rule its flow obeys.
Shape
Plugs into the tools/post-execute and tools/pre-execute waterfalls, the system-prompt/assemble section, and the agent/pre-step reset.
The four-tier ladder that keeps file content out of the terminal.
- Normalizes the command before matching, so an obfuscated variant still counts
- Classifies a segment as write, read, search, discovery, or control, and lets an exempt head dominate its pipe
- Escalates from a silent strike to a notice to a persistent section, and denies last
- Names the right tool from the live registry, and falls back to a static table when the fetch fails
- Its flow is the interesting part: the ladder is the hook, and the deny is only its last rung
Its shape machine belongs to Person.
Record
The release line, the source, and the files this page was read from.
Release
The versions the package's own changelog records, newest first.
- 0.3.0
- 0.2.1
- 0.2.0
- 0.1.0
Source
The package as the repository holds it.
Origin
The files this page was built from, and what each one supplies.
The files this page was read from 5
| File | Contributed | State |
|---|---|---|
| package.json | The name, the version, the private flag, and the dependencies. | read |
| README.md | The summary, the surface table, and the configuration table. | read |
| CHANGELOG.md | The release lines and their versions. | read |
| cordis.patch.yml | Activation: the bundle entry that mounts the plugin. | read |
| Source/Function/Apply.ts | The listeners, their registration order, and the service the flow calls. | read |
- Data
- The monorepo, read during the build
- Connection
- Build-time read; nothing is fetched at runtime
- Capture
- package.json, README.md, CHANGELOG.md, Source/Function/Apply.ts
Expand provenance source
This page is static. It cannot invoke the plugin, read a ledger, or change a configuration. Every figure comes from those files; a missing README falls back to the manifest's own description, and a package with no surface table shows no surface section.