Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add commands/silouone/clens/backtrack-analysisgit clone --depth 1 https://github.com/silouone/clensWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00012 | $0.00724 |
| Opus 5 | $0.00006 | $0.00362 |
| Sonnet 5 | $0.00002 | $0.00145 |
| Haiku 4.5 | $0.00001 | $0.00072 |
Grade A, and why
backtrack-analysis scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
Copies of this mod
1 near-identical copy found in the catalogue:
- backtrack-analysis — 100% identical, 0 lines differ
How it starts
The opening of the file, as written. The whole thing — 79 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Backtrack Analysis Command
Analyze backtracking patterns from a distilled clens session. Identifies wasted effort: failure retries, iteration struggles, and debugging loops.
Setup
Load the session-analysis skill for schema knowledge and interpretation context before proceeding.
Variables
TARGET: $ARGUMENTS
Workflow
1. Resolve the Session
- If TARGET is empty or
--last, find the most recent distilled session in.clens/distilled/ - If TARGET is a session ID (full UUID or prefix), find
.clens/distilled/{TARGET}*.json - If no distilled file is found, inform the user:
No distilled session found. Run
clens distill --lastfirst, then re-run this command.
2. Gather Data
Read the distilled JSON file at .clens/distilled/{sessionId}.json for the full DistilledSession object. Focus on: backtracks, file_map, decisions, reasoning, timeline, stats.
No CLI commands are needed — the distilled JSON is the primary data source.
3. Analyze Backtracks
For each backtrack entry, determine:
- Type classification:
failure_retry,iteration_struggle, ordebugging_loop - Severity: Based on attempt count, duration, and recurrence
- Root cause hypothesis: Infer from error messages, file paths, and reasoning context
- Prevention strategy: Actionable recommendation to avoid similar issues
4. Identify Hot Files
Cross-reference backtrack file_path values to find fragile files:
- Files appearing in 2+ backtracks are flagged as fragile
- Rank by backtrack count descending
- Note the types of backtracks each file triggers
5. Assess Tool Reliability
For each tool involved in backtracks:
- Calculate failure-to-success ratio
- Compare against session-wide tool usage from
stats.tools_by_name - Flag tools with failure rate above 20%
6. Generate Report
Produce a structured report with these sections:
- Summary table: Total backtracks, counts by type, wasted attempts, time in backtracks, percentage of session
- Severity assessment: Low / Medium / High rating with justification
- Backtrack details: Per-backtrack analysis with what happened, reasoning context, root cause, prevention
- Hot files: Table of fragile files with backtrack counts and types
- Tool reliability: Table of tools ranked by failure rate
- Timeline context: Simplified timeline showing events around each backtrack
- Prevention checklist: Actionable items relevant to detected patterns
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2d ago First seen · 79 lines · 12 tokens per session scan A e77566d62b28
backtrack-analysis is a command published in the GitHub repository silouone/clens (6 stars, last pushed 1mo ago), licensed MIT. It adds 12 tokens to every session and 724 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other commands, from other repositories
session-report
Analyze a distilled clens session and generate a structured performance report.
session-compare
Compare two distilled clens sessions side-by-side to identify performance differences.
backtrack-analysis
Deep-dive into backtracking patterns from distilled clens sessions.
review-synthesize
Produce one evidence-based verdict, write the review report humans read, and publish it when the scope is a PR. You are read-only: never modify project files or commit; your only write outside the artifacts directory is the PR comment below. Read-only extends past the repository: a falsifying command creates its own…
triage
Confirm whether the work item still names real current work, choose the kind of reasoning owed next, and stop. Write the decisive evidence and handoff to $ARTIFACTSDIR/triage.md. You assess and route only: the repository must be exactly as you found it when you finish. No one watches the run; the report and your…
upgrade-webkit
Upgrade Bun's WebKit fork to the latest upstream version of WebKit.