agentwrangler 0.1.1-next.fbd0f08 → 0.2.1-next.5ed2140

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (393) hide show
  1. package/CHANGELOG.md +107 -0
  2. package/README.md +123 -162
  3. package/dist/apply/artifact-framework.js +484 -0
  4. package/dist/apply/jobs.js +21 -9
  5. package/dist/apply/open-terminal-child.mjs +4 -1
  6. package/dist/apply/open-terminal.js +64 -17
  7. package/dist/cli/agentwrangler.js +21 -6
  8. package/dist/cli/audit/index.js +277 -0
  9. package/dist/cli/audit/prompt.md +227 -0
  10. package/dist/cli/audit/query.mjs +59 -0
  11. package/dist/cli/audit/render.mjs +167 -0
  12. package/dist/cli/audit/scan.mjs +369 -0
  13. package/dist/cli/statusline.js +294 -0
  14. package/dist/daemon/boot-state.js +128 -0
  15. package/dist/daemon/config.js +21 -1
  16. package/dist/daemon/data-version.js +34 -0
  17. package/dist/daemon/detector-counters.js +98 -0
  18. package/dist/daemon/detector-pass.js +98 -0
  19. package/dist/daemon/diagnostics-snapshot.js +270 -0
  20. package/dist/daemon/diagnostics-worker-runner.js +71 -0
  21. package/dist/daemon/diagnostics-worker.js +31 -0
  22. package/dist/daemon/effect-pass.js +24 -0
  23. package/dist/daemon/headroom-snapshot.js +64 -0
  24. package/dist/daemon/headroom-worker-runner.js +66 -0
  25. package/dist/daemon/headroom-worker.js +26 -0
  26. package/dist/daemon/heavy-job-gate.js +41 -0
  27. package/dist/daemon/history-worker-runner.js +71 -0
  28. package/dist/daemon/history-worker.js +49 -0
  29. package/dist/daemon/http.js +45 -89
  30. package/dist/daemon/index.js +565 -140
  31. package/dist/daemon/instance-lock.js +62 -0
  32. package/dist/daemon/job-budgets.js +211 -0
  33. package/dist/daemon/lifecycle.js +134 -0
  34. package/dist/daemon/outcomes-control.js +157 -0
  35. package/dist/daemon/outcomes-pass.js +193 -70
  36. package/dist/daemon/perf-monitor.js +503 -0
  37. package/dist/daemon/readiness.js +19 -16
  38. package/dist/daemon/recs-snapshot.js +242 -0
  39. package/dist/daemon/recs-worker-runner.js +87 -0
  40. package/dist/daemon/recs-worker.js +40 -0
  41. package/dist/daemon/route-budgets.js +182 -0
  42. package/dist/daemon/route-snapshot-build.js +9 -0
  43. package/dist/daemon/route-snapshot-worker.js +26 -0
  44. package/dist/daemon/route-snapshot.js +105 -0
  45. package/dist/daemon/router.js +1233 -114
  46. package/dist/daemon/scan-offload.js +107 -0
  47. package/dist/daemon/scan-roots.js +18 -0
  48. package/dist/daemon/scan-tasks.js +99 -0
  49. package/dist/daemon/scan-worker.js +37 -0
  50. package/dist/daemon/schedule-job.js +62 -0
  51. package/dist/daemon/snapshot-service.js +152 -0
  52. package/dist/daemon/static.js +142 -46
  53. package/dist/daemon/timer-probe.js +58 -0
  54. package/dist/daemon/wal-checkpoint-worker.js +23 -0
  55. package/dist/daemon/wal-checkpointer.js +92 -0
  56. package/dist/db/idle-checkpoint.js +56 -0
  57. package/dist/db/migrate.js +52 -7
  58. package/dist/db/migrations/018_effect_cycles.sql +109 -0
  59. package/dist/db/migrations/019_work_records.sql +291 -0
  60. package/dist/db/migrations/020_local_command_retention.sql +50 -0
  61. package/dist/db/migrations/021_recommendation_feedback.sql +25 -0
  62. package/dist/db/migrations/022_classifier_boundaries.sql +27 -0
  63. package/dist/db/migrations/023_privacy_contract.sql +73 -0
  64. package/dist/db/migrations/024_finding_contract_v2.sql +50 -0
  65. package/dist/db/migrations/025_tool_error_classifier.sql +76 -0
  66. package/dist/db/migrations/026_recommendation_contract_guards.sql +102 -0
  67. package/dist/db/migrations/027_handler_recommendation_storage.sql +532 -0
  68. package/dist/db/migrations/028_tool_event_content.sql +27 -0
  69. package/dist/db/migrations/029_subagent_meta.sql +13 -0
  70. package/dist/db/migrations/030_detector_week_results.sql +33 -0
  71. package/dist/db/migrations/031_detector_status_live.sql +15 -0
  72. package/dist/db/migrations/032_session_title.sql +3 -0
  73. package/dist/db/migrations/033_compaction_positions.sql +2 -0
  74. package/dist/db/migrations/034_ingest_metric_events_session_position.sql +3 -0
  75. package/dist/db/migrations/035_rec_lifecycle.sql +82 -0
  76. package/dist/db/migrations/036_rec_lifecycle_actions.sql +17 -0
  77. package/dist/db/migrations/037_subagent_meta_session_index.sql +2 -0
  78. package/dist/db/migrations/038_turns_agent_id.sql +5 -0
  79. package/dist/db/migrations/039_unrestrict_app_content.sql +9 -0
  80. package/dist/db/migrations/040_ledger_daily.sql +53 -0
  81. package/dist/db/migrations/041_perf_indexes.sql +13 -0
  82. package/dist/db/migrations/042_limit_snapshots.sql +11 -0
  83. package/dist/db/migrations/043_tool_error_labels_v2.sql +101 -0
  84. package/dist/db/migrations/044_c6_edit_string_hashes.sql +7 -0
  85. package/dist/db/migrations/045_catalog_items.sql +32 -0
  86. package/dist/db/migrations/046_detector_contract_v2.sql +35 -0
  87. package/dist/db/migrations/047_ingest_metric_events_event_ts.sql +4 -0
  88. package/dist/db/migrations/048_ingest_offset_identity.sql +15 -0
  89. package/dist/db/migrations/049_setup_grade_snapshots.sql +18 -0
  90. package/dist/db/migrations/050_setup_grade_indexes.sql +8 -0
  91. package/dist/db/migrations/051_judge_verdicts.sql +14 -0
  92. package/dist/db/migrations/052_classifier_version_2.sql +38 -0
  93. package/dist/db/migrations/053_turns_grade_cover.sql +7 -0
  94. package/dist/db/open.js +13 -0
  95. package/dist/db/stmt-cache.js +23 -0
  96. package/dist/db/write-gate.js +104 -0
  97. package/dist/db/write-intent.js +66 -0
  98. package/dist/detector/cache-collapse.js +156 -0
  99. package/dist/detector/cache-ttl.js +58 -0
  100. package/dist/detector/calibration.js +35 -18
  101. package/dist/detector/certification.js +77 -0
  102. package/dist/detector/check-guidance.js +213 -0
  103. package/dist/detector/check-registry.js +713 -0
  104. package/dist/detector/claim-ledger.js +521 -0
  105. package/dist/detector/context-history-retention.js +49 -0
  106. package/dist/detector/context-probe.js +222 -55
  107. package/dist/detector/contracts.js +99 -0
  108. package/dist/detector/d1-source-identity.js +27 -11
  109. package/dist/detector/d7-loop-analysis.js +263 -0
  110. package/dist/detector/detectors/a1_tool_result_bloat.js +249 -0
  111. package/dist/detector/detectors/a2_task_output_bloat.js +243 -0
  112. package/dist/detector/detectors/b1_cache_read_collapse.js +339 -0
  113. package/dist/detector/detectors/b2_cache_ttl_gap.js +200 -0
  114. package/dist/detector/detectors/b3_resume_cache_miss.js +285 -0
  115. package/dist/detector/detectors/b4_mid_session_prefix_break.js +179 -0
  116. package/dist/detector/detectors/c11_mcp_output_cap.js +154 -0
  117. package/dist/detector/detectors/c1_tool_error_rate.js +200 -0
  118. package/dist/detector/detectors/c2_content_not_found.js +128 -0
  119. package/dist/detector/detectors/c3_edit_before_read.js +142 -0
  120. package/dist/detector/detectors/c4_failed_edit_recovery.js +215 -0
  121. package/dist/detector/detectors/c5_same_error_loop.js +363 -0
  122. package/dist/detector/detectors/c6_edit_flip_flop.js +191 -0
  123. package/dist/detector/detectors/c7_bash_failure_cluster.js +225 -0
  124. package/dist/detector/detectors/c9_denial_friction.js +198 -0
  125. package/dist/detector/detectors/d10_catalog_footprint.js +248 -92
  126. package/dist/detector/detectors/d11_tool_error_rate.js +125 -0
  127. package/dist/detector/detectors/d12_subagent_overspawn.js +135 -0
  128. package/dist/detector/detectors/d14_interrupt_cancel.js +189 -0
  129. package/dist/detector/detectors/d1_ctx_always_loaded.js +271 -84
  130. package/dist/detector/detectors/d2_session_long_full_context.js +387 -88
  131. package/dist/detector/detectors/d4_model_mismatch.js +335 -161
  132. package/dist/detector/detectors/d5_limit_burn_forecast.js +222 -44
  133. package/dist/detector/detectors/d6_tool_result_bloat.js +272 -260
  134. package/dist/detector/detectors/d7_loop_retry_waste.js +565 -218
  135. package/dist/detector/detectors/d8_cache_write_churn.js +310 -163
  136. package/dist/detector/detectors/d9_idle_background_session.js +127 -79
  137. package/dist/detector/detectors/e1_orientation_before_first_edit.js +180 -0
  138. package/dist/detector/detectors/e2_main_thread_mechanical_runs.js +227 -0
  139. package/dist/detector/detectors/g11_high_spend_failure.js +233 -0
  140. package/dist/detector/detectors/h1_destructive_operations.js +202 -0
  141. package/dist/detector/engine.js +829 -15
  142. package/dist/detector/finding-registry.js +61 -0
  143. package/dist/detector/index.js +1 -1
  144. package/dist/detector/ledger-daily.js +183 -0
  145. package/dist/detector/measurement.js +24 -9
  146. package/dist/detector/model-windows.js +23 -0
  147. package/dist/detector/practice-registry.js +14 -4
  148. package/dist/detector/privacy-contract.js +1065 -0
  149. package/dist/detector/rec-id.js +16 -0
  150. package/dist/detector/registry.js +44 -0
  151. package/dist/detector/result-claims.js +253 -0
  152. package/dist/detector/savings.js +598 -54
  153. package/dist/detector/setup-grade.js +658 -0
  154. package/dist/detector/tier-price.js +56 -0
  155. package/dist/detector/turn-claim.js +681 -0
  156. package/dist/detector/waste-turn-claims.js +94 -0
  157. package/dist/detector/wave1-reconciliation.js +157 -0
  158. package/dist/detector/write-price.js +130 -0
  159. package/dist/effects/api-contract.js +1 -0
  160. package/dist/effects/engine.js +673 -0
  161. package/dist/effects/gate.js +2 -0
  162. package/dist/effects/index.js +6 -0
  163. package/dist/effects/legacy.js +28 -0
  164. package/dist/effects/registry.js +420 -0
  165. package/dist/effects/scope-identity.js +19 -0
  166. package/dist/effects/sql-observer.js +793 -0
  167. package/dist/effects/store.js +368 -0
  168. package/dist/effects/types.js +2 -0
  169. package/dist/evidence/common/approved-input.js +2 -1
  170. package/dist/evidence/common/boundary.js +2 -1
  171. package/dist/evidence/cond1/packet.js +6 -3
  172. package/dist/evidence/cond1/prepare.js +4 -2
  173. package/dist/evidence/create-approval.js +2 -1
  174. package/dist/evidence/create-scratch.js +2 -1
  175. package/dist/evidence/discover-approval.js +6 -2
  176. package/dist/evidence/g2/cli.js +7 -9
  177. package/dist/evidence/precision-artifact-guard.js +231 -0
  178. package/dist/evidence/precision-gate.js +329 -0
  179. package/dist/evidence/r3/prepare.js +3 -1
  180. package/dist/hook/context-budget-hook.mjs +46 -41
  181. package/dist/hook/limit-burn-hook.mjs +10 -8
  182. package/dist/hook/loop-guard-hook.mjs +5 -6
  183. package/dist/hook/precompact-checkpoint-hook.mjs +26 -13
  184. package/dist/ingest/agent-id-backfill.js +85 -0
  185. package/dist/ingest/boot-progress.js +194 -0
  186. package/dist/ingest/canary-purge.js +52 -0
  187. package/dist/ingest/churn-collector.js +37 -16
  188. package/dist/ingest/commit-linker.js +171 -0
  189. package/dist/ingest/compaction-boundaries.js +74 -0
  190. package/dist/ingest/destructive-relabel.js +88 -0
  191. package/dist/ingest/destructive.js +204 -0
  192. package/dist/ingest/discovery.js +22 -7
  193. package/dist/ingest/enrichment-epoch.js +35 -0
  194. package/dist/ingest/index.js +1 -0
  195. package/dist/ingest/ingestor.js +1655 -194
  196. package/dist/ingest/interrupt-relabel.js +98 -0
  197. package/dist/ingest/n-computability.js +61 -0
  198. package/dist/ingest/parser.js +291 -28
  199. package/dist/ingest/pricing.js +171 -14
  200. package/dist/ingest/reconcile.js +18 -0
  201. package/dist/ingest/reprice.js +84 -0
  202. package/dist/ingest/secrets-filter.js +97 -0
  203. package/dist/ingest/session-attribution-repair.js +157 -0
  204. package/dist/ingest/tail.js +234 -28
  205. package/dist/ingest/test-command-repair.js +45 -0
  206. package/dist/ingest/test-seams.js +107 -0
  207. package/dist/ingest/tool-error-classifier.js +120 -0
  208. package/dist/ingest/tool-error-repair.js +46 -0
  209. package/dist/ingest/types.js +17 -4
  210. package/dist/ingest/workspace-mapping.js +26 -18
  211. package/dist/ingest/worktree-workspace-merge.js +38 -0
  212. package/dist/judge/claude-cli.js +201 -0
  213. package/dist/judge/judge-service.js +270 -0
  214. package/dist/judge/verdict.js +160 -0
  215. package/dist/oauth/count-tokens.js +13 -21
  216. package/dist/oauth/credentials.js +53 -25
  217. package/dist/oauth/judge-g2-client.js +9 -28
  218. package/dist/oauth/usage-cache.js +96 -0
  219. package/dist/oauth/usage.js +11 -162
  220. package/dist/outcomes/conclusions.js +15 -0
  221. package/dist/outcomes/findings.js +31 -8
  222. package/dist/outcomes/github/client.js +1 -0
  223. package/dist/outcomes/github/credential.js +96 -58
  224. package/dist/outcomes/github/gh-cli-client.js +117 -1
  225. package/dist/outcomes/github/pr-page.js +277 -0
  226. package/dist/outcomes/linker.js +200 -8
  227. package/dist/outcomes/stage-summary.js +80 -0
  228. package/dist/outcomes/sync.js +152 -19
  229. package/dist/query/api/agents-liveness.js +98 -14
  230. package/dist/query/api/burn-status.js +78 -15
  231. package/dist/query/api/context-budget.js +21 -6
  232. package/dist/query/api/cost-per-success.js +13 -1
  233. package/dist/query/api/decision-method-registry.js +30 -0
  234. package/dist/query/api/decision-ranker-types.js +6 -0
  235. package/dist/query/api/decision-track.js +188 -0
  236. package/dist/query/api/decision-view-types.js +1 -0
  237. package/dist/query/api/delivery.js +25 -3
  238. package/dist/query/api/diagnostics-avoidable.js +9 -0
  239. package/dist/query/api/diagnostics-causes.js +374 -0
  240. package/dist/query/api/diagnostics-census.js +259 -0
  241. package/dist/query/api/diagnostics-triage.js +643 -0
  242. package/dist/query/api/diagnostics.js +278 -0
  243. package/dist/query/api/effect-service.js +691 -0
  244. package/dist/query/api/effectiveness.js +30 -5
  245. package/dist/query/api/efficiency-headroom.js +42 -39
  246. package/dist/query/api/esf-observations.js +314 -0
  247. package/dist/query/api/evidence-packet-types.js +3 -0
  248. package/dist/query/api/evidence-packet.js +316 -0
  249. package/dist/query/api/feedback-store.js +301 -0
  250. package/dist/query/api/hook-config.js +3 -2
  251. package/dist/query/api/hot-sessions.js +213 -7
  252. package/dist/query/api/index.js +6 -2
  253. package/dist/query/api/judge-payload-scrub.js +186 -0
  254. package/dist/query/api/judge-payload.js +336 -0
  255. package/dist/query/api/judge-setup.js +249 -0
  256. package/dist/query/api/ledger-aggregate.js +133 -0
  257. package/dist/query/api/ledger-daily-provider.js +122 -0
  258. package/dist/query/api/opportunity-composer-types.js +3 -0
  259. package/dist/query/api/opportunity-composer.js +303 -0
  260. package/dist/query/api/overview-view.js +167 -0
  261. package/dist/query/api/overview.js +251 -16
  262. package/dist/query/api/rec-actions/accessor.js +28 -0
  263. package/dist/query/api/rec-actions/card-rules.js +149 -0
  264. package/dist/query/api/rec-actions/families/cache.js +528 -0
  265. package/dist/query/api/rec-actions/families/context.js +1104 -0
  266. package/dist/query/api/rec-actions/families/errors.js +970 -0
  267. package/dist/query/api/rec-actions/families/orientation.js +45 -0
  268. package/dist/query/api/rec-actions/families/permissions.js +504 -0
  269. package/dist/query/api/rec-actions/families/routing.js +333 -0
  270. package/dist/query/api/rec-actions/guardrails.js +67 -0
  271. package/dist/query/api/rec-actions/index.js +90 -0
  272. package/dist/query/api/rec-actions/prompt.js +93 -0
  273. package/dist/query/api/rec-actions/settings-registry.js +67 -0
  274. package/dist/query/api/rec-actions/trigger.js +2015 -0
  275. package/dist/query/api/rec-actions/types.js +2 -0
  276. package/dist/query/api/rec-actions/validate.js +184 -0
  277. package/dist/query/api/rec-actions/why.js +42 -0
  278. package/dist/query/api/rec-evidence.js +204 -0
  279. package/dist/query/api/rec-prompt.js +139 -131
  280. package/dist/query/api/recommendation-queue-reader.js +197 -0
  281. package/dist/query/api/recommendation-queue.js +258 -0
  282. package/dist/query/api/recommendations-ledger.js +28 -26
  283. package/dist/query/api/recommendations.js +1154 -216
  284. package/dist/query/api/reports.js +17 -5
  285. package/dist/query/api/self-percentiles.js +9 -2
  286. package/dist/query/api/session-breakdown.js +91 -0
  287. package/dist/query/api/session-drivers.js +166 -17
  288. package/dist/query/api/session-story.js +335 -0
  289. package/dist/query/api/settings.js +2 -2
  290. package/dist/query/api/spend-flavor.js +23 -16
  291. package/dist/query/api/tool-calls.js +1442 -0
  292. package/dist/query/api/trends.js +107 -11
  293. package/dist/query/cap-weighted.js +1 -1
  294. package/dist/query/decision-contract.js +79 -0
  295. package/dist/query/limits/cli-usage.js +412 -0
  296. package/dist/query/limits/compute.js +39 -0
  297. package/dist/query/limits/history.js +143 -0
  298. package/dist/query/limits/index.js +482 -0
  299. package/dist/query/limits/last-good-store.js +53 -0
  300. package/dist/query/limits/snapshot-store.js +21 -0
  301. package/dist/query/limits/statusline-install.js +268 -0
  302. package/dist/query/limits/statusline.js +115 -0
  303. package/dist/query/limits/types.js +11 -0
  304. package/dist/query/limits/usage-sources.js +106 -0
  305. package/dist/query/limits/weight-fit.js +109 -0
  306. package/dist/query/recommendation-contract.js +66 -0
  307. package/dist/query/settings-store.js +129 -25
  308. package/dist/query/spend.js +204 -28
  309. package/dist/query/trends.js +27 -0
  310. package/dist/recommendations/capabilities.js +146 -0
  311. package/dist/recommendations/correlation.js +63 -0
  312. package/dist/recommendations/engine.js +248 -0
  313. package/dist/recommendations/handlers/h2-output-context/index.js +314 -0
  314. package/dist/recommendations/handlers/h3-cache-efficiency/index.js +260 -0
  315. package/dist/recommendations/handlers/h4-error-loop/index.js +346 -0
  316. package/dist/recommendations/handlers/h5-permission-friction/index.js +373 -0
  317. package/dist/recommendations/handlers/h6-durable-corrections/index.js +286 -0
  318. package/dist/recommendations/investigation-prompt.js +179 -0
  319. package/dist/recommendations/legacy-adapter.js +36 -0
  320. package/dist/recommendations/persistence.js +71 -0
  321. package/dist/recommendations/queue-contract.js +14 -0
  322. package/dist/recommendations/ranking-policy.js +98 -0
  323. package/dist/recommendations/registry.js +29 -0
  324. package/dist/recommendations/shadow.js +59 -0
  325. package/dist/recommendations/storage.js +497 -0
  326. package/dist/recommendations/types.js +88 -0
  327. package/dist/recommendations/value.js +29 -0
  328. package/dist/scanner/env-scan.js +240 -0
  329. package/dist/shared/claude-child-env.js +9 -0
  330. package/dist/shared/schemas/overview-view.js +214 -0
  331. package/dist/ui/assets/DiagnosticsPage-BCaUDFxE.js +1 -0
  332. package/dist/ui/assets/EmptyState-C7EQV0p-.js +1 -0
  333. package/dist/ui/assets/GlossaryPage-D0nTvq42.js +1 -0
  334. package/dist/ui/assets/HotSessionsPage-C_HsxJFF.js +1 -0
  335. package/dist/ui/assets/JudgeSetupPage-fQj6m0G4.js +2 -0
  336. package/dist/ui/assets/KpiCard-B1-vShSH.js +1 -0
  337. package/dist/ui/assets/Modal-CRuYwITz.js +1 -0
  338. package/dist/ui/assets/OverviewPage-3_QR8iee.js +1 -0
  339. package/dist/ui/assets/PartialBadge-DatGI4yN.js +1 -0
  340. package/dist/ui/assets/RecommendationsPage-C1bGp6fc.js +3 -0
  341. package/dist/ui/assets/SessionDetailPage-Dx4-Akgp.js +2 -0
  342. package/dist/ui/assets/SettingsPage-DZwji9oq.js +25 -0
  343. package/dist/ui/assets/Skeleton-CFvSDQMx.js +1 -0
  344. package/dist/ui/assets/SpendPercentileChip-DhKskPQk.js +1 -0
  345. package/dist/ui/assets/StateChip-D0IFZyGe.js +1 -0
  346. package/dist/ui/assets/WorkspaceDetailPage-DqWtAW49.js +1 -0
  347. package/dist/ui/assets/WorkspacesPage-DzN9L9oH.js +1 -0
  348. package/dist/ui/assets/bands-dF7VjHZE.js +1 -0
  349. package/dist/ui/assets/drilldown-seed--YO7LBXB.js +1 -0
  350. package/dist/ui/assets/effect-client-DatnwqXw.js +1 -0
  351. package/dist/ui/assets/esf-client-DxAXbBnk.js +1 -0
  352. package/dist/ui/assets/history-status-CoFOVM1Y.js +1 -0
  353. package/dist/ui/assets/index-Ctw3qvV7.css +1 -0
  354. package/dist/ui/assets/index-jONT-smE.js +10 -0
  355. package/dist/ui/assets/prompt-templates-B55TZOUy.js +13 -0
  356. package/dist/ui/assets/recharts-DzqPq0lG.js +112 -0
  357. package/dist/ui/assets/short-id-C12NbqLn.js +1 -0
  358. package/dist/ui/assets/useExperimentalActions-oeWGgxs5.js +1 -0
  359. package/dist/ui/assets/workspace-names-zbeGPydt.js +1 -0
  360. package/dist/ui/index.html +95 -24
  361. package/dist/ui/media/Agent-Wrangler-Logo@2x.png +0 -0
  362. package/dist/ui/media/Agent-Wrangler-Logo@4x.png +0 -0
  363. package/package.json +27 -5
  364. package/dist/ui/assets/BarChart-BwFZrcLn.js +0 -3
  365. package/dist/ui/assets/BriefsPage-CtJwHLOh.js +0 -2
  366. package/dist/ui/assets/CacheWriteSpikesChart-zJIJWO41.js +0 -1
  367. package/dist/ui/assets/CartesianChart-qApXl3Ak.js +0 -84
  368. package/dist/ui/assets/Chip-Cpt_fEc9.js +0 -1
  369. package/dist/ui/assets/ComposedChart-DYf1wymW.js +0 -1
  370. package/dist/ui/assets/EmptyState-DL8gAVnJ.js +0 -1
  371. package/dist/ui/assets/FlavorDecomposition-CvJW78M9.js +0 -1
  372. package/dist/ui/assets/FrictionCell-DciiSd3L.js +0 -2
  373. package/dist/ui/assets/GlossaryPage-BMkZGt2D.js +0 -1
  374. package/dist/ui/assets/HotSessionsPage-Ejn385bb.js +0 -1
  375. package/dist/ui/assets/InfoTip-Ckc9_LpJ.js +0 -1
  376. package/dist/ui/assets/Legend-C_YMp0Rv.js +0 -5
  377. package/dist/ui/assets/Line-DU4UvEBO.js +0 -1
  378. package/dist/ui/assets/OverviewPage-BcEKdWZj.js +0 -2
  379. package/dist/ui/assets/RecommendationsPage-CHfuNP_W.js +0 -2
  380. package/dist/ui/assets/Scatter-CNetVLuX.js +0 -1
  381. package/dist/ui/assets/SessionDetailPage-CYm5Gxo0.js +0 -1
  382. package/dist/ui/assets/SettingsPage-DjgGZj8N.js +0 -25
  383. package/dist/ui/assets/Skeleton-BO9mXDXU.js +0 -1
  384. package/dist/ui/assets/SpendPercentileChip-BvaZ8Lzi.js +0 -1
  385. package/dist/ui/assets/TrendChart-DKy9aH5G.js +0 -1
  386. package/dist/ui/assets/WorkspaceDetailPage-dutc4EpN.js +0 -1
  387. package/dist/ui/assets/WorkspacesPage-isSML2fh.js +0 -1
  388. package/dist/ui/assets/chart-theme-BPPMjbVX.js +0 -1
  389. package/dist/ui/assets/graphicalItemSelectors-DgKF1Dg2.js +0 -1
  390. package/dist/ui/assets/index-CUyiomzU.js +0 -41
  391. package/dist/ui/assets/index-SrfNUeBZ.css +0 -1
  392. package/dist/ui/assets/prompt-templates-DhR4Qoy9.js +0 -13
  393. package/dist/ui/assets/useExperimentalActions-BeDSmwBu.js +0 -1
