# PostHog AI Product Analyst That Ships Fixes

Give a Replicas cloud coding agent access to PostHog and your repository. It can investigate product behavior, trace the relevant code, make a change, run checks, and return a reviewable pull request or technical report.

- Canonical: https://replicas.dev/use-cases/posthog-ai-product-engineer
- Start a workspace: https://replicas.dev/auth?mode=signup
- PostHog setup: https://docs.replicas.dev/features/plugins

## What is a PostHog AI product analyst?

A PostHog AI product analyst is a cloud coding agent that uses product analytics as engineering context. It can inspect PostHog projects, events, insights, dashboards, feature flags, and recordings, then connect that evidence to the repository where the product behavior is implemented.

Replicas remains a coding agent throughout the workflow. The goal is not another dashboard summary. The goal is a verified code change, a pull request, or a technical investigation that tells an engineer exactly what to do next.

## From product signal to reviewable software work

Product analytics explains what users did. The codebase explains why the product behaved that way. A coding agent can work across both sides of that boundary.

- **Start with a product question:** Ask why a funnel step dropped, where users get stuck, whether an experiment changed behavior, or which feature path needs investigation.
- **Inspect PostHog evidence:** The agent queries the connected PostHog account for the relevant events, insights, dashboards, flags, or recordings available to it.
- **Trace behavior into code:** Replicas searches the repository for the routes, components, handlers, analytics events, and feature-flag logic behind the signal.
- **Change and verify:** When the evidence supports a fix, the agent edits the code, runs the relevant checks, and returns a pull request. Otherwise it returns a technical report with its evidence and next steps.

## What can a PostHog coding agent work on?

The best tasks begin with a specific product signal and end with an engineering output that a human can review.

- **Conversion drops:** Investigate a funnel step that fell and identify the responsible product flow and code path.
- **Rage clicks and dead ends:** Trace repeated clicks or abandoned sessions to a confusing or broken interface.
- **Experiment cleanup:** Compare results, inspect the feature-flag implementation, and prepare the winning cleanup change.
- **Instrumentation gaps:** Audit missing or inconsistent analytics events and fix the instrumentation in the repository.
- **Post-deploy regressions:** Explain an unexpected behavior change after a deployment and prepare a targeted fix.
- **Inconclusive evidence:** Return a technical report instead of a change when the evidence does not justify touching code yet.

## FAQ

### What can a Replicas agent investigate in PostHog?
With the PostHog plugin installed, an agent can inspect projects, events, insights, dashboards, feature flags, and session recordings available to the connected account.

### How does the agent connect a product signal to the code?
It uses the PostHog evidence to narrow the affected flow, then searches the repository for the routes, components, handlers, analytics events, and feature flags responsible for that behavior.

### When will the agent open a pull request?
When the evidence points to a specific code path and the agent can verify a safe change, it can return a reviewable pull request. If causality is unclear, it returns a technical investigation instead of guessing.

### What access does the agent need?
Connect a PostHog account with access to the relevant project and give the Replicas workspace access to the repository. The agent can only use the PostHog data and code allowed by those connections.

### Can the agent change production automatically?
No. The agent works in an isolated cloud workspace and returns code or findings for review. Your team still decides what to merge and deploy.

## Related docs

- [How to use PostHog with Replicas](https://replicas.dev/blog/how-to-use-posthog-with-replicas): Follow the recommended setup, task format, and review process for PostHog investigations.
- [Automated bug fixes](https://replicas.dev/use-cases/automated-bug-fixes): Learn how Replicas investigates failures and returns fixes or debugging handoffs.
- [Plugins docs](https://docs.replicas.dev/features/plugins): Connect PostHog and control which account a Replicas workspace can use.
