Guidance for Claude Code working in this repository.
The canonical agent guide is AGENTS.md. Read it first. It covers the rules, conventions, gotchas, and workflow for this repo and is shared across all AI coding tools (Claude Code, Cursor, etc.).
These are the highest-impact rules from AGENTS.md — re-stated here because mistakes are costly:
- This repo is public. Never commit customer data, real account IDs, real emails, real IPs, secrets, or internal Panther customer context. Redact all sample logs in unit tests.
- All PRs target the
developbranch, notmain. When usinggh pr create, pass--base developexplicitly. - Detections are dual-file. Every
.pyhas a matching.yml(with the same basename). Always commit them together. The YAMLFilename:must exactly match the.pyfilename. - Use safe field access in detection code:
event.get("field", "")andevent.deep_get("a", "b", default=""). Never useevent["field"].deep_getis a method onevent— do not import it frompanther_base_helpers. - Always include positive AND negative unit tests in the YAML
Tests:block, with redacted sample logs. - Run the trio before pushing:
make fmt && make lint && make test. Don't disable lints or skip hooks to make CI green — fix the underlying issue. - Test scoping: when iterating on a single rule, use
pipenv run panther_analysis_tool test --path <dir>or--filter RuleID=<id>rather than running the full suite. - Correlation rules require
pat validateagainst a live Panther instance —pat testis not sufficient. Seestyle_guides/CORRELATION_RULES_STYLE_GUIDE.md.
make install # setup
make fmt && make lint && make test # before pushing
pipenv run panther_analysis_tool test --path rules/<dir>/ # scoped test
pipenv run panther_analysis_tool test --filter RuleID=<RuleID> # one rule
pipenv run panther_analysis_tool validate --api-token ... --api-host # correlation rulesFor everything else — directory layout, metadata fields, MITRE format, naming conventions, alert_context reuse, deprecation flow, PR process, common gotchas — see AGENTS.md and the style_guides/ directory.