ANTIGRAVITY LABJP
Articles/Editor View
Editor View/2026-07-17Advanced

One Space in a Path, and Nine Commands Reported Success While Counting the Wrong Place

A single space in a workspace name sends agent-written commands somewhere else, quietly. Measurements across eleven unquoted-path forms, and the entry-point script that closes the boundary in one cd.

Antigravity338WorkspaceShellAgents22Automation7

Premium Article

I asked an agent to count the articles in my workspace. It came back with 0 files.

There are 977 MDX files in there. Typing the same command by hand returns 977, every time.

No error. The command succeeded. It just counted somewhere else.

The culprit was the workspace name: Dolice Labs. That one space in the middle.

As an indie developer I get to pick where my workspace lives, which is exactly how it ends up somewhere convenient rather than somewhere safe. Mine sits inside a Dropbox sync folder, and I never thought twice about the space in the folder name. Names are for humans to read, and a space reads better.

Handing the keyboard to an agent is what finally sent me the bill for that decision.

The space is in the prefix, not the leaf

The first thing I measured was how much of the tree was even affected.

Counting directories three levels deep:

WS="/path/to/Dolice Labs"
find "$WS" -maxdepth 3 -type d | wc -l              # 1951
find "$WS" -maxdepth 3 -type d | grep -c ' '        # 1951

1,951 out of 1,951. All of them.

Then I counted the filenames instead, and the picture flipped completely:

find "$WS" -maxdepth 3 -type f | wc -l                                # 1816
find "$WS" -maxdepth 3 -type f | awk -F/ '{print $NF}' | grep -c ' '  # 5

5 out of 1,816. Under a third of a percent.

Same workspace, same files. Change how you count and you get 100% or 0.3%.

The space almost never lives in a filename. It lives in exactly one place — the Dolice Labs segment of the prefix. And every absolute path you build carries that one segment along with it.

A tidily named file buried deep in node_modules picks up a space the instant you address it absolutely.

That was the fork in the road. The problem wasn't the filenames. It was how paths get assembled.

Eleven unquoted forms, and what each one actually returns

An agent writing shell won't reliably type "$WS" with the quotes. So I measured what happens when it writes plain $WS, across eleven forms.

Setting up a workspace with a space in it:

BASE="$HOME/pathprobe"
WS="$BASE/Dolice Labs"
mkdir -p "$WS/content/articles/ja/tips" "$WS/out"
for i in 1 2 3 4 5; do echo "# a$i" > "$WS/content/articles/ja/tips/a$i.mdx"; done
mkdir -p "$BASE/sandbox" && cd "$BASE/sandbox"

Five .mdx files. Now touch them without quoting $WS.

Command formExit codeReturnedCorrect
find $WS -name "*.mdx" | wc -l005
ls $WS | wc -l004
grep -rl "a1" $WS | wc -l001
[ -d $WS ] && echo yes || echo no0noyes
mkdir -p $WS/out/gen0createdcreated in 2 wrong places
for f in $(find "$WS" -name "*.mdx")010 iterations5 iterations
find "$WS" ... | xargs wc -l00 total5 total
python3 script.py $WS (argv count)021
du -sh $WS012K (of something else)real size
cat $WS/.../a1.mdx1# a1
cp $WS/.../a1.mdx ./c.mdx1copied

Two forms failed out loud: cat and cp. The other nine — 82% of them — returned exit code 0 while handing back the wrong answer.

The failure modes aren't uniform, and the differences matter.

find and grep succeed with zero results. $WS splits into /path/to/Dolice and Labs, neither exists, so there's nothing to search and the walk finishes normally. The complaint goes to stderr, but pipe it into wc -l and the exit code belongs to wc. The scream never reaches the caller.

[ -d $WS ] says a directory that exists doesn't. Split into two words, [ miscounts its arguments, the test never forms, and it returns false. Any branch keyed on an existence check quietly takes the other road.

for f in $(find "$WS" ...) turns 5 files into 10 iterations. find is quoted here and returns the right 5 paths — then command substitution word-splits each one at the space. The loop runs ten times and grabs a broken path every time. This is the sneakiest form of all: you quoted it, and it broke anyway.

python3 script.py $WS lands 2 items in argv. If the script reads sys.argv[1] and gets on with it, it starts working on /path/to/Dolice in good faith.

And mkdir -p $WS/out/gen returned 0 while creating directories in two places that weren't the workspace:

$ ls -A "$BASE/sandbox"     # current directory
Labs
 
$ ls -A "$BASE"
Dolice   Dolice Labs   sandbox

mkdir -p /path/to/Dolice Labs/out/gen parses as two arguments: /path/to/Dolice and Labs/out/gen. The first is absolute, so it lands next to the workspace. The second is relative, so it lands wherever you happened to be standing.

Reads come back empty. Writes land somewhere you weren't looking. That asymmetry defines the whole problem.

An empty read is at worst nothing happening. A write that succeeded in the wrong place means the agent reports "done" and the output exists nowhere you'll think to check. That's the one I hit first.

The absence of an error proved nothing at all.

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
Measured across 11 unquoted-path forms: 9 return exit 0 with wrong results (find says 0, for loops 10 times, argv holds 2)
Full implementation of ws.sh, an entry point that closes the boundary at a single cd (write probe, exit code 78, exec handoff)
Where the symlink alias breaks down: find refuses to follow it, and readlink -f hands the space right back
Secure payment via Stripe · Cancel anytime

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Antigravity Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • Copy-paste ready implementation code
  • New advanced guides published daily
  • $5/mo or $10 for lifetime access
View Membership →

Related Articles

Agents & Manager2026-04-27
Letting Antigravity Be Your Night-Shift Engineer: A Solo Dev Operating Model
How to operate Antigravity agents as the second engineer who works while you sleep. Task hand-off, scope boundaries, and a five-minute morning review — the model I have refined while running multiple products solo.
Editor View2026-07-16
Three Ways to Hand 4,000 Lines of Logs to an Agent — Paste, .txt Attachment, or @ Reference
v2.3.0 added plain-text attachments, which means there are now three ways to hand a long log to an agent — and a new question about which one to pick. Here is how I trim, measure, and decide, with the scripts I actually run.
Editor View2026-07-16
Your UI Is in Japanese. Your Commit Log Isn't.
Setting your editor's display language does nothing for the language your agents write into the repository. Here is what six weeks of unattended runs actually produced, how to pin output language per audience, and a gate that catches the drift mechanically.
📚RECOMMENDED BOOKS
Build a Large Language Model (From Scratch)
Sebastian Raschka
LLM Dev
Prompt Engineering for LLMs
Berryman & Ziegler
Prompting
AI Engineering
Chip Huyen
AI Eng
* Contains affiliate links
See all →