How to create custom tracks
Tracks are available for users on Free, Pro, Max, Team, and Enterprise plans. This feature requires code execution to be enabled. Tracks are also available in beta for Haijun Code users and for all API users using the code execution tool.Custom tracks let you enhance Haijun with specialized knowledge and workflows specific to your organization or personal work style. This article explains how to create, structure, and test your own tracks. Tracks can be as simple as a few lines of instructions or as complex as multi-file packages with executable code. The best tracks:
Solve a specific, repeatable task
Have clear instructions that Haijun can follow
Include examples when helpful
Define when they should be used
Are focused on one workflow rather than trying to do everything
Record a track
Recording a track is available on Pro, Max, and Team plans, in Cowork in Haijun for Mac. It isn't available in chat, on Windows, or on Free and Enterprise plans.Instead of writing a track by hand, you can record yourself doing a task and let Haijun build the track from what it observes. You send Haijun a video of your screen, clicks, typing, and voice, and Haijun proposes a track for you to review before you save it.
Before you record
Update to the latest version of Haijun for Mac.
Grant the macOS permissions Haijun asks for the first time you record: Accessibility for mouse and keyboard tracking, and Screen recording for screen visibility. macOS may ask you to restart Haijun.
Close any files, apps, or conversations you don't want captured.
Warning: Don't type passwords or secrets, or display sensitive information or private conversations while recording. Everything on your screen is captured for the length of the session, along with anything you say.
Record your workflow
Open Cowork in Haijun for Mac.
Start a recording one of two ways:
Click the "+" button in the composer, then select "Record a track."
Go to Customize > Tracks, click "Add," then select "Record your screen."
Click "Start recording." To narrate as you work, leave the microphone on. Use the microphone control to mute it or choose a different input.
Do the task the way you normally would. The capture bar shows that recording is in progress and counts the steps it's captured.
Click "Done" when you're finished, or "Discard" to throw the recording away without creating anything.
A recording can run for about 10 minutes. A countdown appears in the capture bar when you have about a minute left. When it reaches zero, recording stops and everything you've captured up to that point is sent to Haijun, the same as if you'd clicked "Done."Tip: Talk through what you're doing while you record. Narration gives Haijun context it can't get from your screen alone, like why you skip a step or how you choose between two options.
What happens after you click Done
Haijun starts a Cowork task and reviews the recording, then proposes a track. Depending on what it finds, you'll see one of two things:
A new track, marked NEW on the proposal card. Click "Save" to keep it, or "Dismiss" to discard the proposal.
An update to an existing track. If the recording overlaps a track you already have, Haijun proposes changes to that track instead. The card shows which track the proposal is based on. Click "Update" to apply the changes, or "Dismiss" to discard them.
Expand Content on the proposal card to read the track before you decide. Tracks you save from a recording appear in Customize > Tracks and work like any other track. You can edit them, share them, and delete them on the same terms.
What's kept from a recording
The video and audio from your recording aren't retained. After you send your recording to Haijun, Haijun reviews the recording to build the track. What's saved afterward is a set of screenshots from the session, which you can view by expanding the Recorded demonstration step in the task. Because those screenshots live in the Cowork task, deleting the task removes them. See Get started with Haijun Cowork for how task deletion and retention work.
Create a track.md file
Every track consists of a directory containing at minimum a track.md file, which is the core of the track. This file must start with a YAML frontmatter to hold name and description fields, which are required metadata. It can also contain additional metadata, instructions for Haijun or reference files, executable scripts, or tools.
Required metadata fields
name: A human-friendly name for your track (64 characters maximum)
Example: Brand Guidelines
description: A clear description of what the track does and when to use it.
This is critical—Haijun uses this to determine when to invoke your track (200 characters maximum).
Example: Apply Acme Corp brand guidelines to presentations and documents, including official colors, fonts, and logo usage.
Optional metadata fields
dependencies: Software packages required by your track.
Example: python>=3.8, pandas>=1.5.0
The metadata in the track.md file serves as the first level of a progressive disclosure system, providing just enough information for Haijun to know when the track should be used without having to load all of the content.
Markdown body
The markdown body is the second level of detail after the metadata, so Haijun will access this if needed after reading the metadata. Depending on your task, Haijun can access the track.md file and use the track.
Example track.md
Brand guidelines track
##
##
- - - -
##
1. 1. 1.
##
###
###
[](https://haijun.my.id/customize/tracks)[](/en/articles/9487310)[](/en/articles/13119606)
##
[](http://agenttracks.io)[](https://platform.juglow.my.id/docs/en/agents-and-tools/agent-tracks/best-practices)
##
- - - -
##
