Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
Filter by Categories
About Article
Analyze Data
Archive
Best Practices
Better Outputs
Blog
Code Optimization
Code Quality
Command Line
Course
Daily tips
Dashboard
Data Analysis & Manipulation
Data Engineer
Data Visualization
DataFrame
Delta Lake
DevOps
DuckDB
Environment Management
Feature Engineer
Git
Jupyter Notebook
LLM
LLM Tools
Machine Learning
Machine Learning & AI
Machine Learning Tools
Manage Data
MLOps
Natural Language Processing
Newsletter Archive
NumPy
Pandas
Polars
PySpark
Python Helpers
Python Tips
Python Utilities
Scrape Data
SQL
Testing
Time Series
Tools
Visualization
Visualization & Reporting
Workflow & Automation
Workflow Automation

Newsletter #314: Claude Code – Move Session Context Across Folders with /export

Newsletter #314: Claude Code – Move Session Context Across Folders with /export

Grab your coffee. Here are this week’s highlights.


📅 Today’s Picks

Python contextlib – Reuse Context Managers as Function Decorators

Code example: Python contextlib - Reuse Context Managers as Function Decorators

Problem

Many developers know @contextmanager as a convenient way to add setup and teardown logic around a with block.

But fewer realize it can also be used as a function decorator.

A common pattern for timing or logging functions is to write a separate decorator using functools.wraps. But this means maintaining two versions of the same logic, which can drift over time.

Solution

Since Python 3.3, any function decorated with @contextmanager can be used both ways:

  • Need to time a code block? with duration("..."):
  • Need to time a whole function? @duration("...")

Claude Code – Move Session Context Across Folders with /export

Code example: Claude Code - Move Session Context Across Folders with /export

Problem

Each Claude session lives in the folder where it was started. When you open Claude somewhere else, the previous context does not carry over.

You could ask Claude to summarize the old session and paste it into the new one, but summaries can miss important details, decisions, or tool outputs.

Solution

Claude Code‘s /export command gives you the full conversation as a plain text file, including tool calls.

How to use it:

  • Run /export filename.md in the original folder before switching
  • Open a new Claude session in the other folder
  • Ask Claude to read filename.md and continue the task

Stay Current with CodeCut

Actionable Python tips, curated for busy data pros. Skim in under 2 minutes, three times a week.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top

Work with Khuyen Tran

Work with Khuyen Tran