@@ -7,7 +7,7 @@ Crumbs are development-only. They get stripped before merge and cost nothing whe
77```
88Service A ──┐ ┌── $ agentcrumbs tail
99Service B ──┤── fetch() ──> Collector :8374 ──┤── $ agentcrumbs query --since 5m
10- Service C ──┘ (fire & forget) └── ~/.agentcrumbs/crumbs.jsonl
10+ Service C ──┘ (fire & forget) └── ~/.agentcrumbs/<app>/ crumbs.jsonl
1111```
1212
1313## Getting started
@@ -54,14 +54,16 @@ When something goes wrong, the agent starts the collector and queries the trail:
5454``` bash
5555agentcrumbs collect --quiet &
5656AGENTCRUMBS=1 node app.js
57- agentcrumbs query --since 5m --ns auth-service
57+ agentcrumbs query --since 5m
5858```
5959
6060```
6161auth-service login attempt +0ms { tokenPrefix: "eyJhbGci" }
6262auth-service token decode ok +3ms { userId: "u_8f3k" }
6363auth-service permissions check +8ms { roles: [] }
6464auth-service rejected: no roles +8ms { status: 401 }
65+
66+ 4 crumbs.
6567```
6668
6769Now the agent knows: the token is valid, but the user has no roles. The fix is in role assignment, not token validation.
@@ -114,8 +116,11 @@ Everything is controlled by a single `AGENTCRUMBS` environment variable.
114116| ` auth-*,api-* ` | Multiple patterns (comma or space separated) |
115117| ` * -internal-* ` | Match all except excluded patterns |
116118| ` {"ns":"*","port":9999} ` | JSON config with full control |
119+ | ` {"app":"my-app","ns":"*"} ` | Explicit app name |
120+
121+ JSON config fields: ` app ` (app name, default auto-detect from package.json), ` ns ` (namespace filter, required), ` port ` (collector port, default 8374), ` format ` (` "pretty" ` or ` "json" ` , default ` "pretty" ` ).
117122
118- JSON config fields: ` ns ` (namespace filter, required), ` port ` (collector port, default 8374), ` format ` ( ` "pretty" ` or ` "json" ` , default ` "pretty" ` ) .
123+ You can also set ` AGENTCRUMBS_APP ` to override the app name independently .
119124
120125## CLI
121126
@@ -127,24 +132,27 @@ agentcrumbs collect --quiet & # Start in background
127132agentcrumbs collect --port 9999 # Custom port
128133
129134# Live tail
130- agentcrumbs tail # All namespaces
135+ agentcrumbs tail # All namespaces (scoped to current app)
131136agentcrumbs tail --ns auth-service # Filter by namespace
132- agentcrumbs tail --tag perf # Filter by tag
137+ agentcrumbs tail --app my-app # Tail a specific app
138+ agentcrumbs tail --all-apps # Tail all apps
133139
134- # Query
135- agentcrumbs query --since 5m # Last 5 minutes
136- agentcrumbs query --ns auth-service --since 1h
137- agentcrumbs query --tag root-cause
138- agentcrumbs query --json --limit 50
140+ # Query (paginated, 50 per page)
141+ agentcrumbs query --since 5m # Last 5 minutes
142+ agentcrumbs query --since 5m --cursor a1b2c3d4 # Next page
143+ agentcrumbs query --since 1h --limit 25 # Smaller pages
144+ agentcrumbs query --session a1b2c3 # Filter by session
145+ agentcrumbs query --tag root-cause # Filter by tag
139146
140147# Strip
141148agentcrumbs strip --dry-run # Preview removals
142149agentcrumbs strip # Remove all crumb code
143150agentcrumbs strip --check # CI gate (exits 1 if markers found)
144151
145152# Utilities
146- agentcrumbs stats # Crumb counts, file size
147- agentcrumbs clear # Delete stored crumbs
153+ agentcrumbs stats # Crumb counts (current app)
154+ agentcrumbs stats --all-apps # Stats for all apps
155+ agentcrumbs clear # Clear crumbs (current app)
148156```
149157
150158Time units: ` s ` (seconds), ` m ` (minutes), ` h ` (hours), ` d ` (days).
@@ -160,7 +168,7 @@ The collector is language-agnostic. Any language with HTTP support can send crum
160168``` bash
161169curl -X POST http://localhost:8374/crumb \
162170 -H " Content-Type: application/json" \
163- -d ' {"ts":"2026-01-01T00:00:00Z","ns":"shell","msg":"hello","type":"crumb","dt":0,"pid":1}'
171+ -d ' {"app":"my-app"," ts":"2026-01-01T00:00:00Z","ns":"shell","msg":"hello","type":"crumb","dt":0,"pid":1}'
164172```
165173
166174## Runtime compatibility
0 commit comments