dsh-backstory

v0.8.2
dsh-backstory Checked 4 days ago Published 3 months ago

Ask any line of code its backstory: what it does, and why it's here — grounded in git history and the agent's own session log.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

backstory

Get the backstory of code: for a file (or a specific line range) return each line with the git commit that last touched it, plus — when an agent wrote a line — which turn wrote it and the user prompt that triggered it (from a persistent per-line ledger and DSH-* commit trailers, drift-resilient by content hash). Lines explained before come back with a cached `explanation`; explain only the ones without one, then call `backstory_remember` to cache them. Use it to explain not just WHAT the code does but WHY it is there. Ask for a narrow line range on large files.

ParameterTypeDescription
path *stringFile path (absolute or workspace-relative)
endLinenumberLast line (1-based). Defaults to `line`.
linenumberFirst line (1-based). Omit to read the whole file.

backstory_remember

Cache your per-line explanations so future `backstory` queries return them. Pass the lines you just explained; each is stored keyed by the line's current content, and comes back as `explanation` until that line changes.

ParameterTypeDescription
notes *arrayOne entry per explained line.
path *stringFile path (absolute or workspace-relative)