---
title: "Keep Claude in the project working directory | Ian Nuttall"
description: "Set environment variable to maintain project directory"
canonical: "https://ian.is/post/claude-working-directory"
language: "en"
---

# Keep Claude in the project working directory

Jun 2025 / 108,373 views / [via X](https://x.com/iannuttall/status/1939797229117608232)

Claude Code pro tip:

add this line to your .zshrc or .bashrc (ask CC to do it for you) to stop Claude getting confused about which directory it should be running commands in

```
CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR=1
```

![Image from the original X post](https://ian.is/media/tweets/1939797229117608232/1939797229117608232/6e641c65b2446c58934962435e5e0ce94a03a293af1ea863d609c61e14605eb3.jpg)

## Ian's List

Join 15k\+ subscribers
