Imagine you have a brilliant coworker. Solves complex problems, writes clean code, understands what you ask on the first try. But every morning, when you tell them “open the course project,” they look at you with a poker face and ask: “What course? Where is it?”

Every day. Without exception.

It’s exactly like living with Leonard Shelby, the protagonist of Memento. The guy who can’t form new memories and has to tattoo important things on his body to remember them.

I work with Claude Code on four or five different projects daily. And for weeks, every time I said “let’s go to the course project” or “open the blog,” the thing would start doing find / -name "p101" like a Victorian explorer searching for the source of the Nile. Five minutes scanning the hard drive to find a directory I use every day.

It drove me up the wall.

The problem: digital anterograde amnesia

Your AI agent starts each session with a blank slate. Doesn’t know where you live. Doesn’t know what projects you have. Doesn’t know that ~/courses/p101/program exists, that your blog is at ~/code/frr.dev, or that the Ansible repo is called wuwei and lives at ~/code/wuwei/ansible.

Each new session, back to square one. Like Leonard waking up in that motel room.

The first natural reaction is to tell it the path. Every time. Manually. “It’s at /Users/fernando/code/tokamak.” And it works, but it’s like having to introduce yourself to your desk neighbor every morning. By the third week you wonder if it wouldn’t be easier to work alone.

The real-world solution: zoxide

Before tattooing anything, let’s talk about the tool that solves this problem for humans.

zoxide is a cd with memory. A replacement for the cd command that remembers which directories you’ve visited and takes you to the most likely one with a partial pattern.

# Instead of this:
cd /Users/fernando/courses/p101/program

# You write this:
z p101

That’s it. zoxide knows that when you say “p101,” you want to go to /Users/fernando/courses/p101/program, because that’s where you’ve gone the last 47 times you’ve typed something similar.

It works with frecency — an algorithm that combines frequency and recency. Directories you visit often and have visited recently rise to the top. Ones you haven’t touched in months drop down. Like TikTok’s algorithm, but for your filesystem.

Installing is trivial

brew install zoxide

# Add to your shell (Fish in my case):
# in ~/.config/fish/config.fish
zoxide init fish | source

From then on, every cd you do feeds zoxide’s database. And z <pattern> takes you where you want without thinking.

z tokamak    # → /Users/fernando/code/tokamak
z blog       # → /Users/fernando/code/frr.dev
z wuwei      # → /Users/fernando/code/wuwei/ansible
z p101       # → /Users/fernando/courses/p101/program

If there’s ever ambiguity (two directories that could match), zi opens an interactive selector with fzf.

zoxide for your agent: zoxide query

Here’s the good part. zoxide has a query command that doesn’t change directories, it just returns the most likely path:

zoxide query p101
# → /Users/fernando/courses/p101/program

This is gold for an AI agent. Instead of running find across the entire disk, a single call to zoxide query gives it the correct path in milliseconds. Zero exploration. Zero guessing.

The problem is your agent doesn’t know it exists. That’s where the tattoos come in.

The tattoo: CLAUDE.md

Memento has a legendary scene where Leonard looks in the mirror and reads what he’s tattooed: facts. Instructions. Things he can’t afford to forget.

Claude Code has its equivalent: the CLAUDE.md file. It’s a plain text file that loads automatically at the start of each session. Everything you write there, Claude “remembers” — though technically it doesn’t remember anything, it just reads it every time it starts.

It’s the difference between real memory and a tattoo. The result is the same: the information is there when you need it.

Here’s how we tattoo the paths:

# In ~/.claude/CLAUDE.md

## Tools

- **`zoxide`** installed as alias for `cd` in Fish.
  When you don't know a project's path, use
  `zoxide query <pattern>` instead of `find`.

## Common project paths

| Project        | Path                              |
| --------------- | --------------------------------- |
| My app          | `~/code/my-app`                   |
| Course          | `~/courses/my-course/program`     |
| Blog (Hugo)     | check with `zoxide query blog`    |
| Infra (ansible) | `~/code/infra/ansible`            |

Two things happen here:

  1. You give it the paths directly. For the most frequent projects, it doesn’t even need to search. It has them in the table.
  2. You teach it the tool. For any project not in the table, it knows it can do zoxide query <name> and get the path instantly.

It’s a cascading fallback:

  1. Check the table → direct path, zero cost.
  2. zoxide query <pattern> → milliseconds, almost always hits.
  3. find → last resort, slow, noisy. But should never get here.

What changed

Before the tattoos, a typical session started like this:

Me: "Open the course project and check the tests"
Claude: *runs find . -name "p101" -type d*
Claude: *waits 8 seconds*
Claude: *tries another find with maxdepth*
Claude: "I found /Users/fernando/courses/p101/program"

After:

Me: "Open the course project and check the tests"
Claude: *reads the table, goes straight to ~/courses/p101/program*
Claude: "There are 3 failing tests in the authentication module..."

From 15 seconds lost and three attempts to zero friction. Multiplied by the dozens of times you switch projects per day, it’s real time recovered.

The second tattoo: memory

Claude Code has another more fine-grained persistence mechanism: per-project memory files. These are notes that the agent (or you) can save and that load only when working on that project.

When Claude wasted time searching for a directory with find, I told it to make a note. And it created this in its project memory:

# zoxide-directories

When you don't know a project's path, use
`zoxide query <pattern>` instead of `find`.

Time was wasted searching for /courses/p101 with find
when zoxide query p101 would have resolved it instantly.

It’s like the Post-its Leonard sticks around the motel room. Notes for his future self. “Don’t search. Ask zoxide.”

The lesson that goes beyond paths

The pattern here isn’t “install zoxide.” That’s the specific tool. The pattern is:

If your agent repeats a mistake, don’t yell at it — tattoo the correction.

Does it use npm install when it should use pnpm? Put it in CLAUDE.md. Does it create files with Latin-1 encoding? Put it in CLAUDE.md. Doesn’t it know your API requires a custom header? Put it in CLAUDE.md.

Every repeated frustration is a tattoo you haven’t written yet.

And here’s the fundamental difference from a human coworker: a human learns on their own (or should). An AI agent needs you to write the tattoos. But once written, it never forgets them. Doesn’t have bad days. Doesn’t get distracted. Doesn’t decide it “already knows” and stop reading the instructions.

In that way, Leonard with his tattoos is more reliable than most of us with our goldfish memory.

How to start

If you work with Claude Code (or any agent that supports instruction files), do yourself a favor:

  1. Install zoxide — brew install zoxide, add the init to your shell, and use z instead of cd for a week. After that, you won’t want to go back.

  2. Create your CLAUDE.md — Start with basics: your shell, your paths, your preferred tools. Doesn’t need to be long. Five useful lines are worth more than a page of blabber.

  3. Every time the agent does something wrong twice, stop and write the tattoo. Not the third time. The second. The second time it’s no longer a one-off error — it’s a pattern. And patterns get tattooed.

# Your first tattoo could be something as simple as:
echo '- Shell: Fish. NOT bash/zsh.' >> ~/.claude/CLAUDE.md

It’s not glamorous. It’s not a plugin architecture with dependency injection. It’s a plain text file that tells your agent how your world works.

But it works. Every day. Without forgetting. Like a good tattoo.

This article was originally written in Spanish and translated with the help of AI.