Skip to content
WIP

This guide is a work in progress — it is incomplete and parts are out of date.

Empowering with traits

This guide shows you how to give a session more tools by choosing traits, for one session or for every session your identity starts.

A trait is a named grant of tools, and it can also mount skills and point the agent at instructions. For the full definition, see traits. Traits only add access: a bound only takes it away, and any bound a trait carries joins the session’s other bounds.

The example is the memory trait. The memory bag ships with Barry, and every bag gets an automatic trait with the bag’s own name.

To see every trait on your machine, run:

Terminal
barry trait list

Each entry names the trait and lists the namespaces it grants, the skills it mounts, its access level, and any restrictions it carries.

Every session gets the coding, sessions, and instructions traits. The traits you choose add to those.

  1. To start a session with the memory tools, run:

    Terminal
    barry --traits memory

    Separate several traits with commas. Passing --traits skips the picker.

  2. To choose from a list instead, start a session without --traits:

    Terminal
    barry --show-builtin

    Move with the arrow keys, press Space to select a trait, and press Enter to start. The picker hides the traits of bags that ship with Barry, such as memory, unless you pass --show-builtin.

Your identity’s default traits join every session it starts, whatever you choose in the picker.

  1. To add memory to your identity’s default traits, run:

    Terminal
    barry identity traits add memory
  2. To take the trait off again, run:

    Terminal
    barry identity traits remove memory

To remove every default trait at once, run barry identity traits clear. The coding, sessions, and instructions traits still apply. Each of these commands acts on the identity you use; pass --name to change a different one.

Packing a bag loads its hooks, instructions, and actions, but its tools reach a session only when a trait selects them. That is bag_grant: session, the default.

If you want every packed bag’s tools in every session, set this line in your identity’s identity.yaml:

bag_grant: identity

Each packed bag then grants its automatic trait to every session. Any other value reads as session. For how packing works, see Packing bags.