Combine GPX files into one track in the right order
Five recordings of a four-day hike as one GPX, in time order, heart rate kept.
A real run on 13 November 2026, on a Linux computer, using Claude Code with Opus, on a Claude plan.
The short answer.
The free GPSBabel can merge GPX files and sort the points by time; gpx.studio in the browser lets you drop the files in and merge them by hand. Both work, but watch for two things: files merged in file-name order instead of time order, and times dropped in the merge. Stella (stella.sh) combines them on your computer in time order, keeps times, elevation and heart rate, and tells you which recording is which.
Stella does this on Windows, Mac and Linux.
What happened.
One GPX in about 35 seconds. Checked afterwards against an answer key written before the run: West Highland hike - full trip.gpx parses as GPX, holds all 1,970 points from the five files in time order from day 1's first point to day 4's last, every point keeps its time and elevation, heart rate is kept, and the originals are unchanged.
The route and recordings are made up for this run; the place names are fictional. The run isn't sped up; a long idle stretch after the answer is cut.
How Stella does it.
- Finds five GPX files in the West Highland hike folder, not four: day 2 was recorded in two parts, one from a phone app with a different layout
- Orders them by their timestamps, not their file names (
Activity_20891.gpxturned out to be day 4) - Checks each piece starts within about 50 m of where the last one ended
- Writes one GPX track with each recording as its own section, so the overnight stops don't draw straight lines across the map
- Keeps the watch's heart-rate data and leaves the five originals unchanged
The prompt.
I recorded my 4-day hike as separate GPX files, in the West Highland hike folder in Downloads. Combine them into one GPX in the right order so I can upload the whole trip.
This is the exact prompt from the recording. If your files are somewhere else, say where.
Do it yourself.
Check which file is which day
Open each GPX in a text editor and look at the first
<time>: file names from watches and apps often don't sort by date. Note any day recorded in two parts.Merge with GPSBabel
Install the free GPSBabel. Add every file as input with the format GPX, set the output to GPX, and under Filters turn on Tracks with Merge, which joins the tracks and sorts the points by time. Save.
Or merge in the browser
Open gpx.studio, drop all the files in, put them in day order in the file list, and use its merge tool. Export as GPX. The files are loaded into a web page to do this.
Check before uploading
Open the merged file in a map viewer or gpx.studio. Look for straight lines between days, a missing piece, or times shown as missing. Then upload it to Strava, Garmin Connect or Komoot.
Where it stops.
- Gaps stay as gaps: if a watch was off for a stretch, Stella doesn't invent the missing path.
- It doesn't upload to Strava or Garmin for you unless you ask and are signed in there in your browser.
- The merge runs on your computer and nothing is uploaded, but what Stella reads while working, such as file names, times and place names, goes to the AI model you use in Stella.
- Recorded on Linux, where Stella used only Python, which is built in on Mac and Linux. On Windows it may install Python first, which wasn't recorded.
Questions.
Will Strava accept one GPX for several days?
It takes it as one long activity covering the whole trip. If you'd rather have one activity per day, upload the original day files separately instead.
Why does my merged track have straight lines across the map?
The merge joined the end of one day to the start of the next as one line. Keeping each recording as its own track segment, as Stella did, stops that.
Can it convert GPX to another format?
Yes: see convert GPX to KML for Google Earth. CSV and other formats work the same way; ask in the same chat.
What else can it tidy in a trip folder?
Photos, for a start: sort them into folders by date and remove their location before sharing.
Is Stella free for this?
Yes. Free with the ChatGPT or Claude plan you already have. Sign in with your ChatGPT plan, or use your Claude plan through Claude Code, and this task costs nothing extra. New accounts also get a small free trial of Stella’s own models.
Can I control what Stella changes on my computer?
Yes. Stella works on Windows, Mac and Linux with your own files and shows each step in the chat, so you can watch it and stop it at any point. Tell it what it may not do, as the prompts on these pages do (“don't delete anything without asking”). In the Downloads recording it deleted nothing until it was told to go ahead. It also refuses commands that would wipe a whole disk, your home folder or system folders.
Checked against these sources on 13 November 2026.