Quick Tips: Claude Code - Move Session Context Across Folders with /export
Plus reuse Python contextlib as decorators
Grab your coffee. Here are this week’s highlights.
📅 Today’s Picks
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
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.mdin the original folder before switchingOpen a new Claude session in the other folder
Ask Claude to read filename.md and continue the task
💬 Rate Your Experience
How would you rate your newsletter experience? Share your feedback →
🔍 Explore More on CodeCut
Tool Selector - Discover 70+ Python tools for AI and data science
Production Ready Data Science - A practical book for taking projects from prototype to production


