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 PostHog/posthog-foss --skill adding-activity-logginggit clone --depth 1 https://github.com/PostHog/posthog-fossWrote 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/posthog/posthog-foss/adding-activity-logging)<a href="https://agentmods.dev/skills/posthog/posthog-foss/adding-activity-logging"><img src="https://agentmods.dev/badge/skills/posthog/posthog-foss/adding-activity-logging/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/posthog/posthog-foss/adding-activity-logging"><img src="https://agentmods.dev/badge/skills/posthog/posthog-foss/adding-activity-logging.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
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.00153 | $0.01761 |
| Opus 5.5 | $0.00061 | $0.00704 |
| Sonnet 5.5 | $0.00031 | $0.00352 |
| Haiku 4.5 | $0.00015 | $0.00176 |
Grade A, and why
adding-activity-logging 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.
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.
Adding activity logging
Read docs/internal/activity-logging.md first. It carries the pipeline, the file locations, and the reasons. This skill carries the workflow and the gates.
Reference implementation: products/feature_flags/backend/activity_logging.py with its apps.py.
Separate-database reference: products/stamphog/backend/activity_logging.py.
Step 1 - Find every write path before you touch the model
The mixin hooks save() and delete().
It does not see QuerySet.update(), bulk_create(), bulk_update(), or raw SQL.
A receiver that logs only the API path gives an audit trail that says nobody changed a row a webhook changed.
rg -n "Thing\.objects|Thing\.all_teams" products/<name>/ --type py | rg -v "tests/"
rg -n "\.update\(|bulk_create\(|bulk_update\(" products/<name>/backend --type py
Write the list down: which paths call save() (the mixin covers them) and which do bulk writes (you log those by hand in step 5).
Include tasks, Temporal activities, webhook handlers, and management commands.
Step 2 - Model and scope
- Add
ModelActivityMixinfirst in the bases:class Thing(ModelActivityMixin, TeamScopedRootMixin, ...). - Set
activity_logging_on_delete = Trueonly when a hard delete must show in the log. - Add the class name to
ActivityScopeinposthog/models/activity_logging/activity_log.py. - Add the same string to the
ActivityScopeenum infrontend/src/types.ts. - Run
hogli build:openapi(needs the dev stack) because the APIscopefilter enum is generated from the Literal.
No migration is needed. The mixin adds no field.
Step 3 - Receiver module
Create products/<name>/backend/activity_logging.py.
One @mutable_receiver(model_activity_signal, sender=Thing) per model.
The receiver calls changes_between and log_activity; nothing else.
Keep the module import-light.
It must not import a viewset, a serializer, or a query runner.
ready() imports it at django.setup() in every process.
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 Changed 68349e3f4155
- 3d ago Changed · -1 lines 45e6cc0a9482
- 10d ago Changed · -2 lines fd45177dbce8
- 15d ago Changed · +21 lines f7e738c13e26
- 3mo ago First seen · 117 lines · 153 tokens per session scan A 5233c4312671
adding-activity-logging is a skill published in the GitHub repository PostHog/posthog-foss (736 stars, last pushed today), licensed MIT. It adds 153 tokens to every session and 1,761 once invoked, about $0.0006 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-09-03.
adding-activity-logging compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| adding-activity-loggingPostHog/posthog-foss | Skill | 736 | today | MIT | A | 153 | Claude Code, Codex |
| event-store-designwshobson/agents | Skill | 43k | yesterday | MIT | A | 33 | Claude Code |
| durable-objectsfcakyon/claude-codex-settings | Skill | 1.2k | yesterday | Apache-2.0 | A | 22 | Claude Code |
| platform-custom-field-generateforcedotcom/sf-skills | Skill | 1.2k | 6d ago | Apache-2.0 | A | 139 | Claude Code |
| field-service-sobject-create-configureforcedotcom/sf-skills | Skill | 1.2k | 6d ago | Apache-2.0 | A | 74 | Claude Code |
| nornicdb-grpcorneryd/NornicDB | Skill | 936 | today | MIT | A | 98 | Claude Code, Codex |
| firebaseericrisco/rsc-harness | Skill | 707 | yesterday | MIT | A | 77 | Claude Code, Codex |