package/CHANGELOG.md ADDED
@@ -0,0 +1,107 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project are documented here. The format is based on
4
+ [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to
5
+ [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
+
7
+ ## [Unreleased]
8
+
9
+ ## [0.2.0]
10
+
11
+ A large release: a redesigned dashboard, 31 detectors (up from 9), one ranked list of recommendations with
12
+ measured effects, and a new Rate my setup page. Usage limits are now read through your own Claude Code CLI, and
13
+ one-click apply is off. Full notes: [docs/releases/0.2.0.md](https://github.com/Doogit/AgentWrangler/blob/main/docs/releases/0.2.0.md).
14
+
15
+ ### Performance
16
+ - Opens sooner on first launch (newest sessions first, the rest in the background) and stays responsive while it
17
+ reads.
18
+ - Transcript reading runs in short time slices. History, recommendations, Usage patterns and headroom are built in
19
+ background worker threads and served from snapshots, so page requests do not wait on them.
20
+ - Copied or renamed transcripts are not read again, warm restarts skip unchanged files, and one browser tab polls
21
+ for status on behalf of the others.
22
+ - Measured in our release test gate while a backfill is running: daemon event-loop p99 ≤ 50 ms, and each of the 67
23
+ budgeted API routes within its p95 latency budget (250 ms for most routes).
24
+
25
+ ### UI / dashboard
26
+ - New sidebar groups, a redesigned Overview, Sessions and Workspaces, and new Usage patterns and Help pages.
27
+ - Overview: a Usage limits card, $ and Tokens spend tabs, a 12-week chart of your implied weekly limit, and your most
28
+ expensive sessions of the last 7 days. Sessions is paged, with cache hit %, peak context and subagent cost columns.
29
+ - Usage patterns groups avoidable spend and reliability problems by root cause, with the affected sessions.
30
+ - Removed: the Briefs tab (now Rate my setup), work records, and the Overview cache-efficiency tile.
31
+
32
+ ### Detectors
33
+ - 31 detectors (up from 9), each tested with a must-fire and a near-miss fixture.
34
+ - New areas include oversized tool output, cache misses and breaks, tool error rates, edits before reads, repeated
35
+ errors, permission denials, subagent over-spawning and destructive operations.
36
+ - Dollar figures are estimates at list prices; a card says **Not estimated** when it cannot price the finding.
37
+ Shared turns are no longer counted twice, and subagent turns are attributed and priced.
38
+
39
+ ### Handlers and recommendations
40
+ - One list ranked by dollars per week; **Track** a change and AgentWrangler measures its effect over 14 days.
41
+ Dismissals and adoptions can be undone.
42
+ - Each card shows a summary, why it matters, the evidence (sessions and turns) and its actions. A change it cannot
43
+ measure says "Effect not measured" instead of guessing.
44
+ - Resetting recommendations keeps the ones you acted on and their measured effects.
45
+
46
+ ### Judge module
47
+ - **Rate my setup** grades your Claude Code setup; optional **Judge me** asks Claude for a review after showing you
48
+ what will be sent.
49
+ - Checks cover settings, hooks, CLAUDE.md and memory files, MCP servers, permissions, skills and agents. A snapshot
50
+ is saved each time your grade changes.
51
+ - Judge me runs your own `claude` with no tools, no MCP servers and no saved session; secrets are blocked. Typical
52
+ cost: $0.30–$0.40 of your Claude usage.
53
+
54
+ ### Usage limits
55
+ - Read by running your own `claude -p /usage` in the background (on by default, off in Settings), or from the
56
+ statusline. AgentWrangler no longer sends your Claude login token anywhere.
57
+ - The reader runs only while the dashboard is open: at most every 5 minutes when you are active, hourly when idle,
58
+ and not while the statusline reading is fresh. Only percentages, reset times and model labels are kept.
59
+ - The card keeps the last good reading across restarts and marks it stale when it is old.
60
+
61
+ ### Ingest and data
62
+ - Reads `/clear`, `/compact`, session titles and subagent attribution; price fixes; one daemon per database and a
63
+ backup before each migration. Some unused API routes were removed (see the full notes).
64
+ - 38 new database migrations. A database written by a newer AgentWrangler is refused instead of damaged; the
65
+ pre-migration backup (`.pre-migrate.bak`) is skipped above 512 MB.
66
+ - Price fixes for Opus 5.5 and Sonnet 5.5 cache reads and Haiku 5.5 tiers, with a re-price of stored history.
67
+
68
+ ### CLI, install and packaging
69
+ - **The default address is now `http://127.0.0.1:2929`** (was `127.0.0.1:47821`). Set `AW_PORT` to keep the old
70
+ port. Update bookmarks.
71
+ - New `agentwrangler statusline` (install from Settings; wraps your existing statusline command).
72
+ - New `agentwrangler audit` (experimental). The npm package now includes this changelog. Still requires Node.js 22
73
+ to 24.
74
+
75
+ ### macOS
76
+ - Non-blocking Keychain read, a checked and time-limited Terminal.app launch for Open in Claude Code, and a macOS
77
+ first-run smoke test in CI.
78
+ - The Keychain read is limited to 3 seconds and cached; the Terminal.app launch gives up after 20 seconds.
79
+
80
+ ### Security and privacy
81
+ - `ANTHROPIC_API_KEY` is never passed to a `claude` that AgentWrangler starts. Write requests need a per-run token.
82
+ - Guardrail hooks no longer skip Claude Code's permission prompt; reinstall them from Settings after upgrading.
83
+ - The local database may hold secrets-filtered transcript excerpts; nothing leaves your machine as sync, backup or
84
+ telemetry.
85
+
86
+ ### Off in 0.2.0 / known limits
87
+ - One-click apply is off (`403 APPLY_DISABLED`); use Copy prompt or Open in Claude Code (Settings > Advanced >
88
+ Experimental actions).
89
+ - The macOS Keychain and Terminal Automation prompts are not yet tested on a real Mac.
90
+
91
+ ## [0.1.0] - 2026-09-04
92
+
93
+ Initial public release.
94
+
95
+ ### Added
96
+ - Local-first observability daemon (bound to `127.0.0.1:47821`) and a browser dashboard that joins
97
+ your Claude Code token spend to the pull requests each session merged or closed — entirely on your
98
+ machine, with no cloud backend and no telemetry.
99
+ - Installable guardrails, turn-key from the dashboard: a dangerous-command deny hook, a PreCompact
100
+ checkpoint, and a context-budget warning.
101
+ - SQLite-backed local store (`~/.agentwrangler/db.sqlite`) that persists only aggregates, ids,
102
+ counts, and structural anchors — never raw transcript or PR content (the SEC-101 privacy
103
+ invariant).
104
+ - Optional GitHub token (read locally, never logged) powering the PR-outcomes feature.
105
+
106
+ [0.2.0]: https://github.com/Doogit/AgentWrangler/releases/tag/v0.2.0
107
+ [0.1.0]: https://github.com/Doogit/AgentWrangler/releases/tag/v0.1.0
package/README.md CHANGED
@@ -1,184 +1,145 @@
1
1
  <p align="center">
2
- <img src="docs/assets/logo.png" alt="AgentWrangler logo" width="260">
2
+ <img src="https://raw.githubusercontent.com/Doogit/AgentWrangler/main/docs/assets/logo.png" alt="AgentWrangler logo" width="200">
3
3
  </p>
4
4
 
5
- <h1 align="center">AgentWrangler</h1>
5
+ # AgentWrangler
6
6
 
7
- <p align="center">
8
- <b>See where your Claude Code tokens go — and whether the work actually shipped.</b><br>
9
- Local-first observability for Claude Code: token spend, session outcomes, waste detection,
10
- and installable guardrails. Runs entirely on your machine.
11
- </p>
12
-
13
- <p align="center">
14
- <a href="https://www.npmjs.com/package/agentwrangler"><img src="https://img.shields.io/npm/v/agentwrangler" alt="npm version"></a>
15
- <a href="https://github.com/Doogit/AgentWrangler/actions/workflows/ci.yml"><img src="https://github.com/Doogit/AgentWrangler/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
16
- <a href="https://img.shields.io/node/v/agentwrangler"><img src="https://img.shields.io/node/v/agentwrangler" alt="node version"></a>
17
- <a href="LICENSE"><img src="https://img.shields.io/badge/license-Apache--2.0-blue" alt="license"></a>
18
- </p>
19
-
20
- ![AgentWrangler dashboard — spend verdict, model mix, recommendations, and per-repo efficiency](docs/assets/dashboard.gif)
21
-
22
- <!--
23
- All screenshots and the demo GIF in this README are captured from a SANITIZED instance
24
- (Vite test-mode fixtures — anonymized names, no live data) so no real workspace/repository
25
- names or paths are committed (SEC-101). Regenerate against `npx vite --mode test`.
26
- -->
27
-
28
- ## Why
29
-
30
- Claude Code tells you almost nothing about where your token budget goes. Sessions balloon,
31
- caches miss, background agents idle — and you find out when you hit the rate limit.
32
- AgentWrangler reads the transcripts Claude Code already writes to your disk and answers three
33
- questions:
34
-
35
- - **Where did the tokens go?** Per-model, per-workspace, per-session spend with cache economics.
36
- - **Did the work ship?** Sessions are linked to the pull requests they merged or closed.
37
- - **What should I change?** Ranked waste-source detectors with modeled savings — and one-click
38
- guardrail hooks that warn *inside* Claude Code before waste happens.
39
-
40
- No cloud backend, no telemetry, no account. A daemon on `127.0.0.1`, a dashboard in your
41
- browser, and a SQLite file in your home directory.
7
+ See where your Claude Code tokens go, inspect costly sessions, and track whether a change helped.
8
+ AgentWrangler reads local Claude Code transcripts and serves a dashboard on your machine.
9
+ No account or cloud backend is required.
42
10
 
43
11
  ## Quick start
44
12
 
13
+ Requires **Node 22-24 and npm**, plus Claude Code transcripts for populated charts.
14
+
45
15
  ```sh
46
16
  npx agentwrangler@latest
47
17
  ```
48
18
 
49
- That's it — requires Node **22–24**. The daemon starts on `http://127.0.0.1:47821`, opens your
50
- browser, and scans your `~/.claude/projects` transcripts in the background; the dashboard
51
- appears immediately and fills in as the scan completes.
52
-
53
- More options (install from source, GitHub outcomes sync, environment variables):
54
- **[Getting started →](docs/getting-started.md)**
55
-
56
- ## Features
57
-
58
- ### Overview — verdict first, details on demand
59
-
60
- One screen answers "how bad is it this week": a spend verdict with trend, your top waste
61
- source with a copyable fix prompt, live rate-limit gauges (5-hour and 7-day), a burn forecast
62
- against your calibrated weekly limit, hot sessions, cache efficiency, and per-model
63
- context-per-turn tiles.
64
-
65
- ![Overview tab — at-a-glance verdict, rate limits, burn forecast, hot sessions](docs/assets/overview.png)
66
-
67
- ### Recommendations — waste-source detectors, ranked by impact
68
-
69
- Ten detector families watch your sessions for the patterns that actually burn tokens: cache
70
- misses (the biggest single lever), session hygiene, retry/redundant-read loops, tool-result
71
- bloat, model routing, idle background sessions, and more. Each recommendation shows modeled
72
- weekly savings, a confidence tier, and a concrete action — install a hook, copy a config
73
- snippet, or copy a guided prompt straight into Claude Code. Adopted changes flow into an
74
- **impact ledger** that tracks the measured effect, and modeled savings are never counted as
75
- achieved.
76
-
77
- ![Recommendations tab — ranked detector families with modeled savings and one-click actions](docs/assets/recommendations.png)
78
-
79
- ### Installable guardrails — local checks inside Claude Code, before the waste
80
-
81
- Five small hooks you can install from the dashboard (directly, or via a copyable prompt that
82
- Claude Code applies itself):
83
-
84
- | Guardrail | What it does |
85
- |---|---|
86
- | **Context-budget warning** | Warns when a session's context crosses your soft/hard thresholds |
87
- | **Loop guard** | Flags repeated identical tool failures before they spiral |
88
- | **Burn alert** | Catches idle sessions still burning tokens in the background |
89
- | **Pre-compaction checkpoint** | Copies the raw local transcript before an automatic compaction, subject to a local retention cap |
90
- | **Dangerous-command guard** | Asks before risky shell commands and denies a small catastrophe list |
91
-
92
- The context-budget and burn hooks warn. The loop guard warns before it denies repeated identical
93
- failures, and the dangerous-command guard can ask or deny. Direct install enables all five hooks;
94
- the copied install prompt enables the context-budget, loop, and burn hooks only. Thresholds are
95
- tunable from Settings, and direct uninstall removes every AgentWrangler hook.
96
-
97
- ### Sessions — who spent it, and on what
98
-
99
- The highest-cost sessions ranked with their output-to-context split, model, friction band
100
- (API errors, tool failures, compactions, interrupts), and a "top X% by spend" self-percentile
101
- chip. Drill into any session for a turn-by-turn timeline, its cost drivers (which detectors
102
- fired and how hard), and a guided fix prompt built only from measured numbers.
103
-
104
- ![Sessions tab — highest-cost sessions with friction bands and spend percentiles](docs/assets/sessions.png)
105
-
106
- <details>
107
- <summary>Session detail view</summary>
108
-
109
- ![Session detail — per-session KPIs, cost drivers, and a measured-context fix prompt](docs/assets/session-detail.png)
110
- </details>
111
-
112
- ### Workspaces — spend efficiency by repository
113
-
114
- Every repo you run Claude Code in, with spend share, trend, context-per-turn, cache-write
115
- share, Opus share, and $/turn. With a GitHub token configured, sessions are linked to the PRs
116
- and commits they produced — so you can see cost-per-merged-PR, not just cost.
117
-
118
- ![Workspaces tab — per-repository spend, efficiency, and outcome linkage](docs/assets/workspaces.png)
119
-
120
- <details>
121
- <summary>Workspace detail view</summary>
122
-
123
- ![Workspace detail — top sessions, context composition, and outcomes](docs/assets/workspace-detail.png)
124
- </details>
125
-
126
- ### Weekly brief — one page, three decisions
127
-
128
- The week in one screen: spend verdict, what changed vs. last week, the top actions to take —
129
- with a **Copy as Markdown** button so the whole brief drops into a standup note or a message.
19
+ Open **http://127.0.0.1:2929** if the browser does not open automatically. Keep the terminal
20
+ running; press **Ctrl+C** to stop. The first scan runs in the background. An empty history is
21
+ valid: use Claude Code, then return after ingestion. If a daemon is already running, stop it
22
+ before starting another on the same port.
130
23
 
131
- ![Briefs tab — weekly verdict, week-over-week deltas, and top actions](docs/assets/briefs.png)
24
+ [Install from source, configure scan roots, or troubleshoot](https://github.com/Doogit/AgentWrangler/blob/main/docs/getting-started.md).
132
25
 
133
- ### Honest numbers, labeled as such
26
+ ## Your first five minutes
134
27
 
135
- Every metric carries an honesty-tier chip — `EXACT`, `LIST_EQUIV`, `MODELED`, `PROXY`,
136
- `DIRECTIONAL`, `EXPERIMENTAL` — so you always know what is measured versus estimated. Dollar
137
- figures are list-price *equivalents* (subscription plans aren't billed per token; tokens drive
138
- rate limits), and the built-in glossary ("How to read this dashboard") defines every
139
- key metric in plain language. The full tour: **[Dashboard tour →](docs/dashboard-tour.md)**
28
+ 1. **Check the scan.** In Overview, read the onboarding status. A completed scan with no
29
+ recommendations is a valid result. For an unexpected empty history, inspect scan roots
30
+ and parser health in Settings; saved scan-root changes require a daemon restart.
31
+ 2. **Find one expensive session.** Select a date window, open Workspaces, choose a workspace,
32
+ then open one of its sessions. Compare context, cache writes, and output before deciding
33
+ what to change.
34
+ 3. **Inspect one recommendation.** Open Recommendations and **Show details** on an instance.
35
+ Read its evidence and caveats. A modeled amount is a projection; directional advice may
36
+ have no dollar estimate. If nothing fires, there is nothing to adopt just to finish setup.
37
+ 4. **Make one deliberate change.** A copied prompt is an artifact to review and run yourself.
38
+ It does not edit files. **Open in Claude Code** (Settings > Advanced > Experimental actions,
39
+ off by default) starts your own `claude` in a terminal; nothing is applied for you. After
40
+ completing a supported change, use **I completed the change** when offered, then **Track**
41
+ to record a baseline.
42
+ 5. **Return to the Impact ledger.** Tracking starts observation, not a savings claim. Eligible
43
+ signals use a 14-day observation window and may finish inconclusive. You can finish this
44
+ first visit without a GitHub token, calibration, or installed hooks.
140
45
 
141
- ## Privacy — local-only by design
46
+ Dollar figures are **list-price equivalents**, not your subscription bill. Modeled savings
47
+ are not achieved savings, and observed improvement does not prove the change caused it.
48
+ GitHub linkage adds outcome metadata; calibration enables the burn forecast. Local spend,
49
+ session inspection, and supported recommendation tracking work without either.
142
50
 
143
- - The daemon binds to **`127.0.0.1`** only. There is no cloud backend, telemetry, or account.
144
- - Most dashboard data is **aggregates, ids, counts, and structural anchors**. Local command text
145
- and filesystem paths can also be retained in SQLite; treat the database as sensitive. The optional
146
- direct-install PreCompact hook can separately copy full raw transcripts locally.
147
- - The optional GitHub token is read locally, never logged, never persisted to the DB.
148
- - Usage refreshes can call Anthropic with an existing Claude Code sign-in. GitHub outcomes sync
149
- calls GitHub only when a token is configured; calibration and G2 judging are separate opt-ins.
51
+ [Worked example: trim always-loaded context and inspect its effect](https://github.com/Doogit/AgentWrangler/blob/main/docs/getting-started.md#example-trim-always-loaded-context).
150
52
 
151
- Full details, including exactly what is and isn't stored: **[Privacy model →](docs/privacy.md)**
53
+ ## Dashboard preview
152
54
 
153
- ## Configuration
55
+ ![Synthetic Overview: usage limits read through Claude Code /usage, spend for the selected window, and the top recommendations](https://raw.githubusercontent.com/Doogit/AgentWrangler/main/docs/assets/overview.png)
154
56
 
155
- Everything is optional with sensible defaults — port, DB path, scan roots, GitHub token, and
156
- more are environment variables documented in [Getting started](docs/getting-started.md#configuration)
157
- and [`.env.example`](.env.example).
57
+ This static preview uses synthetic data. [The dashboard tour](https://github.com/Doogit/AgentWrangler/blob/main/docs/dashboard-tour.md)
58
+ contains the other views and an optional animated preview.
158
59
 
159
- ## Documentation
60
+ ## Pick a question
160
61
 
161
- | Page | What's in it |
62
+ | I want to... | Start here |
162
63
  |---|---|
163
- | [Getting started](docs/getting-started.md) | Install paths, optional setup, configuration, troubleshooting |
164
- | [Dashboard tour](docs/dashboard-tour.md) | Every tab in depth, plus the metric vocabulary |
165
- | [Privacy model](docs/privacy.md) | Local storage, raw-checkpoint exception, and network integrations |
166
- | [Architecture](docs/planning/AgentWrangler_Technical_Architecture_v4_5_0.md) | Daemon, ingestion, detector, and query design |
167
- | [Data model & metrics](docs/planning/AgentWrangler_Data_Model_and_Metrics_v2.md) | SQLite schema and metric definitions |
168
- | [Contributing](.github/CONTRIBUTING.md) | Dev setup, checks, PR expectations |
169
- | [Security policy](.github/SECURITY.md) | Threat model and how to report a vulnerability |
170
-
171
- ## Limitations
172
-
173
- - Reads Claude Code's JSONL transcript format; an upstream format change can require an
174
- ingestion update.
175
- - Tested on Windows; macOS/Linux are believed working — reports welcome.
176
- - Single local user by design — no multi-user or team-aggregation mode.
177
- - Outcome linkage needs a read-only GitHub token; without one the feature stays inert (and
178
- Settings says so — nothing fails silently).
179
-
180
- ## License
181
-
182
- [Apache 2.0](LICENSE) © 2026 AgentWrangler contributors.
183
- See [CONTRIBUTING.md](.github/CONTRIBUTING.md), [SECURITY.md](.github/SECURITY.md), and
184
- [CODE_OF_CONDUCT.md](.github/CODE_OF_CONDUCT.md).
64
+ | Find where my tokens went | [Workspaces and Sessions](https://github.com/Doogit/AgentWrangler/blob/main/docs/dashboard-tour.md#workspaces) |
65
+ | Turn a recommendation into a change | [Worked example](https://github.com/Doogit/AgentWrangler/blob/main/docs/getting-started.md#example-trim-always-loaded-context) |
66
+ | Understand the dollars and verdicts | [Metric vocabulary](https://github.com/Doogit/AgentWrangler/blob/main/docs/dashboard-tour.md#glossary-how-to-read-this-dashboard) |
67
+ | Fix an empty dashboard | [First launch](https://github.com/Doogit/AgentWrangler/blob/main/docs/getting-started.md#first-launch) |
68
+ | Connect GitHub or calibrate limits | [Optional setup](https://github.com/Doogit/AgentWrangler/blob/main/docs/getting-started.md#optional-setup) |
69
+ | Grade my Claude Code setup | [Rate my setup](https://github.com/Doogit/AgentWrangler/blob/main/docs/dashboard-tour.md#rate-my-setup): a score and tier against a cited rubric, what the next tier needs, and an optional AI review |
70
+
71
+ ## Installable guardrails — local checks inside Claude Code, before the waste
72
+
73
+ Hooks are optional and require an explicit install. Settings **Install directly** installs
74
+ five hooks; **Copy install prompt** prepares instructions for three. Copying alone installs nothing.
75
+
76
+ | Hook | Behavior | Install path |
77
+ |---|---|---|
78
+ | Context-budget | Warns when context crosses configured thresholds | Direct or copied prompt |
79
+ | Loop guard | Warns, then can deny repeated identical failures | Direct or copied prompt |
80
+ | Burn alert | Warns about session budget consumption | Direct or copied prompt |
81
+ | Dangerous-command | Can ask or deny risky commands | Direct only |
82
+ | PreCompact checkpoint | Copies raw transcripts locally, with retention limits | Direct only |
83
+
84
+ [Installation, removal, and the checkpoint privacy details](https://github.com/Doogit/AgentWrangler/blob/main/docs/getting-started.md#in-session-guardrails).
85
+
86
+ ## Usage limits — read from Claude Code
87
+
88
+ By default AgentWrangler runs your own `claude -p /usage` in the background, only while the
89
+ dashboard is open: at most every 5 minutes when you have been active, hourly when idle, and not
90
+ while the statusline reading is fresh. It runs your own `claude` CLI and never reads your Claude
91
+ login. It stores only percentages, reset times and model labels in
92
+ `~/.agentwrangler/usage-cli.json`. Turn it off with the Settings checkbox **Read usage via Claude
93
+ Code /usage** or `AW_USAGE_CLI=off`.
94
+
95
+ The Claude Code statusline is the optional alternative: it updates on every turn and makes no
96
+ background calls. Settings **Install statusline** points Claude Code's `statusLine` at
97
+ `agentwrangler statusline`, after showing the exact before/after of `~/.claude/settings.json` and
98
+ saving a timestamped backup. It prints a one-line status (model, repo, branch, context, 5h/7d
99
+ limits, session cost) and saves only the two limit percentages and reset times to
100
+ `~/.agentwrangler/statusline-limits.json`. An existing statusline keeps running and displaying
101
+ (`--wrap "<your command>"`); Uninstall restores it. The 5-hour and weekly figures come from
102
+ whichever reading is newer; per-model weekly rows come only from `/usage`.
103
+
104
+ ## Privacy and limits
105
+
106
+ - The daemon binds to **127.0.0.1**. There is no telemetry or hosted product backend. By default
107
+ the only outbound call is your own `claude` CLI's `/usage` call for Usage limits; GitHub sync,
108
+ Judge me and calibration are opt-in.
109
+ - SQLite holds token counts and structural data, filesystem paths, and some transcript
110
+ content: the shell command text of tool calls and short error excerpts from failed tool
111
+ results, after a best-effort secrets filter. Recommendation cards also read the calls behind
112
+ a finding back from your transcripts to show what ran. All of it stays on your machine.
113
+ Treat the database and any backups as sensitive. The optional PreCompact hook makes separate
114
+ raw transcript copies on your machine.
115
+ - Rate my setup's optional **Judge me** review sends a redacted summary of your setup to Claude
116
+ through your own `claude` CLI, only after you approve the exact payload. GitHub outcomes sync
117
+ requires a configured token. [Privacy details](https://github.com/Doogit/AgentWrangler/blob/main/docs/privacy.md).
118
+ - Claude Code format changes can require parser updates. This is a single-user tool.
119
+ - Windows local validation and Linux/macOS CI smoke coverage do not establish full native
120
+ accessibility or credential-store compatibility on every platform. The macOS Keychain and
121
+ Terminal.app Automation prompts have not been tested on a real Mac in 0.2.0.
122
+
123
+ ## How it works
124
+
125
+ ![How data moves through AgentWrangler: logs are read and priced, detectors find waste, and the dashboard serves recommendations](https://raw.githubusercontent.com/Doogit/AgentWrangler/main/docs/assets/how-it-works.png)
126
+
127
+ AgentWrangler is one local Node process. It tails Claude Code's log files (new lines every 2 s,
128
+ new files every 30 s), stores what it needs in SQLite at `~/.agentwrangler/db.sqlite`, and runs
129
+ detectors over the data to build recommendations. Long passes run in worker threads so the
130
+ dashboard stays responsive. The browser UI talks to the daemon at `127.0.0.1:2929`. There is no
131
+ separate service or scheduled task: stop the daemon and its background work stops.
132
+
133
+ [Background jobs, ingest, storage, detectors, API, and the privacy boundary](https://github.com/Doogit/AgentWrangler/blob/main/docs/how-it-works.md).
134
+
135
+ ## Deeper documentation
136
+
137
+ [What's new](https://github.com/Doogit/AgentWrangler/blob/main/CHANGELOG.md) |
138
+ [In-app Help guide](https://github.com/Doogit/AgentWrangler/blob/main/docs/help/guide.md) |
139
+ [Configuration](https://github.com/Doogit/AgentWrangler/blob/main/docs/getting-started.md#configuration) |
140
+ [Architecture](https://github.com/Doogit/AgentWrangler/blob/main/docs/how-it-works.md) |
141
+ [Data model and metrics](https://github.com/Doogit/AgentWrangler/blob/main/docs/planning/AgentWrangler_Data_Model_and_Metrics_v2.md) |
142
+ [Contributing](https://github.com/Doogit/AgentWrangler/blob/main/.github/CONTRIBUTING.md) |
143
+ [Security policy](https://github.com/Doogit/AgentWrangler/blob/main/.github/SECURITY.md)
144
+
145
+ [Apache 2.0](https://github.com/Doogit/AgentWrangler/blob/main/LICENSE).