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

[Ian Nuttall](https://ian.is/)

# Keep Claude in the project working directory

June 30, 2025

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

```text
CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR=1
```

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

## Newsletter

Join 9.2k subscribers
