Skip to main content

Module 9: Security and Safe Use

Chapter 31: Set Up Claude Code Audit Logging

In this chapter, you'll learn how to log every Claude Code action for compliance, integrate session logs into your audit pipeline, and produce the documentation SOC 2 and ISO 27001 auditors actually ask for.

In the previous chapter, we created the sysadmin's safety checklist that prevents Claude Code from making changes outside its defined boundaries.

Now we are moving on to Chapter 31, which focuses on the other side of security controls: maintaining an audit trail that shows what Claude Code did, when it did it, and how those actions can be reviewed later.

Until this point, we have focused mainly on preventing unwanted actions, but production environments also require a way to verify that approved actions happened as expected.

By the end of this chapter, you will understand what Claude Code records by default, learn how to organize those records into an audit trail, integrate them with existing logging and review processes, and prepare the evidence required for compliance assessments.

Before You Start

Before looking at the audit logs, verify that your current user session has the required permissions available.

Updated on Jul 27, 2026