HOW-TO GUIDE

How to find and purge API keys Claude Code and Codex saved on your laptop

Based on a guide by The Weekly Stack on DEV Community · Nov 30, 2026

You'll end with: A laptop where any keys your coding agents saved in transcripts and history files are found, rotated, purged, and kept for 7 days at most.

Why it's worth having: Claude Code keeps plain-text session transcripts for 30 days by default, so a .env file a tool read or a key a command printed sits on your disk.

At a glance

WHO IT'S FOR
IT and OT engineers and developers who run Claude Code or Codex on their own machines.
LEVEL
Beginner
COST
Free. The cleanup uses grep and two settings files, with no new tools.
YOU NEED
Claude Code or Codex · A Mac or Linux terminal · Access to your API provider dashboards

The method, in short

  1. 1Search ~/.claude/projects, ~/.claude/history.jsonl, and ~/.codex/history.jsonl for anything shaped like a key or a secret.
  2. 2Revoke and reissue any real key in the provider's dashboard before deleting files, since a backup can already hold a copy.
  3. 3Preview claude purge with --dry-run, run it to remove a project's transcripts, and delete or trim the Codex history file.
  4. 4Set cleanupPeriodDays to 7, deny Read on .env files, and set Codex history persistence to none.

The post has the search pattern, the exact settings for both agents, and a no-history mode for scripted runs.

More from The Feed

HOW-TO GUIDE

How to move a 120-check Grok Bot routine to a script and review on Friday

You'll end with: A tracker where a script collects four daily counts for a private dashboard, and Grok Bot writes one summary each Friday.

WHO IT'S FOR
Operations leads and analysts who run recurring reports and checks through bots.
LEVEL
Intermediate
COST
Free to read. The method runs in Grok Bot on your own plan.
YOU NEED
Grok Bot · A recurring check with exact rules · A dashboard or sheet for the results

Based on a post by Pasdawan (@sboudis) on X · Nov 29, 2026

HOW-TO GUIDE

How to make a 20-year-old company AI-native in seven steps

You'll end with: A company where staff use coding agents daily, SOPs are checked by hand, the ERP stays untouched, and one workflow is live with a date.

WHO IT'S FOR
Owners, general managers, and operations leads at established plants, shops, and service firms.
LEVEL
Beginner
COST
Free to read. Claude Code or Codex seats and certification courses are paid plans.
YOU NEED
Claude Code or Codex · A hand-written SOP library · One workflow with an owner and a date

Based on a post by Mark Ajzenstadt (@mardehaym) on X · Nov 29, 2026

HOW-TO GUIDE

How to track every Grok Bot and shared skill on one Page refreshed daily

You'll end with: One private Page, refreshed by a 7 AM routine, that lists each Grok Bot's job, routines, health score, chat size, and usage, plus the skills library.

WHO IT'S FOR
Operations leads and admins who run several Grok Bots and shared skills.
LEVEL
Beginner
COST
Free to read. The method runs in Grok Bot on your own plan.
YOU NEED
Grok Bot · A private Page · A daily routine · A health check for each bot

Based on a post by Carolina Dill (@CarolinaDill) on X · Nov 28, 2026