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 skills add sorah/config --skill rails-canonical-log-linegit clone --depth 1 https://github.com/sorah/configWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/sorah/config/rails-canonical-log-line)<a href="https://agentmods.dev/skills/sorah/config/rails-canonical-log-line"><img src="https://agentmods.dev/badge/skills/sorah/config/rails-canonical-log-line/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/sorah/config/rails-canonical-log-line"><img src="https://agentmods.dev/badge/skills/sorah/config/rails-canonical-log-line.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What 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.1 | $0.00230 | $0.02617 |
| Opus 5.5 | $0.00092 | $0.01047 |
| Sonnet 5.5 | $0.00046 | $0.00523 |
| Haiku 4.5 | $0.00023 | $0.00262 |
Grade A, and why
rails-canonical-log-line 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 24d 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.
How it starts
The opening of the file, as written. The whole thing — 135 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Canonical Log Lines on Rails
One line per request that says who made it, what handled it, how it ended and what work it did, after Stripe's canonical log lines. In a Rails app on rails_semantic_logger, that line already exists: the ActionController Completed line. The work is making it carry the request's context, not adding another line. Taken from a production rollout on Rails 8.1, rails_semantic_logger 4.19 and semantic_logger 4.17. Project-specific conventions (CLAUDE.md, docs/) always take priority.
Why the Completed line loses context
Completedis logged by aprocess_action.action_controllersubscriber whenActionController::Instrumentation#process_actionfinishes, outside the callback chain. Anaround_action { logger.tagged(user_id: ...) { yield } }has already unwound by then. Lines logged inside the action carry the tags,Completeddoes not.- A Rack middleware's
SemanticLogger.taggedblock does wrapCompleted, but it runs before routing and authentication, so it can tag only what the raw request carries. - An error handled by
rescue_fromnever reachespayload[:exception], so a 4xx line has no reason. rails_semantic_logger deletes:exceptionfrom the payload of an unhandled one. - rails_semantic_logger logs
Completedatinfowhatever the status, and the RackStartedline atinfotoo. Every request writes two lines and a 500 looks like a 200.
The pieces
| Piece | Purpose | Reference |
|---|---|---|
RequestLogContext (ActiveSupport::CurrentAttributes) |
Request-scoped tags and counters | app/models/request_log_context.rb |
SemanticLogger.on_log hook |
Merges the context's tags into every line as it is written | config/initializers/semantic_logger.rb |
RequestLogTagger middleware |
Tags from the raw request: request_id, trace ids |
same initializer |
HandlerLogTaggable concern |
handler tag, set before any other callback |
app/controllers/concerns/handler_log_taggable.rb |
ActionLogPayloadable concern |
Outcome fields and counters on the Completed payload |
app/controllers/concerns/action_log_payloadable.rb |
MyApp::ActionControllerLogSubscriber |
Level by status, status and handler in the message | lib/my_app/action_controller_log_subscriber.rb |
What ships with it
9 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
- references/app/controllers/concerns/action_log_payloadable.rb 925 B runs code
- references/app/controllers/concerns/handler_log_taggable.rb 452 B runs code
- references/app/models/request_log_context.rb 1.5 KB runs code
- references/config/initializers/semantic_logger.rb 1.2 KB runs code
- references/lib/my_app/action_controller_log_subscriber.rb 1.1 KB runs code
- references/spec/controllers/concerns/action_log_payloadable_spec.rb 1.4 KB runs code
- references/spec/controllers/concerns/handler_log_taggable_spec.rb 958 B runs code
- references/spec/lib/my_app/action_controller_log_subscriber_spec.rb 1.5 KB runs code
- references/spec/models/request_log_context_spec.rb 2.3 KB runs code
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.
- 24d ago First seen · 135 lines · 230 tokens per session scan A 20092ee86d3b
rails-canonical-log-line is a skill published in the GitHub repository sorah/config (31 stars, last pushed 11d ago), licensed MIT. It adds 230 tokens to every session and 2,617 once invoked, about $0.0009 per session on Opus 5.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-11-08.
rails-canonical-log-line compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| rails-canonical-log-linesorah/config | Skill | 31 | 11d ago | MIT | A | 230 | Claude Code |
| systematic-debuggingopen-metadata/OpenMetadata | Skill | 16k | today | Apache-2.0 | A | 37 | Claude Code |
| log-error-digestzebbern/claude-code-guide | Skill | 4.7k | today | MIT | A | 71 | Claude Code, Codex |
| observability-audit-sessionsIBM/mcp-context-forge | Skill | 4.9k | today | Apache-2.0 | A | 64 | Claude Code, Codex |
| cwv-optimizeradobe/skills | Skill | 342 | today | Apache-2.0 | A | 112 | Claude Code |
| ci-fixersipyourdrink-ltd/bernstein | Skill | 1.2k | today | Apache-2.0 | A | 15 | Claude Code, Codex |
| verus-query-timinglbx154/Argus | Skill | 337 | yesterday | MIT | A | 28 | Claude Code, Codex |