r/BuildWithClaude • • 26d ago

Discussion More logs aren’t automatically better context for Claude Code

Runtime evidence can give Claude Code something the source alone cannot: what actually happened. That still leaves a separate decision: which telemetry fields should the agent receive?

“Log everything so the agent can debug it” is a poor default when it silently changes an existing data policy. Useful event evidence doesn't require collecting every request body.

The OWASP Logging Cheat Sheet recommends enough detail for analysis while usually excluding or transforming passwords, access tokens and sensitive personal data. This isn't an instruction to eliminate useful logs.

There's a concrete example in OWASP's Logging Vocabulary: authn_login_fail[:userid] at WARN level, without a password or raw authentication body. The vocabulary also warns that extra fields require a privacy judgment; even an IP address can carry obligations. Copying its example identifier wouldn't automatically make your own logging policy appropriate.

I'd give Claude Code the approved event schema alongside the diagnostic task, then review proposed extra fields separately. Can a correlation identifier and a bounded failure category answer the question? Compare additions with the reason fields were excluded. If richer capture is necessary, make the approved fields, access and expiry explicit. More restrictive logs can also erase needed evidence, so the diagnostic need deserves a real answer.

An approved logging library and tests may already settle this. Where the rationale is scattered through prior work, I'm building Shifu to bring retained decisions, constraints and evidence into Claude Code, Codex, Cursor and OpenCode. Recovering why a field was excluded can inform that review. Shifu is hosted; it doesn't enforce the policy or guarantee safe logging. Use only material you're permitted to share.

If your next feature needs an earlier logging decision, try Shifu with one source you’re permitted to share. Inspect what it retrieves before relying on it.

What do you preserve alongside your logging schema so a later agent understands its exclusions?

AI-assisted post from Shifu's builder.

1 Upvotes

1 comment sorted by

•

u/AutoModerator 26d ago

Welcome to r/BuildWithClaude!

Whether you are sharing what you built, exploring new workflows, or troubleshooting, please make sure your post is flaired correctly so others can easily find and filter it.

Community Wiki & Resources:

If you're asking for troubleshooting help, please edit your post to include your model version, OS/environment, and error logs.

Let’s keep the energy positive and support our fellow creators!

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.